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
13DUALCASE=1; export DUALCASE # for MKS sh
14if 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
21else
22  case `(set -o) 2>/dev/null` in #(
23  *posix*) :
24    set -o posix ;; #(
25  *) :
26     ;;
27esac
28fi
29
30
31as_nl='
32'
33export as_nl
34# Printing a long string crashes Solaris 7 /usr/bin/printf.
35as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
36as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
37as_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.
40if 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 --'
44elif (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'
47else
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'
67fi
68
69# The user is always right.
70if 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  }
76fi
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.)
84IFS=" ""	$as_nl"
85
86# Find who we are.  Look in the path if we contain no directory separator.
87as_myself=
88case $0 in #((
89  *[\\/]* ) as_myself=$0 ;;
90  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
91for as_dir in $PATH
92do
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
97IFS=$as_save_IFS
98
99     ;;
100esac
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.
103if test "x$as_myself" = x; then
104  as_myself=$0
105fi
106if test ! -f "$as_myself"; then
107  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
108  exit 1
109fi
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.
115for as_var in BASH_ENV ENV MAIL MAILPATH
116do eval test x\${$as_var+set} = xset \
117  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
118done
119PS1='$ '
120PS2='> '
121PS4='+ '
122
123# NLS nuisances.
124LC_ALL=C
125export LC_ALL
126LANGUAGE=C
127export LANGUAGE
128
129# CDPATH.
130(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
131
132if 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
140else
141  case \`(set -o) 2>/dev/null\` in #(
142  *posix*) :
143    set -o posix ;; #(
144  *) :
145     ;;
146esac
147fi
148"
149  as_required="as_fn_return () { (exit \$1); }
150as_fn_success () { as_fn_return 0; }
151as_fn_failure () { as_fn_return 1; }
152as_fn_ret_success () { return 0; }
153as_fn_ret_failure () { return 1; }
154
155exitcode=0
156as_fn_success || { exitcode=1; echo as_fn_success failed.; }
157as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
158as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
159as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
160if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
161
162else
163  exitcode=1; echo positional parameters were not saved.
164fi
165test x\$exitcode = x0 || exit 1
166test -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
171test \$(( 1 + 1 )) = 2 || exit 1"
172  if (eval "$as_required") 2>/dev/null; then :
173  as_have_required=yes
174else
175  as_have_required=no
176fi
177  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
178
179else
180  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
181as_found=false
182for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
183do
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
197fi
198fi
199	   done;;
200       esac
201  as_found=false
202done
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
206fi; }
207IFS=$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.
216BASH_ENV=/dev/null
217ENV=/dev/null
218(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
219case $- in # ((((
220  *v*x* | *x*v* ) as_opts=-vx ;;
221  *v* ) as_opts=-v ;;
222  *x* ) as_opts=-x ;;
223  * ) as_opts= ;;
224esac
225exec $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
229exit 255
230fi
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@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
245fi
246fi
247fi
248SHELL=${CONFIG_SHELL-/bin/sh}
249export SHELL
250# Unset more variables known to interfere with behavior of common tools.
251CLICOLOR_FORCE= GREP_OPTIONS=
252unset CLICOLOR_FORCE GREP_OPTIONS
253
254## --------------------- ##
255## M4sh Shell Functions. ##
256## --------------------- ##
257# as_fn_unset VAR
258# ---------------
259# Portably unset VAR.
260as_fn_unset ()
261{
262  { eval $1=; unset $1;}
263}
264as_unset=as_fn_unset
265
266# as_fn_set_status STATUS
267# -----------------------
268# Set $? to STATUS, without forking.
269as_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.
277as_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.
287as_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.
335as_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.
345if (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  }'
350else
351  as_fn_append ()
352  {
353    eval $1=\$$1\$2
354  }
355fi # 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.
362if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
363  eval 'as_fn_arith ()
364  {
365    as_val=$(( $* ))
366  }'
367else
368  as_fn_arith ()
369  {
370    as_val=`expr "$@" || test $? -eq 1`
371  }
372fi # 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.
380as_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
391if expr a : '\(a\)' >/dev/null 2>&1 &&
392   test "X`expr 00001 : '.*\(...\)'`" = X001; then
393  as_expr=expr
394else
395  as_expr=false
396fi
397
398if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
399  as_basename=basename
400else
401  as_basename=false
402fi
403
404as_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
423if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
424  as_dirname=dirname
425else
426  as_dirname=false
427fi
428
429# Avoid depending upon Character Ranges.
430as_cr_letters='abcdefghijklmnopqrstuvwxyz'
431as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
432as_cr_Letters=$as_cr_letters$as_cr_LETTERS
433as_cr_digits='0123456789'
434as_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
472ECHO_C= ECHO_N= ECHO_T=
473case `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';;
483esac
484
485rm -f conf$$ conf$$.exe conf$$.file
486if test -d conf$$.dir; then
487  rm -f conf$$.dir/conf$$.file
488else
489  rm -f conf$$.dir
490  mkdir conf$$.dir 2>/dev/null
491fi
492if (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
506else
507  as_ln_s='cp -pR'
508fi
509rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
510rmdir conf$$.dir 2>/dev/null
511
512if mkdir -p . 2>/dev/null; then
513  as_mkdir_p='mkdir -p "$as_dir"'
514else
515  test -d ./-p && rmdir ./-p
516  as_mkdir_p=false
517fi
518
519as_test_x='test -x'
520as_executable_p=as_fn_executable_p
521
522# Sed expression to map a string onto a valid CPP name.
523as_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.
526as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
527
528
529
530
531
532SHELL=${CONFIG_SHELL-/bin/sh}
533
534# How were we run?
535at_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.
540at_times_p=false
541(times) >/dev/null 2>&1 && at_times_p=:
542
543# CLI Arguments to pass to the debugging scripts.
544at_debug_args=
545# -e sets to true
546at_errexit_p=false
547# Shall we be verbose?  ':' means no, empty means yes.
548at_verbose=:
549at_quiet=
550# Running several jobs in parallel, 0 means as many as test groups.
551at_jobs=1
552at_traceon=:
553at_trace_echo=:
554at_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.
558at_debug_p=false
559# Display help message?
560at_help_p=false
561# Display the version message?
562at_version_p=false
563# List test groups?
564at_list_p=false
565# --clean
566at_clean=false
567# Test groups to run
568at_groups=
569# Whether to rerun failed tests.
570at_recheck=
571# Whether a write failure occurred
572at_write_fail=0
573
574# The directory we run the suite in.  Default to . if no -C option.
575at_dir=`pwd`
576# An absolute reference to this testsuite script.
577case $as_myself in
578  [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
579  * ) at_myself=$at_dir/$as_myself ;;
580esac
581# Whether -C is in effect.
582at_change_dir=false
583
584# Whether to enable colored test results.
585at_color=auto
586# List of the tested programs.
587at_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.
591at_format='???'
592# Description of all the test groups.
593at_help_all="1;input.at:27;Invalid inputs;;
5942;input.at:57;Invalid inputs with {};;
5953;input.at:84;Invalid \$n and @n;;
5964;input.at:104;Type Clashes;;
5975;input.at:285;Unused values;;
5986;input.at:295;Unused values before symbol declarations;;
5997;input.at:305;Default %printer and %destructor redeclared;;
6008;input.at:365;Per-type %printer and %destructor redeclared;;
6019;input.at:408;Unused values with default %destructor;;
60210;input.at:450;Unused values with per-type %destructor;;
60311;input.at:475;Incompatible Aliases;;
60412;input.at:516;Torturing the Scanner;;
60513;input.at:674;Typed symbol aliases;;
60614;input.at:710;Require 1.0;;
60715;input.at:711;Require 2.7;;
60816;input.at:713;Require 100.0;;
60917;input.at:720;String aliases for character tokens;;
61018;input.at:741;Symbols;;
61119;input.at:807;Numbered tokens;;
61220;input.at:845;Unclosed constructs;;
61321;input.at:909;%start after first rule;;
61422;input.at:930;%prec takes a token;;
61523;input.at:951;%prec's token must be defined;;
61624;input.at:971;Reject unused %code qualifiers;;
61725;input.at:1060;%define errors;;
61826;input.at:1096;%define, --define, --force-define;;
61927;input.at:1161;%define Boolean variables;;
62028;input.at:1181;%define enum variables;;
62129;input.at:1216;%define backward compatibility;;
62230;input.at:1257;Unused %define api.pure;;
62331;input.at:1290;C++ namespace reference errors;;
62432;input.at:1346;Bad character literals;;
62533;input.at:1399;Bad escapes in literals;;
62634;input.at:1448;LAC: Errors for %define;;
62735;input.at:1471;-Werror is not affected by -Wnone and -Wall;;
62836;input.at:1505;%name-prefix and %define api.prefix are incompatible;;
62937;input.at:1534;Stray \$ or @;;
63038;input.at:1568;Code injection;;
63139;named-refs.at:21;Tutorial calculator;;
63240;named-refs.at:195;Undefined and ambiguous references;;
63341;named-refs.at:271;Misleading references;;
63442;named-refs.at:288;Many kinds of errors;;
63543;named-refs.at:521;Missing identifiers in brackets;;
63644;named-refs.at:535;Redundant words in brackets;;
63745;named-refs.at:549;Comments in brackets;;
63846;named-refs.at:563;Stray symbols in brackets;;
63947;named-refs.at:580;Redundant words in LHS brackets;;
64048;named-refs.at:595;Factored LHS;;
64149;named-refs.at:606;Unresolved references;;
64250;named-refs.at:671;\$ or @ followed by . or -;;
64351;output.at:44;Output files:  -dv ;;
64452;output.at:50;Output files:  -dv >&-;;
64553;output.at:55;Output files:  -dv -o foo.c ;;
64654;output.at:57;Output files:  -dv -o foo.tab.c ;;
64755;output.at:59;Output files:  -dv -y ;;
64856;output.at:61;Output files:  -dv -b bar ;;
64957;output.at:63;Output files:  -dv -g -o foo.c ;;
65058;output.at:67;Output files: %defines %verbose  ;;
65159;output.at:69;Output files: %defines %verbose %yacc  ;;
65260;output.at:72;Output files: %defines %verbose %yacc  ;;
65361;output.at:76;Output files: %file-prefix \"bar\" %defines %verbose  ;;
65462;output.at:78;Output files: %output=\"bar.c\" %defines %verbose %yacc  ;;
65563;output.at:80;Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  ;;
65664;output.at:87;Output files: %defines %verbose  ;;
65765;output.at:90;Output files: %defines %verbose  -o foo.c ;;
65866;output.at:93;Output files:  --defines=foo.hpp -o foo.c++ ;;
65967;output.at:97;Output files: %defines \"foo.hpp\" -o foo.c++ ;;
66068;output.at:101;Output files:  -o foo.c++ --graph=foo.gph ;;
66169;output.at:116;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
66270;output.at:119;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
66371;output.at:123;Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc ;;
66472;output.at:128;Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  ;;
66573;output.at:158;Conflicting output files:  --graph=\"foo.tab.c\";;
66674;output.at:163;Conflicting output files: %defines \"foo.output\" -v;;
66775;output.at:168;Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\";;
66876;output.at:173;Conflicting output files:  -o foo.y;;
66977;output.at:219;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++;
67078;output.at:226;Output file name: (;c++;
67179;output.at:227;Output file name: );c++;
67280;output.at:228;Output file name: #;c++;
67381;output.at:229;Output file name: @@;c++;
67482;output.at:230;Output file name: @{;c++;
67583;output.at:231;Output file name: @};c++;
67684;output.at:232;Output file name: [;c++;
67785;output.at:233;Output file name: ];c++;
67886;output.at:260;Graph with no conflicts;graph;
67987;output.at:294;Graph with unsolved S/R;graph;
68088;output.at:358;Graph with solved S/R;graph;
68189;output.at:417;Graph with R/R;graph;
68290;output.at:449;Graph with reductions with multiple LAT;graph;
68391;output.at:508;Graph with a reduction rule both enabled and disabled;graph;
68492;skeletons.at:24;Relative skeleton file names;;
68593;skeletons.at:84;Installed skeleton file names;;
68694;skeletons.at:146;%define Boolean variables: invalid skeleton defaults;;
68795;skeletons.at:170;Complaining during macro argument expansion;;
68896;skeletons.at:252;Fatal errors make M4 exit immediately;;
68997;skeletons.at:306;Fatal errors but M4 continues producing output;;
69098;sets.at:66;Nullable;;
69199;sets.at:151;Broken Closure;;
692100;sets.at:193;Firsts;;
693101;sets.at:269;Accept;;
694102;reduce.at:25;Useless Terminals;;
695103;reduce.at:69;Useless Nonterminals;;
696104;reduce.at:124;Useless Rules;report;
697105;reduce.at:271;Reduced Automaton;report;
698106;reduce.at:381;Underivable Rules;report;
699107;reduce.at:423;Empty Language;;
700108;reduce.at:474;no %define lr.type: Single State Split;;
701109;reduce.at:474;%define lr.type lalr: Single State Split;;
702110;reduce.at:474;%define lr.type ielr: Single State Split;;
703111;reduce.at:474;%define lr.type canonical-lr: Single State Split;;
704112;reduce.at:707;no %define lr.type: Lane Split;;
705113;reduce.at:707;%define lr.type lalr: Lane Split;;
706114;reduce.at:707;%define lr.type ielr: Lane Split;;
707115;reduce.at:707;%define lr.type canonical-lr: Lane Split;;
708116;reduce.at:951;no %define lr.type: Complex Lane Split;;
709117;reduce.at:951;%define lr.type lalr: Complex Lane Split;;
710118;reduce.at:951;%define lr.type ielr: Complex Lane Split;;
711119;reduce.at:951;%define lr.type canonical-lr: Complex Lane Split;;
712120;reduce.at:1220;no %define lr.type: Split During Added Lookahead Propagation;;
713121;reduce.at:1220;%define lr.type lalr: Split During Added Lookahead Propagation;;
714122;reduce.at:1220;%define lr.type ielr: Split During Added Lookahead Propagation;;
715123;reduce.at:1220;%define lr.type canonical-lr: Split During Added Lookahead Propagation;;
716124;reduce.at:1550;no %define lr.default-reductions;;
717125;reduce.at:1550;%define lr.default-reductions most;;
718126;reduce.at:1550;%define lr.default-reductions consistent;;
719127;reduce.at:1550;%define lr.default-reductions accepting;;
720128;synclines.at:150;Prologue syncline;;
721129;synclines.at:168;%union syncline;;
722130;synclines.at:189;Postprologue syncline;;
723131;synclines.at:213;Action syncline;;
724132;synclines.at:232;Epilogue syncline;;
725133;synclines.at:249;%code top syncline;;
726134;synclines.at:290;%no-lines;;
727135;synclines.at:291;%no-lines;;
728136;synclines.at:292;%no-lines;;
729137;synclines.at:293;%no-lines;;
730138;headers.at:57;Invalid CPP guards:  --defines=input/input.h;;
731139;headers.at:58;Invalid CPP guards:  --defines=9foo.h;;
732140;headers.at:59;Invalid CPP guards: %glr-parser --defines=input/input.h;;
733141;headers.at:60;Invalid CPP guards: %glr-parser --defines=9foo.h;;
734142;headers.at:69;export YYLTYPE;;
735143;headers.at:125;Several parsers;c++;
736144;actions.at:24;Mid-rule actions;;
737145;actions.at:133;Initial location: yacc.c ;;
738146;actions.at:134;Initial location: yacc.c %define api.pure full;;
739147;actions.at:135;Initial location: yacc.c %define api.pure %parse-param { int x };;
740148;actions.at:136;Initial location: yacc.c %define api.push-pull both;;
741149;actions.at:137;Initial location: yacc.c %define api.push-pull both %define api.pure full;;
742150;actions.at:138;Initial location: glr.c ;;
743151;actions.at:139;Initial location: glr.c %define api.pure;;
744152;actions.at:140;Initial location: lalr1.cc ;c++;
745153;actions.at:141;Initial location: glr.cc ;c++;
746154;actions.at:150;Initial location: yacc.c %define api.pure full;;
747155;actions.at:161;Initial location: yacc.c %define api.pure full;;
748156;actions.at:244;Location print: yacc.c ;;
749157;actions.at:245;Location print: glr.c ;;
750158;actions.at:257;Exotic Dollars;;
751159;actions.at:751;Printers and Destructors;;
752160;actions.at:752;Printers and Destructors with union;;
753161;actions.at:754;Printers and Destructors: %defines %skeleton \"lalr1.cc\";c++;
754162;actions.at:755;Printers and Destructors with union: %defines %skeleton \"lalr1.cc\";c++;
755163;actions.at:757;Printers and Destructors: %glr-parser;;
756164;actions.at:758;Printers and Destructors with union: %glr-parser;;
757165;actions.at:769;Default tagless %printer and %destructor;;
758166;actions.at:867;Default tagged and per-type %printer and %destructor;;
759167;actions.at:991;Default %printer and %destructor for user-defined end token;;
760168;actions.at:1098;Default %printer and %destructor are not for error or \$undefined;;
761169;actions.at:1193;Default %printer and %destructor are not for \$accept;;
762170;actions.at:1258;Default %printer and %destructor for mid-rule values;;
763171;actions.at:1406;@\$ in %initial-action implies %locations;;
764172;actions.at:1407;@\$ in %destructor implies %locations;;
765173;actions.at:1408;@\$ in %printer implies %locations;;
766174;actions.at:1529;Qualified \$\$ in actions: yacc.c;;
767175;actions.at:1530;Qualified \$\$ in actions: glr.c;;
768176;actions.at:1531;Qualified \$\$ in actions: lalr1.cc;c++;
769177;actions.at:1532;Qualified \$\$ in actions: glr.cc;c++;
770178;actions.at:1540;Fix user actions without a trailing semicolon;;
771179;actions.at:1649;Destroying lookahead assigned by semantic action;;
772180;actions.at:1708;YYBACKUP;;
773181;conflicts.at:31;S/R in initial;;
774182;conflicts.at:57;%nonassoc and eof;;
775183;conflicts.at:155;%error-verbose and consistent errors;c++ java;
776184;conflicts.at:456;LAC: %nonassoc requires splitting canonical LR states;;
777185;conflicts.at:546;Unresolved SR Conflicts;report;
778186;conflicts.at:653;Resolved SR Conflicts;report;
779187;conflicts.at:775;Defaulted Conflicted Reduction;report;
780188;conflicts.at:894;%expect not enough;;
781189;conflicts.at:914;%expect right;;
782190;conflicts.at:931;%expect too much;;
783191;conflicts.at:951;%expect with reduce conflicts;;
784192;conflicts.at:971;%prec with user string;;
785193;conflicts.at:988;%no-default-prec without %prec;;
786194;conflicts.at:1014;%no-default-prec with %prec;;
787195;conflicts.at:1038;%default-prec;;
788196;conflicts.at:1062;Unreachable States After Conflict Resolution;;
789197;conflicts.at:1273;Solved conflicts report for multiple reductions in a state;;
790198;conflicts.at:1353;%nonassoc error actions for multiple reductions in a state;;
791199;conflicts.at:1422;-W versus %expect and %expect-rr;;
792200;calc.at:597;Calculator ;;
793201;calc.at:599;Calculator %defines;;
794202;calc.at:600;Calculator %locations;;
795203;calc.at:602;Calculator %name-prefix=\"calc\";;
796204;calc.at:603;Calculator %verbose;;
797205;calc.at:604;Calculator %yacc;;
798206;calc.at:605;Calculator %error-verbose;;
799207;calc.at:607;Calculator %define api.pure full %locations;;
800208;calc.at:608;Calculator %define api.push-pull both %define api.pure full %locations;;
801209;calc.at:609;Calculator %error-verbose %locations;;
802210;calc.at:611;Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
803211;calc.at:612;Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
804212;calc.at:614;Calculator %debug;;
805213;calc.at:615;Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
806214;calc.at:616;Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
807215;calc.at:618;Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
808216;calc.at:619;Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
809217;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};;
810218;calc.at:638;Calculator %glr-parser ;;
811219;calc.at:640;Calculator %glr-parser %defines;;
812220;calc.at:641;Calculator %glr-parser %locations;;
813221;calc.at:642;Calculator %glr-parser %name-prefix \"calc\";;
814222;calc.at:643;Calculator %glr-parser %define api.prefix \"calc\";;
815223;calc.at:644;Calculator %glr-parser %verbose;;
816224;calc.at:645;Calculator %glr-parser %yacc;;
817225;calc.at:646;Calculator %glr-parser %error-verbose;;
818226;calc.at:648;Calculator %glr-parser %define api.pure %locations;;
819227;calc.at:649;Calculator %glr-parser %error-verbose %locations;;
820228;calc.at:651;Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
821229;calc.at:653;Calculator %glr-parser %debug;;
822230;calc.at:654;Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
823231;calc.at:655;Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
824232;calc.at:657;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
825233;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};;
826234;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};;
827235;calc.at:670;Calculator %skeleton \"lalr1.cc\" %defines %locations;c++;
828236;calc.at:679;Calculator %language \"C++\" %defines %locations ;c++;
829237;calc.at:680;Calculator %language \"C++\" %defines %locations %define api.location.type Span;c++;
830238;calc.at:681;Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
831239;calc.at:682;Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++;
832240;calc.at:683;Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
833241;calc.at:685;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc;c++;
834242;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++;
835243;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++;
836244;calc.at:699;Calculator %skeleton \"glr.cc\" %defines %locations;c++;
837245;calc.at:708;Calculator %language \"C++\" %glr-parser %defines %locations ;c++;
838246;calc.at:709;Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span;c++;
839247;calc.at:710;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
840248;calc.at:711;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++;
841249;calc.at:713;Calculator %language \"C++\" %glr-parser %defines %locations %debug;c++;
842250;calc.at:714;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
843251;calc.at:716;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
844252;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++;
845253;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++;
846254;torture.at:137;Big triangle;;
847255;torture.at:227;Big horizontal;;
848256;torture.at:364;Many lookahead tokens;;
849257;torture.at:466;Exploding the Stack Size with Alloca;;
850258;torture.at:512;Exploding the Stack Size with Malloc;;
851259;existing.at:79;GNU AWK 3.1.0 Grammar: LALR(1);;
852260;existing.at:79;GNU AWK 3.1.0 Grammar: IELR(1);;
853261;existing.at:79;GNU AWK 3.1.0 Grammar: Canonical LR(1);;
854262;existing.at:783;GNU Cim Grammar: LALR(1);;
855263;existing.at:783;GNU Cim Grammar: IELR(1);;
856264;existing.at:783;GNU Cim Grammar: Canonical LR(1);;
857265;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: LALR(1);;
858266;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: IELR(1);;
859267;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);;
860268;regression.at:25;Trivial grammars;;
861269;regression.at:55;YYSTYPE typedef;;
862270;regression.at:85;Early token definitions with --yacc;;
863271;regression.at:125;Early token definitions without --yacc;;
864272;regression.at:170;Braces parsing;;
865273;regression.at:194;Duplicate string;;
866274;regression.at:222;Rule Line Numbers;report;
867275;regression.at:368;Mixing %token styles;;
868276;regression.at:391;Invalid inputs;;
869277;regression.at:418;Invalid inputs with {};;
870278;regression.at:443;Token definitions;;
871279;regression.at:511;Characters Escapes;;
872280;regression.at:544;Web2c Report;report;
873281;regression.at:721;Web2c Actions;report;
874282;regression.at:936;Dancer ;;
875283;regression.at:937;Dancer %glr-parser;;
876284;regression.at:938;Dancer %skeleton \"lalr1.cc\";c++;
877285;regression.at:1020;Expecting two tokens ;;
878286;regression.at:1021;Expecting two tokens %glr-parser;;
879287;regression.at:1022;Expecting two tokens %skeleton \"lalr1.cc\";c++;
880288;regression.at:1030;Braced code in declaration in rules section;;
881289;regression.at:1097;String alias declared after use;;
882290;regression.at:1120;Extra lookahead sets in report;;
883291;regression.at:1161;Token number in precedence declaration;;
884292;regression.at:1219;parse-gram.y: LALR = IELR;;
885293;regression.at:1240;%error-verbose and YYSTACK_USE_ALLOCA;;
886294;regression.at:1319;%error-verbose overflow;;
887295;regression.at:1429;LAC: Exploratory stack;;
888296;regression.at:1523;LAC: Memory exhaustion;;
889297;regression.at:1664;Lex and parse params: yacc.c;;
890298;regression.at:1665;Lex and parse params: glr.c;;
891299;regression.at:1666;Lex and parse params: lalr1.cc;c++;
892300;regression.at:1667;Lex and parse params: glr.cc;c++;
893301;c++.at:101;Doxygen Public Documentation;;
894302;c++.at:102;Doxygen Private Documentation;;
895303;c++.at:160;Relative namespace references;c++;
896304;c++.at:166;Absolute namespace references;c++;
897305;c++.at:175;Syntactically invalid namespace references;;
898306;c++.at:190;Exception safety;c++;
899307;java.at:360;Calculator ;java;
900308;java.at:360;Calculator %error-verbose ;java;
901309;java.at:360;Calculator %locations ;java;
902310;java.at:360;Calculator %error-verbose %locations ;java;
903311;java.at:369;Calculator %lex-param { InputStream is } ;java;
904312;java.at:369;Calculator %error-verbose %lex-param { InputStream is } ;java;
905313;java.at:369;Calculator %locations %lex-param { InputStream is } ;java;
906314;java.at:369;Calculator %error-verbose %locations %lex-param { InputStream is } ;java;
907315;java.at:455;Java parser class and package names;java;
908316;java.at:476;Java parser class modifiers;java;
909317;java.at:534;Java parser class extends and implements;java;
910318;java.at:554;Java %parse-param and %lex-param;java;
911319;java.at:628;Java throws specifications;java;
912320;java.at:717;Java stype, position_class and location_class;java;
913321;java.at:748;Java syntax error handling without error token;java;
914322;cxx-type.at:394;GLR: Resolve ambiguity, impure, no locations;;
915323;cxx-type.at:401;GLR: Resolve ambiguity, impure, locations;;
916324;cxx-type.at:407;GLR: Resolve ambiguity, pure, no locations;;
917325;cxx-type.at:414;GLR: Resolve ambiguity, pure, locations;;
918326;cxx-type.at:421;GLR: Merge conflicting parses, impure, no locations;;
919327;cxx-type.at:428;GLR: Merge conflicting parses, impure, locations;;
920328;cxx-type.at:435;GLR: Merge conflicting parses, pure, no locations;;
921329;cxx-type.at:441;GLR: Merge conflicting parses, pure, locations;;
922330;cxx-type.at:448;GLR: Verbose messages, resolve ambiguity, impure, no locations;;
923331;glr-regression.at:25;Badly Collapsed GLR States;;
924332;glr-regression.at:112;Improper handling of embedded actions and dollar(-N) in GLR parsers;;
925333;glr-regression.at:244;Improper merging of GLR delayed action sets;;
926334;glr-regression.at:364;Duplicate representation of merged trees;;
927335;glr-regression.at:455;User destructor for unresolved GLR semantic value;;
928336;glr-regression.at:515;User destructor after an error during a split parse;;
929337;glr-regression.at:569;Duplicated user destructor for lookahead;;
930338;glr-regression.at:658;Incorrectly initialized location for empty right-hand side in GLR;;
931339;glr-regression.at:752;No users destructors if stack 0 deleted;;
932340;glr-regression.at:829;Corrupted semantic options if user action cuts parse;;
933341;glr-regression.at:883;Undesirable destructors if user action cuts parse;;
934342;glr-regression.at:941;Leaked semantic values if user action cuts parse;;
935343;glr-regression.at:1064;Incorrect lookahead during deterministic GLR;;
936344;glr-regression.at:1188;Incorrect lookahead during nondeterministic GLR;;
937345;glr-regression.at:1405;Leaked semantic values when reporting ambiguity;;
938346;glr-regression.at:1487;Leaked lookahead after nondeterministic parse syntax error;;
939347;glr-regression.at:1547;Uninitialized location when reporting ambiguity;;
940348;glr-regression.at:1625;Missed %merge type warnings when LHS type is declared later;;
941349;glr-regression.at:1678;Ambiguity reports;;
942350;push.at:24;Memory Leak for Early Deletion;;
943351;push.at:83;Multiple impure instances;;
944352;push.at:144;Unsupported Skeletons;;
945"
946# List of the all the test groups.
947at_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.
953at_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
977at_arg_compile_c_with_cxx=false
978at_arg_given_compile_c_with_cxx=false
979
980
981at_prev=
982for at_option
983do
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
1176done
1177
1178# Verify our last option didn't require an argument
1179if test -n "$at_prev"; then :
1180  as_fn_error $? "\`$at_prev' requires an argument"
1181fi
1182
1183# The file containing the suite.
1184at_suite_log=$at_dir/$as_me.log
1185
1186# Selected test groups.
1187if test -z "$at_groups$at_recheck"; then
1188  at_groups=$at_groups_all
1189else
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'`
1204fi
1205
1206if 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'`
1213else
1214  at_red= at_grn= at_lgn= at_blu= at_std=
1215fi
1216
1217# Help message.
1218if $at_help_p; then
1219  cat <<_ATEOF || at_write_fail=1
1220Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
1221
1222Run all the tests, or the selected TESTS, given by numeric ranges, and
1223save a detailed log file.  Upon failure, create debugging scripts.
1224
1225Do not change environment variables directly.  Instead, set them via
1226command line arguments.  Set \`AUTOTEST_PATH' to select the executables
1227to exercise.  Each relative directory is expanded as build and source
1228directories relative to the top level of this distribution.
1229E.g., from within the build directory /tmp/foo-1.0, invoking this:
1230
1231  $ $0 AUTOTEST_PATH=bin
1232
1233is 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
1237cat <<_ATEOF || at_write_fail=1
1238
1239Operation 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
1245cat <<_ATEOF || at_write_fail=1
1246
1247Execution 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
1265cat <<_ATEOF || at_write_fail=1
1266
1267Other options:
1268_ATEOF
1269
1270cat <<_ATEOF || at_write_fail=1
1271compile C parsers with the C++ compiler
1272_ATEOF
1273cat <<_ATEOF || at_write_fail=1
1274
1275Report bugs to <bug-bison@gnu.org>.
1276General help using GNU software: <http://www.gnu.org/gethelp/>.
1277_ATEOF
1278  exit $at_write_fail
1279fi
1280
1281# List of tests.
1282if $at_list_p; then
1283  cat <<_ATEOF || at_write_fail=1
1284GNU 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
1323fi
1324if $at_version_p; then
1325  $as_echo "$as_me (GNU Bison 2.7)" &&
1326  cat <<\_ATEOF || at_write_fail=1
1327
1328Copyright (C) 2012 Free Software Foundation, Inc.
1329This test suite is free software; the Free Software Foundation gives
1330unlimited permission to copy, distribute and modify it.
1331_ATEOF
1332  exit $at_write_fail
1333fi
1334
1335# Should we print banners?  Yes if more than one test is run.
1336case $at_groups in #(
1337  *$as_nl* )
1338      at_print_banners=: ;; #(
1339  * ) at_print_banners=false ;;
1340esac
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.
1344at_banner_text_1="Input Processing."
1345# Banner 2. named-refs.at:19
1346# Category starts at test group 39.
1347at_banner_text_2="Named references tests."
1348# Banner 3. output.at:18
1349# Category starts at test group 51.
1350at_banner_text_3="Output file names."
1351# Banner 4. skeletons.at:18
1352# Category starts at test group 92.
1353at_banner_text_4="Skeleton Support."
1354# Banner 5. sets.at:59
1355# Category starts at test group 98.
1356at_banner_text_5="Grammar Sets (Firsts etc.)."
1357# Banner 6. reduce.at:18
1358# Category starts at test group 102.
1359at_banner_text_6="Grammar Reduction."
1360# Banner 7. synclines.at:19
1361# Category starts at test group 128.
1362at_banner_text_7="User Actions."
1363# Banner 8. headers.at:19
1364# Category starts at test group 138.
1365at_banner_text_8="Parser Headers."
1366# Banner 9. actions.at:18
1367# Category starts at test group 144.
1368at_banner_text_9="User Actions."
1369# Banner 10. conflicts.at:19
1370# Category starts at test group 181.
1371at_banner_text_10="Conflicts."
1372# Banner 11. calc.at:588
1373# Category starts at test group 200.
1374at_banner_text_11="Simple LALR(1) Calculator."
1375# Banner 12. calc.at:628
1376# Category starts at test group 218.
1377at_banner_text_12="Simple GLR Calculator."
1378# Banner 13. calc.at:667
1379# Category starts at test group 235.
1380at_banner_text_13="Simple LALR(1) C++ Calculator."
1381# Banner 14. calc.at:696
1382# Category starts at test group 244.
1383at_banner_text_14="Simple GLR C++ Calculator."
1384# Banner 15. torture.at:19
1385# Category starts at test group 254.
1386at_banner_text_15="Torture Tests."
1387# Banner 16. existing.at:19
1388# Category starts at test group 259.
1389at_banner_text_16="Existing Grammars."
1390# Banner 17. regression.at:18
1391# Category starts at test group 268.
1392at_banner_text_17="Regression tests."
1393# Banner 18. c++.at:19
1394# Category starts at test group 301.
1395at_banner_text_18="C++ Features."
1396# Banner 19. java.at:18
1397# Category starts at test group 307.
1398at_banner_text_19="Java Calculator."
1399# Banner 20. java.at:382
1400# Category starts at test group 315.
1401at_banner_text_20="Java Parameters."
1402# Banner 21. cxx-type.at:18
1403# Category starts at test group 322.
1404at_banner_text_21="C++ Type Syntax (GLR)."
1405# Banner 22. glr-regression.at:19
1406# Category starts at test group 331.
1407at_banner_text_22="GLR Regression Tests"
1408# Banner 23. push.at:18
1409# Category starts at test group 350.
1410at_banner_text_23="Push Parsing Tests"
1411
1412# Take any -C into account.
1413if $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`
1417fi
1418
1419# Load the config files for any default variable assignments.
1420for at_file in atconfig atlocal
1421do
1422  test -r $at_file || continue
1423  . ./$at_file || as_fn_error $? "invalid content: $at_file"
1424done
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.
1430eval "$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.
1434if 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
1445fi
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.
1479at_suite_dir=$at_dir/$as_me.dir
1480# The file containing the suite ($at_dir might have changed since earlier).
1481at_suite_log=$at_dir/$as_me.log
1482# The directory containing helper files per test group.
1483at_helper_dir=$at_suite_dir/at-groups
1484# Stop file: if it exists, do not start new jobs.
1485at_stop_file=$at_suite_dir/at-stop
1486# The fifo used for the job dispatcher.
1487at_job_fifo=$at_suite_dir/at-job-fifo
1488
1489if $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 $?
1494fi
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.
1504AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1505at_path=
1506as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1507for as_dir in $AUTOTEST_PATH $PATH
1508do
1509  IFS=$as_save_IFS
1510  test -z "$as_dir" && as_dir=.
1511    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1512case $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    ;;
1526esac
1527  done
1528IFS=$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.
1535at_new_path=
1536as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1537for as_dir in $at_path
1538do
1539  IFS=$as_save_IFS
1540  test -z "$as_dir" && as_dir=.
1541    test -d "$as_dir" || continue
1542case $as_dir in
1543  [\\/]* | ?:[\\/]* ) ;;
1544  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1545esac
1546case $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" ;;
1550esac
1551  done
1552IFS=$as_save_IFS
1553
1554PATH=$at_new_path
1555export PATH
1556
1557# Setting up the FDs.
1558
1559
1560
1561# 5 is the log file.  Not to be overwritten if `-d'.
1562if $at_debug_p; then
1563  at_suite_log=/dev/null
1564else
1565  : >"$at_suite_log"
1566fi
1567exec 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  {
1595cat <<_ASUNAME
1596## --------- ##
1597## Platform. ##
1598## --------- ##
1599
1600hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1601uname -m = `(uname -m) 2>/dev/null || echo unknown`
1602uname -r = `(uname -r) 2>/dev/null || echo unknown`
1603uname -s = `(uname -s) 2>/dev/null || echo unknown`
1604uname -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
1619as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1620for as_dir in $PATH
1621do
1622  IFS=$as_save_IFS
1623  test -z "$as_dir" && as_dir=.
1624    $as_echo "PATH: $as_dir"
1625  done
1626IFS=$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
1641at_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
1651at_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.
1669at_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.
1686at_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.
1698at_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.
1709at_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.
1723at_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.
1734at_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.
1747at_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.
1762at_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.
1778at_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.
1787at_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.
1797at_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.
1820for at_program in : $at_tested
1821do
1822  test "$at_program" = : && continue
1823  case $at_program in
1824    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
1825    * )
1826    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1827for as_dir in $PATH
1828do
1829  IFS=$as_save_IFS
1830  test -z "$as_dir" && as_dir=.
1831    test -f "$as_dir/$at_program" && break
1832  done
1833IFS=$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
1846done
1847
1848{
1849  $as_echo "## ------------------ ##
1850## Running the tests. ##
1851## ------------------ ##"
1852} >&5
1853
1854at_start_date=`date`
1855at_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.
1859as_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.
1863if diff /dev/null /dev/null >/dev/null 2>&1; then
1864  at_devnull=/dev/null
1865else
1866  at_devnull=$at_suite_dir/devnull
1867  >"$at_devnull"
1868fi
1869
1870# Use `diff -u' when possible.
1871if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1872then
1873  at_diff='diff -u'
1874else
1875  at_diff=diff
1876fi
1877
1878# Get the last needed group.
1879for 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
1883awk '
1884BEGIN { 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
1895rm -f "$at_suite_dir/at-source-lines"
1896
1897# Set number of jobs for `-j'; avoid more jobs than test groups.
1898set X $at_groups; shift; at_max_jobs=$#
1899if test $at_max_jobs -eq 0; then
1900  at_jobs=1
1901fi
1902if 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
1905fi
1906
1907# If parallel mode, don't output banners, don't split summary lines.
1908if test $at_jobs -ne 1; then
1909  at_print_banners=false
1910  at_quiet=:
1911fi
1912
1913# Set up helper dirs.
1914rm -rf "$at_helper_dir" &&
1915mkdir "$at_helper_dir" &&
1916cd "$at_helper_dir" &&
1917{ test -z "$at_groups" || mkdir $at_groups; } ||
1918as_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.
1927at_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"/.??*
1970fi ||
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.
1991at_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.
2009at_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
2117if (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=-
2120else
2121  at_job_control_on=: at_job_control_off=: at_job_group=
2122fi
2123
2124for 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
2146done
2147
2148rm -f "$at_stop_file"
2149at_first=:
2150
2151if 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
2155then
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
2228else
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
2243fi
2244
2245# Wrap up the test suite with summary statistics.
2246cd "$at_helper_dir"
2247
2248# Use ?..???? when the list must remain sorted, the faster * otherwise.
2249at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
2250at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
2251at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
2252at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
2253		 echo $f; done | sed '/?/d; s,/xpass,,'`
2254at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
2255		echo $f; done | sed '/?/d; s,/fail,,'`
2256
2257set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
2258shift; at_group_count=$#
2259set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
2260set X $at_xfail_list; shift; at_xfail_count=$#
2261set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
2262set X $at_skip_list; shift; at_skip_count=$#
2263
2264as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
2265as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
2266as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
2267
2268# Back to the top directory.
2269cd "$at_dir"
2270rm -rf "$at_helper_dir"
2271
2272# Compute the duration of the suite.
2273at_stop_date=`date`
2274at_stop_time=`date +%s 2>/dev/null`
2275$as_echo "$as_me: ending at: $at_stop_date" >&5
2276case $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    ;;
2286esac
2287
2288echo
2289$as_echo "## ------------- ##
2290## Test results. ##
2291## ------------- ##"
2292echo
2293{
2294  echo
2295  $as_echo "## ------------- ##
2296## Test results. ##
2297## ------------- ##"
2298  echo
2299} >&5
2300
2301if test $at_run_count = 1; then
2302  at_result="1 test"
2303  at_were=was
2304else
2305  at_result="$at_run_count tests"
2306  at_were=were
2307fi
2308if $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
2316else
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
2356fi
2357
2358# Now put skips in the mix.
2359case $at_skip_count in
2360  0) ;;
2361  1) at_result="$at_result
23621 test was skipped." ;;
2363  *) at_result="$at_result
2364$at_skip_count tests were skipped." ;;
2365esac
2366
2367if test $at_unexpected_count = 0; then
2368  echo "$at_color$at_result$at_std"
2369  echo "$at_result" >&5
2370else
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@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
2440You may investigate any problem if you feel able to do so, in which
2441case the test suite provides a good starting point.  Its output may
2442be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
2443"
2444  exit 1
2445fi
2446
2447exit 0
2448
2449## ------------- ##
2450## Actual tests. ##
2451## ------------- ##
2452#AT_START_1
2453at_fn_group_banner 1 'input.at:27' \
2454  "Invalid inputs" "                                 " 1
2455at_xfail=no
2456(
2457  $as_echo "1. $at_setup_line: testing $at_desc ..."
2458  $at_traceon
2459
2460
2461cat >input.y <<'_ATEOF'
2462\000\001\002\377?
2463%%
2464?
2465default: '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"
2474at_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>&-
2477at_status=$? at_failed=false
2478$at_check_filter
2479at_fn_diff_devnull "$at_stderr" || at_failed=:
2480at_fn_diff_devnull "$at_stdout" || at_failed=:
2481at_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"
2489at_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>&-
2492at_status=$? at_failed=false
2493$at_check_filter
2494echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: invalid characters: '\\0\\001\\002\\377?'
2495input.y:3.1: error: invalid character: '?'
2496input.y:4.14: error: invalid character: '}'
2497input.y:5.1: error: invalid character: '%'
2498input.y:5.2: error: invalid character: '&'
2499input.y:6.1-17: error: invalid directive: '%a-does-not-exist'
2500input.y:7.1: error: invalid character: '%'
2501input.y:7.2: error: invalid character: '-'
2502input.y:8.1-9.0: error: missing '%}' at end of file
2503input.y:8.1-9.0: error: syntax error, unexpected %{...%}
2504" | \
2505  $at_diff - "$at_stderr" || at_failed=:
2506at_fn_diff_devnull "$at_stdout" || at_failed=:
2507at_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
2516read at_status <"$at_status_file"
2517#AT_STOP_1
2518#AT_START_2
2519at_fn_group_banner 2 'input.at:57' \
2520  "Invalid inputs with {}" "                         " 1
2521at_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
2530cat >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"
2544at_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>&-
2547at_status=$? at_failed=false
2548$at_check_filter
2549echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
2550" | \
2551  $at_diff - "$at_stderr" || at_failed=:
2552at_fn_diff_devnull "$at_stdout" || at_failed=:
2553at_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
2562read at_status <"$at_status_file"
2563#AT_STOP_2
2564#AT_START_3
2565at_fn_group_banner 3 'input.at:84' \
2566  "Invalid \$n and @n" "                              " 1
2567at_xfail=no
2568(
2569  $as_echo "3. $at_setup_line: testing $at_desc ..."
2570  $at_traceon
2571
2572
2573cat >input.y <<'_ATEOF'
2574%%
2575exp: { $$ = $1 ; };
2576exp: { @$ = @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"
2583at_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>&-
2586at_status=$? at_failed=false
2587$at_check_filter
2588echo >>"$at_stderr"; $as_echo "input.y:2.13-14: error: integer out of range: '\$1'
2589input.y:3.13-14: error: integer out of range: '@1'
2590" | \
2591  $at_diff - "$at_stderr" || at_failed=:
2592at_fn_diff_devnull "$at_stdout" || at_failed=:
2593at_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
2602read at_status <"$at_status_file"
2603#AT_STOP_3
2604#AT_START_4
2605at_fn_group_banner 4 'input.at:104' \
2606  "Type Clashes" "                                   " 1
2607at_xfail=no
2608(
2609  $as_echo "4. $at_setup_line: testing $at_desc ..."
2610  $at_traceon
2611
2612
2613cat >input.y <<'_ATEOF'
2614%union { int bar; }
2615%token foo
2616%type <bar> exp
2617%%
2618exp: 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"
2628at_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>&-
2631at_status=$? at_failed=false
2632$at_check_filter
2633echo >>"$at_stderr"; $as_echo "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type
2634input.y:5.24-25: error: \$2 of 'exp' has no declared type
2635input.y:5.6-32: warning: type clash on default action: <bar> != <>
2636input.y:6.6-8: warning: type clash on default action: <bar> != <>
2637input.y:7.5: warning: empty rule for typed nonterminal, and no action
2638" | \
2639  $at_diff - "$at_stderr" || at_failed=:
2640at_fn_diff_devnull "$at_stdout" || at_failed=:
2641at_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
2650read at_status <"$at_status_file"
2651#AT_STOP_4
2652#AT_START_5
2653at_fn_group_banner 5 'input.at:285' \
2654  "Unused values" "                                  " 1
2655at_xfail=no
2656(
2657  $as_echo "5. $at_setup_line: testing $at_desc ..."
2658  $at_traceon
2659
2660cat >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%%
2665start:
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
2671a: INT | INT { } INT { } INT { };
2672b: INT | /* empty */;
2673c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
2674d: INT | INT { } INT { $1; } INT { $<integer>2; };
2675e: INT | INT { } INT {  } INT { $1; };
2676f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
2677g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
2678h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
2679i: INT | INT INT { } { $$ = $1 + $2; };
2680j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
2681k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
2682l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
2683_ATEOF
2684
2685
2686if 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"
2694at_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>&-
2698at_status=$? at_failed=false
2699$at_check_filter
2700echo stderr:; cat "$at_stderr"
2701echo stdout:; cat "$at_stdout"
2702at_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"
2708at_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>&-
2711at_status=$? at_failed=false
2712$at_check_filter
2713echo stderr:; cat "$at_stderr"
2714echo stdout:; cat "$at_stdout"
2715at_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"
2724at_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>&-
2729at_status=$? at_failed=false
2730$at_check_filter
2731at_fn_diff_devnull "$at_stderr" || at_failed=:
2732$at_diff expout "$at_stdout" || at_failed=:
2733at_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"
2742at_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>&-
2747at_status=$? at_failed=false
2748$at_check_filter
2749at_fn_diff_devnull "$at_stderr" || at_failed=:
2750$at_diff expout "$at_stdout" || at_failed=:
2751at_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
2757fi
2758{ set +x
2759$as_echo "$at_srcdir/input.at:286: bison -fcaret input.y"
2760at_fn_check_prepare_trace "input.at:286"
2761( $at_check_trace; bison -fcaret input.y
2762) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2763at_status=$? at_failed=false
2764$at_check_filter
2765echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
2766 a: INT | INT { } INT { } INT { };
2767          ^^^^^^^^^^^^^^^^^^^^^^^
2768input.y:11.10-12: warning: unused value: \$1
2769 a: INT | INT { } INT { } INT { };
2770          ^^^
2771input.y:11.18-20: warning: unused value: \$3
2772 a: INT | INT { } INT { } INT { };
2773                  ^^^
2774input.y:11.26-28: warning: unused value: \$5
2775 a: INT | INT { } INT { } INT { };
2776                          ^^^
2777input.y:12.9: warning: empty rule for typed nonterminal, and no action
2778 b: INT | /* empty */;
2779         ^
2780input.y:13.10-62: warning: unset value: \$\$
2781 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
2782          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2783input.y:13.22-24: warning: unused value: \$3
2784 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
2785                      ^^^
2786input.y:13.43-45: warning: unused value: \$5
2787 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
2788                                           ^^^
2789input.y:14.10-49: warning: unset value: \$\$
2790 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
2791          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2792input.y:14.18-20: warning: unused value: \$3
2793 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
2794                  ^^^
2795input.y:14.30-32: warning: unused value: \$5
2796 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
2797                              ^^^
2798input.y:15.10-37: warning: unset value: \$\$
2799 e: INT | INT { } INT {  } INT { \$1; };
2800          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2801input.y:15.18-20: warning: unused value: \$3
2802 e: INT | INT { } INT {  } INT { \$1; };
2803                  ^^^
2804input.y:15.27-29: warning: unused value: \$5
2805 e: INT | INT { } INT {  } INT { \$1; };
2806                           ^^^
2807input.y:17.10-58: warning: unset value: \$\$
2808 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
2809          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2810input.y:17.10-12: warning: unused value: \$1
2811 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
2812          ^^^
2813input.y:17.31-33: warning: unused value: \$3
2814 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
2815                               ^^^
2816input.y:17.52-54: warning: unused value: \$5
2817 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
2818                                                    ^^^
2819input.y:18.10-72: warning: unset value: \$\$
2820 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
2821          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2822input.y:18.10-12: warning: unused value: \$1
2823 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
2824          ^^^
2825input.y:18.31-33: warning: unused value: \$3
2826 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
2827                               ^^^
2828input.y:18.66-68: warning: unused value: \$5
2829 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
2830                                                                  ^^^
2831input.y:21.10-68: warning: unset value: \$\$
2832 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
2833          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2834input.y:21.10-12: warning: unused value: \$1
2835 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
2836          ^^^
2837input.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=:
2842at_fn_diff_devnull "$at_stdout" || at_failed=:
2843at_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.
2850if 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"
2859at_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>&-
2862at_status=$? at_failed=false
2863$at_check_filter
2864echo stderr:; tee stderr <"$at_stderr"
2865$at_diff expout "$at_stdout" || at_failed=:
2866at_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'
2874input.y:11.10-32: warning: unset value: $$
2875 a: INT | INT { } INT { } INT { };
2876          ^^^^^^^^^^^^^^^^^^^^^^^
2877input.y:11.10-12: warning: unused value: $1
2878 a: INT | INT { } INT { } INT { };
2879          ^^^
2880input.y:11.18-20: warning: unused value: $3
2881 a: INT | INT { } INT { } INT { };
2882                  ^^^
2883input.y:11.26-28: warning: unused value: $5
2884 a: INT | INT { } INT { } INT { };
2885                          ^^^
2886input.y:12.9: warning: empty rule for typed nonterminal, and no action
2887 b: INT | /* empty */;
2888         ^
2889input.y:13.10-62: warning: unset value: $$
2890 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
2891          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2892input.y:13.22-24: warning: unused value: $3
2893 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
2894                      ^^^
2895input.y:13.43-45: warning: unused value: $5
2896 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
2897                                           ^^^
2898input.y:14.10-49: warning: unset value: $$
2899 d: INT | INT { } INT { $1; } INT { $<integer>2; };
2900          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2901input.y:14.18-20: warning: unused value: $3
2902 d: INT | INT { } INT { $1; } INT { $<integer>2; };
2903                  ^^^
2904input.y:14.30-32: warning: unused value: $5
2905 d: INT | INT { } INT { $1; } INT { $<integer>2; };
2906                              ^^^
2907input.y:15.10-37: warning: unset value: $$
2908 e: INT | INT { } INT {  } INT { $1; };
2909          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2910input.y:15.18-20: warning: unused value: $3
2911 e: INT | INT { } INT {  } INT { $1; };
2912                  ^^^
2913input.y:15.27-29: warning: unused value: $5
2914 e: INT | INT { } INT {  } INT { $1; };
2915                           ^^^
2916input.y:17.10-58: warning: unset value: $$
2917 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
2918          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2919input.y:17.10-12: warning: unused value: $1
2920 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
2921          ^^^
2922input.y:17.31-33: warning: unused value: $3
2923 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
2924                               ^^^
2925input.y:17.52-54: warning: unused value: $5
2926 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
2927                                                    ^^^
2928input.y:18.10-72: warning: unset value: $$
2929 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
2930          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2931input.y:18.10-12: warning: unused value: $1
2932 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
2933          ^^^
2934input.y:18.31-33: warning: unused value: $3
2935 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
2936                               ^^^
2937input.y:18.66-68: warning: unused value: $5
2938 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
2939                                                                  ^^^
2940input.y:21.10-68: warning: unset value: $$
2941 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
2942          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2943input.y:21.10-12: warning: unused value: $1
2944 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
2945          ^^^
2946input.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"
2978at_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>&-
2982at_status=$? at_failed=false
2983$at_check_filter
2984$at_diff experr "$at_stderr" || at_failed=:
2985at_fn_diff_devnull "$at_stdout" || at_failed=:
2986at_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"
2995at_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>&-
2998at_status=$? at_failed=false
2999$at_check_filter
3000$at_diff experr "$at_stderr" || at_failed=:
3001$at_diff expout "$at_stdout" || at_failed=:
3002at_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"
3012at_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>&-
3015at_status=$? at_failed=false
3016$at_check_filter
3017at_fn_diff_devnull "$at_stderr" || at_failed=:
3018$at_diff expout "$at_stdout" || at_failed=:
3019at_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"
3025at_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>&-
3028at_status=$? at_failed=false
3029$at_check_filter
3030at_fn_diff_devnull "$at_stderr" || at_failed=:
3031$at_diff expout "$at_stdout" || at_failed=:
3032at_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
3038fi
3039
3040cat >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%%
3045start:
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
3051a: INT | INT { } INT { } INT { };
3052b: INT | /* empty */;
3053c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3054d: INT | INT { } INT { $1; } INT { $<integer>2; };
3055e: INT | INT { } INT {  } INT { $1; };
3056f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
3057g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3058h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3059i: INT | INT INT { } { $$ = $1 + $2; };
3060j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
3061k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3062l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
3063_ATEOF
3064
3065
3066if 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"
3074at_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>&-
3078at_status=$? at_failed=false
3079$at_check_filter
3080echo stderr:; cat "$at_stderr"
3081echo stdout:; cat "$at_stdout"
3082at_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"
3088at_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>&-
3091at_status=$? at_failed=false
3092$at_check_filter
3093echo stderr:; cat "$at_stderr"
3094echo stdout:; cat "$at_stdout"
3095at_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"
3104at_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>&-
3109at_status=$? at_failed=false
3110$at_check_filter
3111at_fn_diff_devnull "$at_stderr" || at_failed=:
3112$at_diff expout "$at_stdout" || at_failed=:
3113at_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"
3122at_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>&-
3127at_status=$? at_failed=false
3128$at_check_filter
3129at_fn_diff_devnull "$at_stderr" || at_failed=:
3130$at_diff expout "$at_stdout" || at_failed=:
3131at_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
3137fi
3138{ set +x
3139$as_echo "$at_srcdir/input.at:287: bison --warnings=midrule-values -fcaret input.y"
3140at_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>&-
3143at_status=$? at_failed=false
3144$at_check_filter
3145echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
3146 a: INT | INT { } INT { } INT { };
3147          ^^^^^^^^^^^^^^^^^^^^^^^
3148input.y:11.10-12: warning: unused value: \$1
3149 a: INT | INT { } INT { } INT { };
3150          ^^^
3151input.y:11.18-20: warning: unused value: \$3
3152 a: INT | INT { } INT { } INT { };
3153                  ^^^
3154input.y:11.26-28: warning: unused value: \$5
3155 a: INT | INT { } INT { } INT { };
3156                          ^^^
3157input.y:12.9: warning: empty rule for typed nonterminal, and no action
3158 b: INT | /* empty */;
3159         ^
3160input.y:13.14-20: warning: unset value: \$\$
3161 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3162              ^^^^^^^
3163input.y:13.26-41: warning: unset value: \$\$
3164 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3165                          ^^^^^^^^^^^^^^^^
3166input.y:13.10-62: warning: unset value: \$\$
3167 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3168          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3169input.y:13.22-24: warning: unused value: \$3
3170 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3171                      ^^^
3172input.y:13.43-45: warning: unused value: \$5
3173 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3174                                           ^^^
3175input.y:14.14-16: warning: unset value: \$\$
3176 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3177              ^^^
3178input.y:14.10-49: warning: unset value: \$\$
3179 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3180          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3181input.y:14.18-20: warning: unused value: \$3
3182 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3183                  ^^^
3184input.y:14.30-32: warning: unused value: \$5
3185 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3186                              ^^^
3187input.y:15.10-37: warning: unset value: \$\$
3188 e: INT | INT { } INT {  } INT { \$1; };
3189          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3190input.y:15.18-20: warning: unused value: \$3
3191 e: INT | INT { } INT {  } INT { \$1; };
3192                  ^^^
3193input.y:15.27-29: warning: unused value: \$5
3194 e: INT | INT { } INT {  } INT { \$1; };
3195                           ^^^
3196input.y:17.10-58: warning: unset value: \$\$
3197 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3198          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3199input.y:17.10-12: warning: unused value: \$1
3200 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3201          ^^^
3202input.y:17.14-29: warning: unused value: \$2
3203 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3204              ^^^^^^^^^^^^^^^^
3205input.y:17.31-33: warning: unused value: \$3
3206 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3207                               ^^^
3208input.y:17.35-50: warning: unused value: \$4
3209 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3210                                   ^^^^^^^^^^^^^^^^
3211input.y:17.52-54: warning: unused value: \$5
3212 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3213                                                    ^^^
3214input.y:18.10-72: warning: unset value: \$\$
3215 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3216          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3217input.y:18.10-12: warning: unused value: \$1
3218 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3219          ^^^
3220input.y:18.31-33: warning: unused value: \$3
3221 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3222                               ^^^
3223input.y:18.35-64: warning: unused value: \$4
3224 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3225                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3226input.y:18.66-68: warning: unused value: \$5
3227 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3228                                                                  ^^^
3229input.y:20.18-37: warning: unused value: \$3
3230 j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
3231                  ^^^^^^^^^^^^^^^^^^^^
3232input.y:21.10-68: warning: unset value: \$\$
3233 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
3234          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3235input.y:21.10-12: warning: unused value: \$1
3236 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
3237          ^^^
3238input.y:21.14-16: warning: unused value: \$2
3239 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
3240              ^^^
3241input.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=:
3246at_fn_diff_devnull "$at_stdout" || at_failed=:
3247at_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.
3254if 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"
3263at_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>&-
3266at_status=$? at_failed=false
3267$at_check_filter
3268echo stderr:; tee stderr <"$at_stderr"
3269$at_diff expout "$at_stdout" || at_failed=:
3270at_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'
3278input.y:11.10-32: warning: unset value: $$
3279 a: INT | INT { } INT { } INT { };
3280          ^^^^^^^^^^^^^^^^^^^^^^^
3281input.y:11.10-12: warning: unused value: $1
3282 a: INT | INT { } INT { } INT { };
3283          ^^^
3284input.y:11.18-20: warning: unused value: $3
3285 a: INT | INT { } INT { } INT { };
3286                  ^^^
3287input.y:11.26-28: warning: unused value: $5
3288 a: INT | INT { } INT { } INT { };
3289                          ^^^
3290input.y:12.9: warning: empty rule for typed nonterminal, and no action
3291 b: INT | /* empty */;
3292         ^
3293input.y:13.14-20: warning: unset value: $$
3294 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3295              ^^^^^^^
3296input.y:13.26-41: warning: unset value: $$
3297 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3298                          ^^^^^^^^^^^^^^^^
3299input.y:13.10-62: warning: unset value: $$
3300 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3301          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3302input.y:13.22-24: warning: unused value: $3
3303 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3304                      ^^^
3305input.y:13.43-45: warning: unused value: $5
3306 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3307                                           ^^^
3308input.y:14.14-16: warning: unset value: $$
3309 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3310              ^^^
3311input.y:14.10-49: warning: unset value: $$
3312 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3313          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3314input.y:14.18-20: warning: unused value: $3
3315 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3316                  ^^^
3317input.y:14.30-32: warning: unused value: $5
3318 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3319                              ^^^
3320input.y:15.10-37: warning: unset value: $$
3321 e: INT | INT { } INT {  } INT { $1; };
3322          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3323input.y:15.18-20: warning: unused value: $3
3324 e: INT | INT { } INT {  } INT { $1; };
3325                  ^^^
3326input.y:15.27-29: warning: unused value: $5
3327 e: INT | INT { } INT {  } INT { $1; };
3328                           ^^^
3329input.y:17.10-58: warning: unset value: $$
3330 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3331          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3332input.y:17.10-12: warning: unused value: $1
3333 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3334          ^^^
3335input.y:17.14-29: warning: unused value: $2
3336 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3337              ^^^^^^^^^^^^^^^^
3338input.y:17.31-33: warning: unused value: $3
3339 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3340                               ^^^
3341input.y:17.35-50: warning: unused value: $4
3342 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3343                                   ^^^^^^^^^^^^^^^^
3344input.y:17.52-54: warning: unused value: $5
3345 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3346                                                    ^^^
3347input.y:18.10-72: warning: unset value: $$
3348 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3349          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3350input.y:18.10-12: warning: unused value: $1
3351 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3352          ^^^
3353input.y:18.31-33: warning: unused value: $3
3354 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3355                               ^^^
3356input.y:18.35-64: warning: unused value: $4
3357 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3358                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3359input.y:18.66-68: warning: unused value: $5
3360 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3361                                                                  ^^^
3362input.y:20.18-37: warning: unused value: $3
3363 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
3364                  ^^^^^^^^^^^^^^^^^^^^
3365input.y:21.10-68: warning: unset value: $$
3366 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3367          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3368input.y:21.10-12: warning: unused value: $1
3369 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3370          ^^^
3371input.y:21.14-16: warning: unused value: $2
3372 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3373              ^^^
3374input.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"
3406at_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>&-
3410at_status=$? at_failed=false
3411$at_check_filter
3412$at_diff experr "$at_stderr" || at_failed=:
3413at_fn_diff_devnull "$at_stdout" || at_failed=:
3414at_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"
3423at_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>&-
3426at_status=$? at_failed=false
3427$at_check_filter
3428$at_diff experr "$at_stderr" || at_failed=:
3429$at_diff expout "$at_stdout" || at_failed=:
3430at_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"
3440at_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>&-
3443at_status=$? at_failed=false
3444$at_check_filter
3445at_fn_diff_devnull "$at_stderr" || at_failed=:
3446$at_diff expout "$at_stdout" || at_failed=:
3447at_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"
3453at_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>&-
3456at_status=$? at_failed=false
3457$at_check_filter
3458at_fn_diff_devnull "$at_stderr" || at_failed=:
3459$at_diff expout "$at_stdout" || at_failed=:
3460at_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
3466fi
3467
3468  set +x
3469  $at_times_p && times >"$at_times_file"
3470) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3471read at_status <"$at_status_file"
3472#AT_STOP_5
3473#AT_START_6
3474at_fn_group_banner 6 'input.at:295' \
3475  "Unused values before symbol declarations" "       " 1
3476at_xfail=no
3477(
3478  $as_echo "6. $at_setup_line: testing $at_desc ..."
3479  $at_traceon
3480
3481cat >input.y <<'_ATEOF'
3482
3483
3484
3485%%
3486start:
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
3492a: INT | INT { } INT { } INT { };
3493b: INT | /* empty */;
3494c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3495d: INT | INT { } INT { $1; } INT { $<integer>2; };
3496e: INT | INT { } INT {  } INT { $1; };
3497f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
3498g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3499h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3500i: INT | INT INT { } { $$ = $1 + $2; };
3501j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
3502k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3503l: 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
3510if 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"
3518at_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>&-
3522at_status=$? at_failed=false
3523$at_check_filter
3524echo stderr:; cat "$at_stderr"
3525echo stdout:; cat "$at_stdout"
3526at_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"
3532at_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>&-
3535at_status=$? at_failed=false
3536$at_check_filter
3537echo stderr:; cat "$at_stderr"
3538echo stdout:; cat "$at_stdout"
3539at_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"
3548at_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>&-
3553at_status=$? at_failed=false
3554$at_check_filter
3555at_fn_diff_devnull "$at_stderr" || at_failed=:
3556$at_diff expout "$at_stdout" || at_failed=:
3557at_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"
3566at_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>&-
3571at_status=$? at_failed=false
3572$at_check_filter
3573at_fn_diff_devnull "$at_stderr" || at_failed=:
3574$at_diff expout "$at_stdout" || at_failed=:
3575at_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
3581fi
3582{ set +x
3583$as_echo "$at_srcdir/input.at:296: bison -fcaret input.y"
3584at_fn_check_prepare_trace "input.at:296"
3585( $at_check_trace; bison -fcaret input.y
3586) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3587at_status=$? at_failed=false
3588$at_check_filter
3589echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
3590 a: INT | INT { } INT { } INT { };
3591          ^^^^^^^^^^^^^^^^^^^^^^^
3592input.y:11.10-12: warning: unused value: \$1
3593 a: INT | INT { } INT { } INT { };
3594          ^^^
3595input.y:11.18-20: warning: unused value: \$3
3596 a: INT | INT { } INT { } INT { };
3597                  ^^^
3598input.y:11.26-28: warning: unused value: \$5
3599 a: INT | INT { } INT { } INT { };
3600                          ^^^
3601input.y:12.9: warning: empty rule for typed nonterminal, and no action
3602 b: INT | /* empty */;
3603         ^
3604input.y:13.10-62: warning: unset value: \$\$
3605 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3606          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3607input.y:13.22-24: warning: unused value: \$3
3608 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3609                      ^^^
3610input.y:13.43-45: warning: unused value: \$5
3611 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3612                                           ^^^
3613input.y:14.10-49: warning: unset value: \$\$
3614 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3615          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3616input.y:14.18-20: warning: unused value: \$3
3617 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3618                  ^^^
3619input.y:14.30-32: warning: unused value: \$5
3620 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
3621                              ^^^
3622input.y:15.10-37: warning: unset value: \$\$
3623 e: INT | INT { } INT {  } INT { \$1; };
3624          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3625input.y:15.18-20: warning: unused value: \$3
3626 e: INT | INT { } INT {  } INT { \$1; };
3627                  ^^^
3628input.y:15.27-29: warning: unused value: \$5
3629 e: INT | INT { } INT {  } INT { \$1; };
3630                           ^^^
3631input.y:17.10-58: warning: unset value: \$\$
3632 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3633          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3634input.y:17.10-12: warning: unused value: \$1
3635 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3636          ^^^
3637input.y:17.31-33: warning: unused value: \$3
3638 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3639                               ^^^
3640input.y:17.52-54: warning: unused value: \$5
3641 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
3642                                                    ^^^
3643input.y:18.10-72: warning: unset value: \$\$
3644 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3645          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3646input.y:18.10-12: warning: unused value: \$1
3647 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3648          ^^^
3649input.y:18.31-33: warning: unused value: \$3
3650 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3651                               ^^^
3652input.y:18.66-68: warning: unused value: \$5
3653 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
3654                                                                  ^^^
3655input.y:21.10-68: warning: unset value: \$\$
3656 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
3657          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3658input.y:21.10-12: warning: unused value: \$1
3659 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
3660          ^^^
3661input.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=:
3666at_fn_diff_devnull "$at_stdout" || at_failed=:
3667at_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.
3674if 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"
3683at_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>&-
3686at_status=$? at_failed=false
3687$at_check_filter
3688echo stderr:; tee stderr <"$at_stderr"
3689$at_diff expout "$at_stdout" || at_failed=:
3690at_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'
3698input.y:11.10-32: warning: unset value: $$
3699 a: INT | INT { } INT { } INT { };
3700          ^^^^^^^^^^^^^^^^^^^^^^^
3701input.y:11.10-12: warning: unused value: $1
3702 a: INT | INT { } INT { } INT { };
3703          ^^^
3704input.y:11.18-20: warning: unused value: $3
3705 a: INT | INT { } INT { } INT { };
3706                  ^^^
3707input.y:11.26-28: warning: unused value: $5
3708 a: INT | INT { } INT { } INT { };
3709                          ^^^
3710input.y:12.9: warning: empty rule for typed nonterminal, and no action
3711 b: INT | /* empty */;
3712         ^
3713input.y:13.10-62: warning: unset value: $$
3714 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3715          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3716input.y:13.22-24: warning: unused value: $3
3717 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3718                      ^^^
3719input.y:13.43-45: warning: unused value: $5
3720 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3721                                           ^^^
3722input.y:14.10-49: warning: unset value: $$
3723 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3724          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3725input.y:14.18-20: warning: unused value: $3
3726 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3727                  ^^^
3728input.y:14.30-32: warning: unused value: $5
3729 d: INT | INT { } INT { $1; } INT { $<integer>2; };
3730                              ^^^
3731input.y:15.10-37: warning: unset value: $$
3732 e: INT | INT { } INT {  } INT { $1; };
3733          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3734input.y:15.18-20: warning: unused value: $3
3735 e: INT | INT { } INT {  } INT { $1; };
3736                  ^^^
3737input.y:15.27-29: warning: unused value: $5
3738 e: INT | INT { } INT {  } INT { $1; };
3739                           ^^^
3740input.y:17.10-58: warning: unset value: $$
3741 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3742          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3743input.y:17.10-12: warning: unused value: $1
3744 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3745          ^^^
3746input.y:17.31-33: warning: unused value: $3
3747 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3748                               ^^^
3749input.y:17.52-54: warning: unused value: $5
3750 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3751                                                    ^^^
3752input.y:18.10-72: warning: unset value: $$
3753 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3754          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3755input.y:18.10-12: warning: unused value: $1
3756 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3757          ^^^
3758input.y:18.31-33: warning: unused value: $3
3759 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3760                               ^^^
3761input.y:18.66-68: warning: unused value: $5
3762 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3763                                                                  ^^^
3764input.y:21.10-68: warning: unset value: $$
3765 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3766          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3767input.y:21.10-12: warning: unused value: $1
3768 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3769          ^^^
3770input.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"
3802at_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>&-
3806at_status=$? at_failed=false
3807$at_check_filter
3808$at_diff experr "$at_stderr" || at_failed=:
3809at_fn_diff_devnull "$at_stdout" || at_failed=:
3810at_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"
3819at_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>&-
3822at_status=$? at_failed=false
3823$at_check_filter
3824$at_diff experr "$at_stderr" || at_failed=:
3825$at_diff expout "$at_stdout" || at_failed=:
3826at_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"
3836at_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>&-
3839at_status=$? at_failed=false
3840$at_check_filter
3841at_fn_diff_devnull "$at_stderr" || at_failed=:
3842$at_diff expout "$at_stdout" || at_failed=:
3843at_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"
3849at_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>&-
3852at_status=$? at_failed=false
3853$at_check_filter
3854at_fn_diff_devnull "$at_stderr" || at_failed=:
3855$at_diff expout "$at_stdout" || at_failed=:
3856at_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
3862fi
3863
3864cat >input.y <<'_ATEOF'
3865
3866
3867
3868%%
3869start:
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
3875a: INT | INT { } INT { } INT { };
3876b: INT | /* empty */;
3877c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
3878d: INT | INT { } INT { $1; } INT { $<integer>2; };
3879e: INT | INT { } INT {  } INT { $1; };
3880f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
3881g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
3882h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
3883i: INT | INT INT { } { $$ = $1 + $2; };
3884j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
3885k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
3886l: 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
3893if 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"
3901at_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>&-
3905at_status=$? at_failed=false
3906$at_check_filter
3907echo stderr:; cat "$at_stderr"
3908echo stdout:; cat "$at_stdout"
3909at_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"
3915at_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>&-
3918at_status=$? at_failed=false
3919$at_check_filter
3920echo stderr:; cat "$at_stderr"
3921echo stdout:; cat "$at_stdout"
3922at_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"
3931at_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>&-
3936at_status=$? at_failed=false
3937$at_check_filter
3938at_fn_diff_devnull "$at_stderr" || at_failed=:
3939$at_diff expout "$at_stdout" || at_failed=:
3940at_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"
3949at_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>&-
3954at_status=$? at_failed=false
3955$at_check_filter
3956at_fn_diff_devnull "$at_stderr" || at_failed=:
3957$at_diff expout "$at_stdout" || at_failed=:
3958at_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
3964fi
3965{ set +x
3966$as_echo "$at_srcdir/input.at:297: bison --warnings=midrule-values -fcaret input.y"
3967at_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>&-
3970at_status=$? at_failed=false
3971$at_check_filter
3972echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
3973 a: INT | INT { } INT { } INT { };
3974          ^^^^^^^^^^^^^^^^^^^^^^^
3975input.y:11.10-12: warning: unused value: \$1
3976 a: INT | INT { } INT { } INT { };
3977          ^^^
3978input.y:11.18-20: warning: unused value: \$3
3979 a: INT | INT { } INT { } INT { };
3980                  ^^^
3981input.y:11.26-28: warning: unused value: \$5
3982 a: INT | INT { } INT { } INT { };
3983                          ^^^
3984input.y:12.9: warning: empty rule for typed nonterminal, and no action
3985 b: INT | /* empty */;
3986         ^
3987input.y:13.14-20: warning: unset value: \$\$
3988 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3989              ^^^^^^^
3990input.y:13.26-41: warning: unset value: \$\$
3991 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3992                          ^^^^^^^^^^^^^^^^
3993input.y:13.10-62: warning: unset value: \$\$
3994 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3995          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3996input.y:13.22-24: warning: unused value: \$3
3997 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
3998                      ^^^
3999input.y:13.43-45: warning: unused value: \$5
4000 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
4001                                           ^^^
4002input.y:14.14-16: warning: unset value: \$\$
4003 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
4004              ^^^
4005input.y:14.10-49: warning: unset value: \$\$
4006 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
4007          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4008input.y:14.18-20: warning: unused value: \$3
4009 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
4010                  ^^^
4011input.y:14.30-32: warning: unused value: \$5
4012 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
4013                              ^^^
4014input.y:15.10-37: warning: unset value: \$\$
4015 e: INT | INT { } INT {  } INT { \$1; };
4016          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4017input.y:15.18-20: warning: unused value: \$3
4018 e: INT | INT { } INT {  } INT { \$1; };
4019                  ^^^
4020input.y:15.27-29: warning: unused value: \$5
4021 e: INT | INT { } INT {  } INT { \$1; };
4022                           ^^^
4023input.y:17.10-58: warning: unset value: \$\$
4024 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4025          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4026input.y:17.10-12: warning: unused value: \$1
4027 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4028          ^^^
4029input.y:17.14-29: warning: unused value: \$2
4030 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4031              ^^^^^^^^^^^^^^^^
4032input.y:17.31-33: warning: unused value: \$3
4033 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4034                               ^^^
4035input.y:17.35-50: warning: unused value: \$4
4036 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4037                                   ^^^^^^^^^^^^^^^^
4038input.y:17.52-54: warning: unused value: \$5
4039 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
4040                                                    ^^^
4041input.y:18.10-72: warning: unset value: \$\$
4042 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
4043          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4044input.y:18.10-12: warning: unused value: \$1
4045 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
4046          ^^^
4047input.y:18.31-33: warning: unused value: \$3
4048 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
4049                               ^^^
4050input.y:18.35-64: warning: unused value: \$4
4051 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
4052                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4053input.y:18.66-68: warning: unused value: \$5
4054 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
4055                                                                  ^^^
4056input.y:20.18-37: warning: unused value: \$3
4057 j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
4058                  ^^^^^^^^^^^^^^^^^^^^
4059input.y:21.10-68: warning: unset value: \$\$
4060 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
4061          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4062input.y:21.10-12: warning: unused value: \$1
4063 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
4064          ^^^
4065input.y:21.14-16: warning: unused value: \$2
4066 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
4067              ^^^
4068input.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=:
4073at_fn_diff_devnull "$at_stdout" || at_failed=:
4074at_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.
4081if 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"
4090at_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>&-
4093at_status=$? at_failed=false
4094$at_check_filter
4095echo stderr:; tee stderr <"$at_stderr"
4096$at_diff expout "$at_stdout" || at_failed=:
4097at_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'
4105input.y:11.10-32: warning: unset value: $$
4106 a: INT | INT { } INT { } INT { };
4107          ^^^^^^^^^^^^^^^^^^^^^^^
4108input.y:11.10-12: warning: unused value: $1
4109 a: INT | INT { } INT { } INT { };
4110          ^^^
4111input.y:11.18-20: warning: unused value: $3
4112 a: INT | INT { } INT { } INT { };
4113                  ^^^
4114input.y:11.26-28: warning: unused value: $5
4115 a: INT | INT { } INT { } INT { };
4116                          ^^^
4117input.y:12.9: warning: empty rule for typed nonterminal, and no action
4118 b: INT | /* empty */;
4119         ^
4120input.y:13.14-20: warning: unset value: $$
4121 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
4122              ^^^^^^^
4123input.y:13.26-41: warning: unset value: $$
4124 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
4125                          ^^^^^^^^^^^^^^^^
4126input.y:13.10-62: warning: unset value: $$
4127 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
4128          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4129input.y:13.22-24: warning: unused value: $3
4130 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
4131                      ^^^
4132input.y:13.43-45: warning: unused value: $5
4133 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
4134                                           ^^^
4135input.y:14.14-16: warning: unset value: $$
4136 d: INT | INT { } INT { $1; } INT { $<integer>2; };
4137              ^^^
4138input.y:14.10-49: warning: unset value: $$
4139 d: INT | INT { } INT { $1; } INT { $<integer>2; };
4140          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4141input.y:14.18-20: warning: unused value: $3
4142 d: INT | INT { } INT { $1; } INT { $<integer>2; };
4143                  ^^^
4144input.y:14.30-32: warning: unused value: $5
4145 d: INT | INT { } INT { $1; } INT { $<integer>2; };
4146                              ^^^
4147input.y:15.10-37: warning: unset value: $$
4148 e: INT | INT { } INT {  } INT { $1; };
4149          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4150input.y:15.18-20: warning: unused value: $3
4151 e: INT | INT { } INT {  } INT { $1; };
4152                  ^^^
4153input.y:15.27-29: warning: unused value: $5
4154 e: INT | INT { } INT {  } INT { $1; };
4155                           ^^^
4156input.y:17.10-58: warning: unset value: $$
4157 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4158          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4159input.y:17.10-12: warning: unused value: $1
4160 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4161          ^^^
4162input.y:17.14-29: warning: unused value: $2
4163 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4164              ^^^^^^^^^^^^^^^^
4165input.y:17.31-33: warning: unused value: $3
4166 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4167                               ^^^
4168input.y:17.35-50: warning: unused value: $4
4169 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4170                                   ^^^^^^^^^^^^^^^^
4171input.y:17.52-54: warning: unused value: $5
4172 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
4173                                                    ^^^
4174input.y:18.10-72: warning: unset value: $$
4175 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
4176          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4177input.y:18.10-12: warning: unused value: $1
4178 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
4179          ^^^
4180input.y:18.31-33: warning: unused value: $3
4181 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
4182                               ^^^
4183input.y:18.35-64: warning: unused value: $4
4184 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
4185                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4186input.y:18.66-68: warning: unused value: $5
4187 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
4188                                                                  ^^^
4189input.y:20.18-37: warning: unused value: $3
4190 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
4191                  ^^^^^^^^^^^^^^^^^^^^
4192input.y:21.10-68: warning: unset value: $$
4193 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
4194          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4195input.y:21.10-12: warning: unused value: $1
4196 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
4197          ^^^
4198input.y:21.14-16: warning: unused value: $2
4199 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
4200              ^^^
4201input.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"
4233at_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>&-
4237at_status=$? at_failed=false
4238$at_check_filter
4239$at_diff experr "$at_stderr" || at_failed=:
4240at_fn_diff_devnull "$at_stdout" || at_failed=:
4241at_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"
4250at_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>&-
4253at_status=$? at_failed=false
4254$at_check_filter
4255$at_diff experr "$at_stderr" || at_failed=:
4256$at_diff expout "$at_stdout" || at_failed=:
4257at_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"
4267at_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>&-
4270at_status=$? at_failed=false
4271$at_check_filter
4272at_fn_diff_devnull "$at_stderr" || at_failed=:
4273$at_diff expout "$at_stdout" || at_failed=:
4274at_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"
4280at_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>&-
4283at_status=$? at_failed=false
4284$at_check_filter
4285at_fn_diff_devnull "$at_stderr" || at_failed=:
4286$at_diff expout "$at_stdout" || at_failed=:
4287at_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
4293fi
4294
4295  set +x
4296  $at_times_p && times >"$at_times_file"
4297) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4298read at_status <"$at_status_file"
4299#AT_STOP_6
4300#AT_START_7
4301at_fn_group_banner 7 'input.at:305' \
4302  "Default %printer and %destructor redeclared" "    " 1
4303at_xfail=no
4304(
4305  $as_echo "7. $at_setup_line: testing $at_desc ..."
4306  $at_traceon
4307
4308
4309cat >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
4324start: ;
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"
4337at_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>&-
4340at_status=$? at_failed=false
4341$at_check_filter
4342echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: redeclaration for default tagged %destructor
4343input.y:1.13-29:     previous declaration
4344input.y:2.10-24: error: redeclaration for default tagged %printer
4345input.y:2.10-24:     previous declaration
4346input.y:4.13-29: error: redeclaration for default tagged %destructor
4347input.y:1.13-29:     previous declaration
4348input.y:5.10-24: error: redeclaration for default tagged %printer
4349input.y:2.10-24:     previous declaration
4350input.y:7.13-29: error: redeclaration for default tagless %destructor
4351input.y:7.13-29:     previous declaration
4352input.y:8.10-24: error: redeclaration for default tagless %printer
4353input.y:8.10-24:     previous declaration
4354input.y:10.13-29: error: redeclaration for default tagless %destructor
4355input.y:7.13-29:      previous declaration
4356input.y:11.10-24: error: redeclaration for default tagless %printer
4357input.y:8.10-24:      previous declaration
4358input.y:17.13-29: error: redeclaration for default tagged %destructor
4359input.y:4.13-29:      previous declaration
4360input.y:18.10-24: error: redeclaration for default tagged %printer
4361input.y:5.10-24:      previous declaration
4362input.y:20.13-29: error: redeclaration for default tagless %destructor
4363input.y:10.13-29:     previous declaration
4364input.y:21.10-24: error: redeclaration for default tagless %printer
4365input.y:11.10-24:     previous declaration
4366" | \
4367  $at_diff - "$at_stderr" || at_failed=:
4368at_fn_diff_devnull "$at_stdout" || at_failed=:
4369at_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
4378read at_status <"$at_status_file"
4379#AT_STOP_7
4380#AT_START_8
4381at_fn_group_banner 8 'input.at:365' \
4382  "Per-type %printer and %destructor redeclared" "   " 1
4383at_xfail=no
4384(
4385  $as_echo "8. $at_setup_line: testing $at_desc ..."
4386  $at_traceon
4387
4388
4389cat >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
4398start: ;
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"
4408at_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>&-
4411at_status=$? at_failed=false
4412$at_check_filter
4413echo >>"$at_stderr"; $as_echo "input.y:4.13-29: error: %destructor redeclaration for <field1>
4414input.y:1.13-29:     previous declaration
4415input.y:4.13-29: error: %destructor redeclaration for <field1>
4416input.y:4.13-29:     previous declaration
4417input.y:5.10-24: error: %printer redeclaration for <field2>
4418input.y:2.10-24:     previous declaration
4419input.y:5.10-24: error: %printer redeclaration for <field2>
4420input.y:5.10-24:     previous declaration
4421input.y:11.13-29: error: %destructor redeclaration for <field1>
4422input.y:4.13-29:      previous declaration
4423input.y:11.13-29: error: %destructor redeclaration for <field2>
4424input.y:1.13-29:      previous declaration
4425input.y:12.10-24: error: %printer redeclaration for <field1>
4426input.y:2.10-24:      previous declaration
4427input.y:12.10-24: error: %printer redeclaration for <field2>
4428input.y:5.10-24:      previous declaration
4429" | \
4430  $at_diff - "$at_stderr" || at_failed=:
4431at_fn_diff_devnull "$at_stdout" || at_failed=:
4432at_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
4441read at_status <"$at_status_file"
4442#AT_STOP_8
4443#AT_START_9
4444at_fn_group_banner 9 'input.at:408' \
4445  "Unused values with default %destructor" "         " 1
4446at_xfail=no
4447(
4448  $as_echo "9. $at_setup_line: testing $at_desc ..."
4449  $at_traceon
4450
4451
4452cat >input.y <<'_ATEOF'
4453%destructor { destroy ($$); } <>
4454%type <tag> tagged
4455
4456%%
4457
4458start: end end tagged tagged { $<tag>1; $3; } ;
4459end: { } ;
4460tagged: { } ;
4461_ATEOF
4462
4463
4464if 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"
4472at_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>&-
4476at_status=$? at_failed=false
4477$at_check_filter
4478echo stderr:; cat "$at_stderr"
4479echo stdout:; cat "$at_stdout"
4480at_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"
4486at_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>&-
4489at_status=$? at_failed=false
4490$at_check_filter
4491echo stderr:; cat "$at_stderr"
4492echo stdout:; cat "$at_stdout"
4493at_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"
4502at_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>&-
4507at_status=$? at_failed=false
4508$at_check_filter
4509at_fn_diff_devnull "$at_stderr" || at_failed=:
4510$at_diff expout "$at_stdout" || at_failed=:
4511at_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"
4520at_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>&-
4525at_status=$? at_failed=false
4526$at_check_filter
4527at_fn_diff_devnull "$at_stderr" || at_failed=:
4528$at_diff expout "$at_stdout" || at_failed=:
4529at_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
4535fi
4536{ set +x
4537$as_echo "$at_srcdir/input.at:421: bison input.y"
4538at_fn_check_prepare_trace "input.at:421"
4539( $at_check_trace; bison input.y
4540) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4541at_status=$? at_failed=false
4542$at_check_filter
4543echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$
4544input.y:6.12-14: warning: unused value: \$2
4545input.y:7.6-8: warning: unset value: \$\$
4546" | \
4547  $at_diff - "$at_stderr" || at_failed=:
4548at_fn_diff_devnull "$at_stdout" || at_failed=:
4549at_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.
4556if 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"
4565at_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>&-
4568at_status=$? at_failed=false
4569$at_check_filter
4570echo stderr:; tee stderr <"$at_stderr"
4571$at_diff expout "$at_stdout" || at_failed=:
4572at_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'
4580input.y:6.8-45: warning: unset value: $$
4581input.y:6.12-14: warning: unused value: $2
4582input.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"
4612at_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>&-
4616at_status=$? at_failed=false
4617$at_check_filter
4618$at_diff experr "$at_stderr" || at_failed=:
4619at_fn_diff_devnull "$at_stdout" || at_failed=:
4620at_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"
4629at_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>&-
4632at_status=$? at_failed=false
4633$at_check_filter
4634$at_diff experr "$at_stderr" || at_failed=:
4635$at_diff expout "$at_stdout" || at_failed=:
4636at_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"
4646at_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>&-
4649at_status=$? at_failed=false
4650$at_check_filter
4651at_fn_diff_devnull "$at_stderr" || at_failed=:
4652$at_diff expout "$at_stdout" || at_failed=:
4653at_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"
4659at_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>&-
4662at_status=$? at_failed=false
4663$at_check_filter
4664at_fn_diff_devnull "$at_stderr" || at_failed=:
4665$at_diff expout "$at_stdout" || at_failed=:
4666at_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
4672fi
4673
4674cat >input.y <<'_ATEOF'
4675%destructor { destroy ($$); } <*>
4676%type <tag> tagged
4677
4678%%
4679
4680start: end end tagged tagged { $<tag>1; $3; } ;
4681end: { } ;
4682tagged: { } ;
4683_ATEOF
4684
4685
4686if 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"
4694at_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>&-
4698at_status=$? at_failed=false
4699$at_check_filter
4700echo stderr:; cat "$at_stderr"
4701echo stdout:; cat "$at_stdout"
4702at_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"
4708at_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>&-
4711at_status=$? at_failed=false
4712$at_check_filter
4713echo stderr:; cat "$at_stderr"
4714echo stdout:; cat "$at_stdout"
4715at_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"
4724at_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>&-
4729at_status=$? at_failed=false
4730$at_check_filter
4731at_fn_diff_devnull "$at_stderr" || at_failed=:
4732$at_diff expout "$at_stdout" || at_failed=:
4733at_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"
4742at_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>&-
4747at_status=$? at_failed=false
4748$at_check_filter
4749at_fn_diff_devnull "$at_stderr" || at_failed=:
4750$at_diff expout "$at_stdout" || at_failed=:
4751at_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
4757fi
4758{ set +x
4759$as_echo "$at_srcdir/input.at:438: bison input.y"
4760at_fn_check_prepare_trace "input.at:438"
4761( $at_check_trace; bison input.y
4762) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4763at_status=$? at_failed=false
4764$at_check_filter
4765echo >>"$at_stderr"; $as_echo "input.y:6.23-28: warning: unused value: \$4
4766input.y:8.9-11: warning: unset value: \$\$
4767" | \
4768  $at_diff - "$at_stderr" || at_failed=:
4769at_fn_diff_devnull "$at_stdout" || at_failed=:
4770at_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.
4777if 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"
4786at_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>&-
4789at_status=$? at_failed=false
4790$at_check_filter
4791echo stderr:; tee stderr <"$at_stderr"
4792$at_diff expout "$at_stdout" || at_failed=:
4793at_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'
4801input.y:6.23-28: warning: unused value: $4
4802input.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"
4832at_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>&-
4836at_status=$? at_failed=false
4837$at_check_filter
4838$at_diff experr "$at_stderr" || at_failed=:
4839at_fn_diff_devnull "$at_stdout" || at_failed=:
4840at_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"
4849at_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>&-
4852at_status=$? at_failed=false
4853$at_check_filter
4854$at_diff experr "$at_stderr" || at_failed=:
4855$at_diff expout "$at_stdout" || at_failed=:
4856at_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"
4866at_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>&-
4869at_status=$? at_failed=false
4870$at_check_filter
4871at_fn_diff_devnull "$at_stderr" || at_failed=:
4872$at_diff expout "$at_stdout" || at_failed=:
4873at_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"
4879at_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>&-
4882at_status=$? at_failed=false
4883$at_check_filter
4884at_fn_diff_devnull "$at_stderr" || at_failed=:
4885$at_diff expout "$at_stdout" || at_failed=:
4886at_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
4892fi
4893
4894  set +x
4895  $at_times_p && times >"$at_times_file"
4896) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4897read at_status <"$at_status_file"
4898#AT_STOP_9
4899#AT_START_10
4900at_fn_group_banner 10 'input.at:450' \
4901  "Unused values with per-type %destructor" "        " 1
4902at_xfail=no
4903(
4904  $as_echo "10. $at_setup_line: testing $at_desc ..."
4905  $at_traceon
4906
4907
4908cat >input.y <<'_ATEOF'
4909%destructor { destroy ($$); } <field1>
4910%type <field1> start end
4911
4912%%
4913
4914start: end end { $1; } ;
4915end: { }  ;
4916_ATEOF
4917
4918
4919if 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"
4927at_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>&-
4931at_status=$? at_failed=false
4932$at_check_filter
4933echo stderr:; cat "$at_stderr"
4934echo stdout:; cat "$at_stdout"
4935at_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"
4941at_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>&-
4944at_status=$? at_failed=false
4945$at_check_filter
4946echo stderr:; cat "$at_stderr"
4947echo stdout:; cat "$at_stdout"
4948at_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"
4957at_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>&-
4962at_status=$? at_failed=false
4963$at_check_filter
4964at_fn_diff_devnull "$at_stderr" || at_failed=:
4965$at_diff expout "$at_stdout" || at_failed=:
4966at_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"
4975at_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>&-
4980at_status=$? at_failed=false
4981$at_check_filter
4982at_fn_diff_devnull "$at_stderr" || at_failed=:
4983$at_diff expout "$at_stdout" || at_failed=:
4984at_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
4990fi
4991{ set +x
4992$as_echo "$at_srcdir/input.at:462: bison input.y"
4993at_fn_check_prepare_trace "input.at:462"
4994( $at_check_trace; bison input.y
4995) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4996at_status=$? at_failed=false
4997$at_check_filter
4998echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$
4999input.y:6.12-14: warning: unused value: \$2
5000input.y:7.6-8: warning: unset value: \$\$
5001" | \
5002  $at_diff - "$at_stderr" || at_failed=:
5003at_fn_diff_devnull "$at_stdout" || at_failed=:
5004at_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.
5011if 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"
5020at_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>&-
5023at_status=$? at_failed=false
5024$at_check_filter
5025echo stderr:; tee stderr <"$at_stderr"
5026$at_diff expout "$at_stdout" || at_failed=:
5027at_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'
5035input.y:6.8-22: warning: unset value: $$
5036input.y:6.12-14: warning: unused value: $2
5037input.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"
5067at_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>&-
5071at_status=$? at_failed=false
5072$at_check_filter
5073$at_diff experr "$at_stderr" || at_failed=:
5074at_fn_diff_devnull "$at_stdout" || at_failed=:
5075at_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"
5084at_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>&-
5087at_status=$? at_failed=false
5088$at_check_filter
5089$at_diff experr "$at_stderr" || at_failed=:
5090$at_diff expout "$at_stdout" || at_failed=:
5091at_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"
5101at_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>&-
5104at_status=$? at_failed=false
5105$at_check_filter
5106at_fn_diff_devnull "$at_stderr" || at_failed=:
5107$at_diff expout "$at_stdout" || at_failed=:
5108at_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"
5114at_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>&-
5117at_status=$? at_failed=false
5118$at_check_filter
5119at_fn_diff_devnull "$at_stderr" || at_failed=:
5120$at_diff expout "$at_stdout" || at_failed=:
5121at_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
5127fi
5128
5129  set +x
5130  $at_times_p && times >"$at_times_file"
5131) 5>&1 2>&1 7>&- | eval $at_tee_pipe
5132read at_status <"$at_status_file"
5133#AT_STOP_10
5134#AT_START_11
5135at_fn_group_banner 11 'input.at:475' \
5136  "Incompatible Aliases" "                           " 1
5137at_xfail=no
5138(
5139  $as_echo "11. $at_setup_line: testing $at_desc ..."
5140  $at_traceon
5141
5142
5143cat >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%%
5157exp: 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"
5164at_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>&-
5167at_status=$? at_failed=false
5168$at_check_filter
5169echo >>"$at_stderr"; $as_echo "input.y:8.7-11: error: %type redeclaration for foo
5170input.y:3.7-11:     previous declaration
5171input.y:10.13-17: error: %destructor redeclaration for foo
5172input.y:5.13-17:      previous declaration
5173input.y:9.10-14: error: %printer redeclaration for foo
5174input.y:4.10-14:     previous declaration
5175input.y:11.1-5: error: %left redeclaration for foo
5176input.y:6.1-5:      previous declaration
5177" | \
5178  $at_diff - "$at_stderr" || at_failed=:
5179at_fn_diff_devnull "$at_stdout" || at_failed=:
5180at_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
5189read at_status <"$at_status_file"
5190#AT_STOP_11
5191#AT_START_12
5192at_fn_group_banner 12 'input.at:516' \
5193  "Torturing the Scanner" "                          " 1
5194at_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"
5205at_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>&-
5208at_status=$? at_failed=false
5209$at_check_filter
5210echo >>"$at_stderr"; $as_echo "input.y:1.1: error: syntax error, unexpected end of file
5211" | \
5212  $at_diff - "$at_stderr" || at_failed=:
5213at_fn_diff_devnull "$at_stdout" || at_failed=:
5214at_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
5221cat >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"
5228at_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>&-
5231at_status=$? at_failed=false
5232$at_check_filter
5233echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: syntax error, unexpected {...}
5234" | \
5235  $at_diff - "$at_stderr" || at_failed=:
5236at_fn_diff_devnull "$at_stdout" || at_failed=:
5237at_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
5244cat >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. */
5255const 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
5278char str[] = "\\
5279" A string with backslash-newlines in it %{ %} \\
5280\
5281"";
5282
5283char 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.  */
5294typedef 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%{
5308static YYSTYPE value_as_yystype (value val);
5309
5310/* Exercise quotes in declarations.  */
5311char quote[] = "]],";
5312%}
5313
5314%{
5315static void yyerror ( const char *msg);
5316static 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.  */
5326exp: '[' '\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
5334two: '\x000000000000000000000000000000000000000000000000000000000000000000002';
5335oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_';
5336output.or.oline.opt: ;|oline;;|output;;;
5337output: '#' 'o' 'u' 't' 'p' 'u' 't' ' ';
5338%%
5339/* Exercise M4 quoting: ']]', [, 2.  */
5340
5341static YYSTYPE
5342value_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.  */
5350static
5351void yyerror ( const char *msg)
5352{
5353  fprintf (stderr, "%s\n", msg);
5354}
5355static int
5356yylex (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
5372cat >main.c <<'_ATEOF'
5373typedef int value;
5374#include "input.h"
5375
5376int yyparse (void);
5377
5378int
5379main (void)
5380{
5381  return yyparse ();
5382}
5383_ATEOF
5384
5385
5386
5387if 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"
5395at_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>&-
5399at_status=$? at_failed=false
5400$at_check_filter
5401echo stderr:; cat "$at_stderr"
5402echo stdout:; cat "$at_stdout"
5403at_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"
5409at_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>&-
5412at_status=$? at_failed=false
5413$at_check_filter
5414echo stderr:; cat "$at_stderr"
5415echo stdout:; cat "$at_stdout"
5416at_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"
5425at_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>&-
5430at_status=$? at_failed=false
5431$at_check_filter
5432at_fn_diff_devnull "$at_stderr" || at_failed=:
5433$at_diff expout "$at_stdout" || at_failed=:
5434at_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"
5443at_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>&-
5448at_status=$? at_failed=false
5449$at_check_filter
5450at_fn_diff_devnull "$at_stderr" || at_failed=:
5451$at_diff expout "$at_stdout" || at_failed=:
5452at_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
5458fi
5459{ set +x
5460$as_echo "$at_srcdir/input.at:659: bison -d -v -o input.c input.y"
5461at_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>&-
5464at_status=$? at_failed=false
5465$at_check_filter
5466at_fn_diff_devnull "$at_stderr" || at_failed=:
5467at_fn_diff_devnull "$at_stdout" || at_failed=:
5468at_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"
5475at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:660"
5476( $at_check_trace; $BISON_C_WORKS
5477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5478at_status=$? at_failed=false
5479$at_check_filter
5480echo stderr:; cat "$at_stderr"
5481echo stdout:; cat "$at_stdout"
5482at_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 "
5488at_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>&-
5491at_status=$? at_failed=false
5492$at_check_filter
5493echo stderr:; cat "$at_stderr"
5494echo stdout:; cat "$at_stdout"
5495at_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"
5501at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:661"
5502( $at_check_trace; $BISON_C_WORKS
5503) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5504at_status=$? at_failed=false
5505$at_check_filter
5506echo stderr:; cat "$at_stderr"
5507echo stdout:; cat "$at_stdout"
5508at_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 "
5514at_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>&-
5517at_status=$? at_failed=false
5518$at_check_filter
5519echo stderr:; cat "$at_stderr"
5520echo stdout:; cat "$at_stdout"
5521at_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"
5527at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:662"
5528( $at_check_trace; $BISON_C_WORKS
5529) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5530at_status=$? at_failed=false
5531$at_check_filter
5532echo stderr:; cat "$at_stderr"
5533echo stdout:; cat "$at_stdout"
5534at_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"
5540at_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>&-
5543at_status=$? at_failed=false
5544$at_check_filter
5545echo stderr:; cat "$at_stderr"
5546echo stdout:; cat "$at_stdout"
5547at_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"
5553at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:663"
5554( $at_check_trace;  $PREPARSER ./input
5555) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5556at_status=$? at_failed=false
5557$at_check_filter
5558echo stderr:; tee stderr <"$at_stderr"
5559echo >>"$at_stdout"; $as_echo "[[],
5560" | \
5561  $at_diff - "$at_stdout" || at_failed=:
5562at_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"
5568at_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>&-
5571at_status=$? at_failed=false
5572$at_check_filter
5573at_fn_diff_devnull "$at_stderr" || at_failed=:
5574at_fn_diff_devnull "$at_stdout" || at_failed=:
5575at_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
5584read at_status <"$at_status_file"
5585#AT_STOP_12
5586#AT_START_13
5587at_fn_group_banner 13 'input.at:674' \
5588  "Typed symbol aliases" "                           " 1
5589at_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
5597cat >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%%
5613exp: "MY TOKEN";
5614%%
5615_ATEOF
5616
5617
5618
5619if 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"
5627at_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>&-
5631at_status=$? at_failed=false
5632$at_check_filter
5633echo stderr:; cat "$at_stderr"
5634echo stdout:; cat "$at_stdout"
5635at_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"
5641at_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>&-
5644at_status=$? at_failed=false
5645$at_check_filter
5646echo stderr:; cat "$at_stderr"
5647echo stdout:; cat "$at_stdout"
5648at_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"
5657at_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>&-
5662at_status=$? at_failed=false
5663$at_check_filter
5664at_fn_diff_devnull "$at_stderr" || at_failed=:
5665$at_diff expout "$at_stdout" || at_failed=:
5666at_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"
5675at_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>&-
5680at_status=$? at_failed=false
5681$at_check_filter
5682at_fn_diff_devnull "$at_stderr" || at_failed=:
5683$at_diff expout "$at_stdout" || at_failed=:
5684at_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
5690fi
5691{ set +x
5692$as_echo "$at_srcdir/input.at:690: bison -o input.c input.y"
5693at_fn_check_prepare_trace "input.at:690"
5694( $at_check_trace; bison -o input.c input.y
5695) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5696at_status=$? at_failed=false
5697$at_check_filter
5698at_fn_diff_devnull "$at_stderr" || at_failed=:
5699at_fn_diff_devnull "$at_stdout" || at_failed=:
5700at_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
5709read at_status <"$at_status_file"
5710#AT_STOP_13
5711#AT_START_14
5712at_fn_group_banner 14 'input.at:710' \
5713  "Require 1.0" "                                    " 1
5714at_xfail=no
5715(
5716  $as_echo "14. $at_setup_line: testing $at_desc ..."
5717  $at_traceon
5718
5719cat >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%%
5730empty_file:;
5731_ATEOF
5732
5733
5734if 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"
5742at_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>&-
5746at_status=$? at_failed=false
5747$at_check_filter
5748echo stderr:; cat "$at_stderr"
5749echo stdout:; cat "$at_stdout"
5750at_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"
5756at_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>&-
5759at_status=$? at_failed=false
5760$at_check_filter
5761echo stderr:; cat "$at_stderr"
5762echo stdout:; cat "$at_stdout"
5763at_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"
5772at_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>&-
5777at_status=$? at_failed=false
5778$at_check_filter
5779at_fn_diff_devnull "$at_stderr" || at_failed=:
5780$at_diff expout "$at_stdout" || at_failed=:
5781at_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"
5790at_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>&-
5795at_status=$? at_failed=false
5796$at_check_filter
5797at_fn_diff_devnull "$at_stderr" || at_failed=:
5798$at_diff expout "$at_stdout" || at_failed=:
5799at_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
5805fi
5806{ set +x
5807$as_echo "$at_srcdir/input.at:710: bison -o input.c input.y"
5808at_fn_check_prepare_trace "input.at:710"
5809( $at_check_trace; bison -o input.c input.y
5810) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5811at_status=$? at_failed=false
5812$at_check_filter
5813echo stderr:; cat "$at_stderr"
5814at_fn_diff_devnull "$at_stdout" || at_failed=:
5815at_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
5823read at_status <"$at_status_file"
5824#AT_STOP_14
5825#AT_START_15
5826at_fn_group_banner 15 'input.at:711' \
5827  "Require 2.7" "                                    " 1
5828at_xfail=no
5829(
5830  $as_echo "15. $at_setup_line: testing $at_desc ..."
5831  $at_traceon
5832
5833cat >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%%
5844empty_file:;
5845_ATEOF
5846
5847
5848if 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"
5856at_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>&-
5860at_status=$? at_failed=false
5861$at_check_filter
5862echo stderr:; cat "$at_stderr"
5863echo stdout:; cat "$at_stdout"
5864at_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"
5870at_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>&-
5873at_status=$? at_failed=false
5874$at_check_filter
5875echo stderr:; cat "$at_stderr"
5876echo stdout:; cat "$at_stdout"
5877at_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"
5886at_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>&-
5891at_status=$? at_failed=false
5892$at_check_filter
5893at_fn_diff_devnull "$at_stderr" || at_failed=:
5894$at_diff expout "$at_stdout" || at_failed=:
5895at_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"
5904at_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>&-
5909at_status=$? at_failed=false
5910$at_check_filter
5911at_fn_diff_devnull "$at_stderr" || at_failed=:
5912$at_diff expout "$at_stdout" || at_failed=:
5913at_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
5919fi
5920{ set +x
5921$as_echo "$at_srcdir/input.at:711: bison -o input.c input.y"
5922at_fn_check_prepare_trace "input.at:711"
5923( $at_check_trace; bison -o input.c input.y
5924) >>"$at_stdout" 2>>"$at_stderr" 5>&-
5925at_status=$? at_failed=false
5926$at_check_filter
5927echo stderr:; cat "$at_stderr"
5928at_fn_diff_devnull "$at_stdout" || at_failed=:
5929at_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
5937read at_status <"$at_status_file"
5938#AT_STOP_15
5939#AT_START_16
5940at_fn_group_banner 16 'input.at:713' \
5941  "Require 100.0" "                                  " 1
5942at_xfail=no
5943(
5944  $as_echo "16. $at_setup_line: testing $at_desc ..."
5945  $at_traceon
5946
5947cat >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%%
5958empty_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"
5965at_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>&-
5968at_status=$? at_failed=false
5969$at_check_filter
5970echo stderr:; cat "$at_stderr"
5971at_fn_diff_devnull "$at_stdout" || at_failed=:
5972at_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
5980read at_status <"$at_status_file"
5981#AT_STOP_16
5982#AT_START_17
5983at_fn_group_banner 17 'input.at:720' \
5984  "String aliases for character tokens" "            " 1
5985at_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
5994cat >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%%
6005start: 'a';
6006%%
6007_ATEOF
6008
6009
6010
6011if 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"
6019at_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>&-
6023at_status=$? at_failed=false
6024$at_check_filter
6025echo stderr:; cat "$at_stderr"
6026echo stdout:; cat "$at_stdout"
6027at_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"
6033at_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>&-
6036at_status=$? at_failed=false
6037$at_check_filter
6038echo stderr:; cat "$at_stderr"
6039echo stdout:; cat "$at_stdout"
6040at_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"
6049at_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>&-
6054at_status=$? at_failed=false
6055$at_check_filter
6056at_fn_diff_devnull "$at_stderr" || at_failed=:
6057$at_diff expout "$at_stdout" || at_failed=:
6058at_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"
6067at_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>&-
6072at_status=$? at_failed=false
6073$at_check_filter
6074at_fn_diff_devnull "$at_stderr" || at_failed=:
6075$at_diff expout "$at_stdout" || at_failed=:
6076at_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
6082fi
6083{ set +x
6084$as_echo "$at_srcdir/input.at:732: bison -o input.c input.y"
6085at_fn_check_prepare_trace "input.at:732"
6086( $at_check_trace; bison -o input.c input.y
6087) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6088at_status=$? at_failed=false
6089$at_check_filter
6090at_fn_diff_devnull "$at_stderr" || at_failed=:
6091at_fn_diff_devnull "$at_stdout" || at_failed=:
6092at_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
6101read at_status <"$at_status_file"
6102#AT_STOP_17
6103#AT_START_18
6104at_fn_group_banner 18 'input.at:741' \
6105  "Symbols" "                                        " 1
6106at_xfail=no
6107(
6108  $as_echo "18. $at_setup_line: testing $at_desc ..."
6109  $at_traceon
6110
6111
6112
6113cat >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%%
6131start: with-dash without_dash with.period without_period;
6132with-dash: WITH-DASH;
6133without_dash: "WITHOUT-DASH";
6134with.period: WITH.PERIOD;
6135without_period: "WITHOUT.PERIOD";
6136%%
6137#include <stdio.h>
6138/* A C error reporting function.  */
6139static
6140void yyerror ( const char *msg)
6141{
6142  fprintf (stderr, "%s\n", msg);
6143}
6144#include <assert.h>
6145static
6146int 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"
6166at_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>&-
6169at_status=$? at_failed=false
6170$at_check_filter
6171echo >>"$at_stderr"; $as_echo "input.y:9.8-16: POSIX Yacc forbids dashes in symbol names: WITH-DASH
6172input.y:18.8-16: POSIX Yacc forbids dashes in symbol names: with-dash
6173" | \
6174  $at_diff - "$at_stderr" || at_failed=:
6175at_fn_diff_devnull "$at_stdout" || at_failed=:
6176at_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.
6183if 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"
6191at_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>&-
6195at_status=$? at_failed=false
6196$at_check_filter
6197echo stderr:; cat "$at_stderr"
6198echo stdout:; cat "$at_stdout"
6199at_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"
6205at_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>&-
6208at_status=$? at_failed=false
6209$at_check_filter
6210echo stderr:; cat "$at_stderr"
6211echo stdout:; cat "$at_stdout"
6212at_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"
6221at_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>&-
6226at_status=$? at_failed=false
6227$at_check_filter
6228at_fn_diff_devnull "$at_stderr" || at_failed=:
6229$at_diff expout "$at_stdout" || at_failed=:
6230at_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"
6239at_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>&-
6244at_status=$? at_failed=false
6245$at_check_filter
6246at_fn_diff_devnull "$at_stderr" || at_failed=:
6247$at_diff expout "$at_stdout" || at_failed=:
6248at_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
6254fi
6255{ set +x
6256$as_echo "$at_srcdir/input.at:772: bison -Wyacc input.y"
6257at_fn_check_prepare_trace "input.at:772"
6258( $at_check_trace; bison -Wyacc input.y
6259) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6260at_status=$? at_failed=false
6261$at_check_filter
6262echo >>"$at_stderr"; $as_echo "input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH
6263input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash
6264" | \
6265  $at_diff - "$at_stderr" || at_failed=:
6266at_fn_diff_devnull "$at_stdout" || at_failed=:
6267at_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.
6274if 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"
6283at_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>&-
6286at_status=$? at_failed=false
6287$at_check_filter
6288echo stderr:; tee stderr <"$at_stderr"
6289$at_diff expout "$at_stdout" || at_failed=:
6290at_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'
6298input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH
6299input.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"
6329at_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>&-
6333at_status=$? at_failed=false
6334$at_check_filter
6335$at_diff experr "$at_stderr" || at_failed=:
6336at_fn_diff_devnull "$at_stdout" || at_failed=:
6337at_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"
6346at_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>&-
6349at_status=$? at_failed=false
6350$at_check_filter
6351$at_diff experr "$at_stderr" || at_failed=:
6352$at_diff expout "$at_stdout" || at_failed=:
6353at_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"
6363at_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>&-
6366at_status=$? at_failed=false
6367$at_check_filter
6368at_fn_diff_devnull "$at_stderr" || at_failed=:
6369$at_diff expout "$at_stdout" || at_failed=:
6370at_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"
6376at_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>&-
6379at_status=$? at_failed=false
6380$at_check_filter
6381at_fn_diff_devnull "$at_stderr" || at_failed=:
6382$at_diff expout "$at_stdout" || at_failed=:
6383at_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
6389fi
6390
6391# Dashes are fine for GNU Bison.
6392if 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"
6400at_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>&-
6404at_status=$? at_failed=false
6405$at_check_filter
6406echo stderr:; cat "$at_stderr"
6407echo stdout:; cat "$at_stdout"
6408at_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"
6414at_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>&-
6417at_status=$? at_failed=false
6418$at_check_filter
6419echo stderr:; cat "$at_stderr"
6420echo stdout:; cat "$at_stdout"
6421at_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"
6430at_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>&-
6435at_status=$? at_failed=false
6436$at_check_filter
6437at_fn_diff_devnull "$at_stderr" || at_failed=:
6438$at_diff expout "$at_stdout" || at_failed=:
6439at_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"
6448at_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>&-
6453at_status=$? at_failed=false
6454$at_check_filter
6455at_fn_diff_devnull "$at_stderr" || at_failed=:
6456$at_diff expout "$at_stdout" || at_failed=:
6457at_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
6463fi
6464{ set +x
6465$as_echo "$at_srcdir/input.at:778: bison -o input.c input.y"
6466at_fn_check_prepare_trace "input.at:778"
6467( $at_check_trace; bison -o input.c input.y
6468) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6469at_status=$? at_failed=false
6470$at_check_filter
6471at_fn_diff_devnull "$at_stderr" || at_failed=:
6472at_fn_diff_devnull "$at_stdout" || at_failed=:
6473at_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"
6482at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:781"
6483( $at_check_trace; $BISON_C_WORKS
6484) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6485at_status=$? at_failed=false
6486$at_check_filter
6487echo stderr:; cat "$at_stderr"
6488echo stdout:; cat "$at_stdout"
6489at_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 "
6495at_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>&-
6498at_status=$? at_failed=false
6499$at_check_filter
6500echo stderr:; cat "$at_stderr"
6501echo stdout:; cat "$at_stdout"
6502at_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.
6510cat >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%%
6524start: .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"
6531at_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>&-
6534at_status=$? at_failed=false
6535$at_check_filter
6536echo >>"$at_stderr"; $as_echo "input.y:10.10: error: invalid character: '-'
6537input.y:11.10-16: error: invalid identifier: '1NV4L1D'
6538input.y:12.10: error: invalid character: '-'
6539" | \
6540  $at_diff - "$at_stderr" || at_failed=:
6541at_fn_diff_devnull "$at_stdout" || at_failed=:
6542at_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
6551read at_status <"$at_status_file"
6552#AT_STOP_18
6553#AT_START_19
6554at_fn_group_banner 19 'input.at:807' \
6555  "Numbered tokens" "                                " 1
6556at_xfail=no
6557(
6558  $as_echo "19. $at_setup_line: testing $at_desc ..."
6559  $at_traceon
6560
6561
6562cat >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%%
6576start: 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"
6584at_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>&-
6587at_status=$? at_failed=false
6588$at_check_filter
6589echo >>"$at_stderr"; $as_echo "redecl.y:10.10-22: error: user token number 11259375 redeclaration for HEXADECIMAL_1
6590redecl.y:9.8-16:       previous declaration for DECIMAL_1
6591redecl.y:12.10-18: error: user token number 16702650 redeclaration for DECIMAL_2
6592redecl.y:11.10-22:     previous declaration for HEXADECIMAL_2
6593" | \
6594  $at_diff - "$at_stderr" || at_failed=:
6595at_fn_diff_devnull "$at_stdout" || at_failed=:
6596at_fn_check_status 1 $at_status "$at_srcdir/input.at:818"
6597$at_failed && at_fn_log_failure
6598$at_traceon; }
6599
6600
6601
6602cat >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%%
6614start: 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"
6623at_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>&-
6626at_status=$? at_failed=false
6627$at_check_filter
6628echo >>"$at_stderr"; $as_echo "too-large.y:9.22-42: error: integer out of range: '999999999999999999999'
6629too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
6630" | \
6631  $at_diff - "$at_stderr" || at_failed=:
6632at_fn_diff_devnull "$at_stdout" || at_failed=:
6633at_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
6642read at_status <"$at_status_file"
6643#AT_STOP_19
6644#AT_START_20
6645at_fn_group_banner 20 'input.at:845' \
6646  "Unclosed constructs" "                            " 1
6647at_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
6658cat >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
6668start: ;
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"
6684at_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>&-
6687at_status=$? at_failed=false
6688$at_check_filter
6689echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line
6690input.y:4.10-5.0: error: missing \"'\" at end of line
6691input.y:14.11-15.0: error: missing \"'\" at end of line
6692input.y:16.11-17.0: error: missing '\"' at end of line
6693input.y:19.13-20.0: error: missing '}' at end of file
6694input.y:20.1: error: syntax error, unexpected end of file
6695" | \
6696  $at_diff - "$at_stderr" || at_failed=:
6697at_fn_diff_devnull "$at_stdout" || at_failed=:
6698at_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"
6707at_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>&-
6710at_status=$? at_failed=false
6711$at_check_filter
6712echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line
6713 %token A \"a
6714          ^^
6715input.y:4.10-5.0: error: missing \"'\" at end of line
6716 %token C '1
6717          ^^
6718input.y:14.11-15.0: error: missing \"'\" at end of line
6719 %type <f> 'a
6720           ^^
6721input.y:16.11-17.0: error: missing '\"' at end of line
6722 %type <f> \"a
6723           ^^
6724input.y:19.13-20.0: error: missing '}' at end of file
6725 %destructor { free (\$\$)
6726             ^^^^^^^^^^^
6727input.y:20.1: error: syntax error, unexpected end of file
6728" | \
6729  $at_diff - "$at_stderr" || at_failed=:
6730at_fn_diff_devnull "$at_stdout" || at_failed=:
6731at_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
6740read at_status <"$at_status_file"
6741#AT_STOP_20
6742#AT_START_21
6743at_fn_group_banner 21 'input.at:909' \
6744  "%start after first rule" "                        " 1
6745at_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
6754cat >input.y <<'_ATEOF'
6755%%
6756false_start: ;
6757start: false_start ;
6758%start start;
6759_ATEOF
6760
6761
6762if 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"
6770at_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>&-
6774at_status=$? at_failed=false
6775$at_check_filter
6776echo stderr:; cat "$at_stderr"
6777echo stdout:; cat "$at_stdout"
6778at_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"
6784at_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>&-
6787at_status=$? at_failed=false
6788$at_check_filter
6789echo stderr:; cat "$at_stderr"
6790echo stdout:; cat "$at_stdout"
6791at_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"
6800at_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>&-
6805at_status=$? at_failed=false
6806$at_check_filter
6807at_fn_diff_devnull "$at_stderr" || at_failed=:
6808$at_diff expout "$at_stdout" || at_failed=:
6809at_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"
6818at_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>&-
6823at_status=$? at_failed=false
6824$at_check_filter
6825at_fn_diff_devnull "$at_stderr" || at_failed=:
6826$at_diff expout "$at_stdout" || at_failed=:
6827at_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
6833fi
6834{ set +x
6835$as_echo "$at_srcdir/input.at:921: bison -o input.c input.y"
6836at_fn_check_prepare_trace "input.at:921"
6837( $at_check_trace; bison -o input.c input.y
6838) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6839at_status=$? at_failed=false
6840$at_check_filter
6841at_fn_diff_devnull "$at_stderr" || at_failed=:
6842at_fn_diff_devnull "$at_stdout" || at_failed=:
6843at_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
6852read at_status <"$at_status_file"
6853#AT_STOP_21
6854#AT_START_22
6855at_fn_group_banner 22 'input.at:930' \
6856  "%prec takes a token" "                            " 1
6857at_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
6865cat >input.y <<'_ATEOF'
6866%%
6867start: PREC %prec PREC ;
6868PREC: ;
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"
6875at_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>&-
6878at_status=$? at_failed=false
6879$at_check_filter
6880echo >>"$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=:
6883at_fn_diff_devnull "$at_stdout" || at_failed=:
6884at_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
6893read at_status <"$at_status_file"
6894#AT_STOP_22
6895#AT_START_23
6896at_fn_group_banner 23 'input.at:951' \
6897  "%prec's token must be defined" "                  " 1
6898at_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
6906cat >input.y <<'_ATEOF'
6907%%
6908start: %prec PREC ;
6909_ATEOF
6910
6911
6912if 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"
6920at_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>&-
6924at_status=$? at_failed=false
6925$at_check_filter
6926echo stderr:; cat "$at_stderr"
6927echo stdout:; cat "$at_stdout"
6928at_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"
6934at_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>&-
6937at_status=$? at_failed=false
6938$at_check_filter
6939echo stderr:; cat "$at_stderr"
6940echo stdout:; cat "$at_stdout"
6941at_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"
6950at_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>&-
6955at_status=$? at_failed=false
6956$at_check_filter
6957at_fn_diff_devnull "$at_stderr" || at_failed=:
6958$at_diff expout "$at_stdout" || at_failed=:
6959at_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"
6968at_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>&-
6973at_status=$? at_failed=false
6974$at_check_filter
6975at_fn_diff_devnull "$at_stderr" || at_failed=:
6976$at_diff expout "$at_stdout" || at_failed=:
6977at_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
6983fi
6984{ set +x
6985$as_echo "$at_srcdir/input.at:960: bison input.y"
6986at_fn_check_prepare_trace "input.at:960"
6987( $at_check_trace; bison input.y
6988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
6989at_status=$? at_failed=false
6990$at_check_filter
6991echo >>"$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=:
6994at_fn_diff_devnull "$at_stdout" || at_failed=:
6995at_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.
7002if 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"
7011at_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>&-
7014at_status=$? at_failed=false
7015$at_check_filter
7016echo stderr:; tee stderr <"$at_stderr"
7017$at_diff expout "$at_stdout" || at_failed=:
7018at_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'
7026input.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"
7056at_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>&-
7060at_status=$? at_failed=false
7061$at_check_filter
7062$at_diff experr "$at_stderr" || at_failed=:
7063at_fn_diff_devnull "$at_stdout" || at_failed=:
7064at_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"
7073at_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>&-
7076at_status=$? at_failed=false
7077$at_check_filter
7078$at_diff experr "$at_stderr" || at_failed=:
7079$at_diff expout "$at_stdout" || at_failed=:
7080at_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"
7090at_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>&-
7093at_status=$? at_failed=false
7094$at_check_filter
7095at_fn_diff_devnull "$at_stderr" || at_failed=:
7096$at_diff expout "$at_stdout" || at_failed=:
7097at_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"
7103at_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>&-
7106at_status=$? at_failed=false
7107$at_check_filter
7108at_fn_diff_devnull "$at_stderr" || at_failed=:
7109$at_diff expout "$at_stdout" || at_failed=:
7110at_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
7116fi
7117
7118  set +x
7119  $at_times_p && times >"$at_times_file"
7120) 5>&1 2>&1 7>&- | eval $at_tee_pipe
7121read at_status <"$at_status_file"
7122#AT_STOP_23
7123#AT_START_24
7124at_fn_group_banner 24 'input.at:971' \
7125  "Reject unused %code qualifiers" "                 " 1
7126at_xfail=no
7127(
7128  $as_echo "24. $at_setup_line: testing $at_desc ..."
7129  $at_traceon
7130
7131
7132cat >input-c.y <<'_ATEOF'
7133%code q {}
7134%code bad {}
7135%code bad {}
7136%code format {}
7137%%
7138start: ;
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"
7144at_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>&-
7147at_status=$? at_failed=false
7148$at_check_filter
7149echo >>"$at_stderr"; $as_echo "input-c.y:1.7: error: %code qualifier 'q' is not used
7150input-c.y:2.7-9: error: %code qualifier 'bad' is not used
7151input-c.y:3.7-9: error: %code qualifier 'bad' is not used
7152input-c.y:4.7-12: error: %code qualifier 'format' is not used
7153" | \
7154  $at_diff - "$at_stderr" || at_failed=:
7155at_fn_diff_devnull "$at_stdout" || at_failed=:
7156at_fn_check_status 1 $at_status "$at_srcdir/input.at:981"
7157$at_failed && at_fn_log_failure
7158$at_traceon; }
7159
7160
7161
7162cat >input-c-glr.y <<'_ATEOF'
7163%code q {}
7164%code bad {}
7165 %code bad {}
7166%%
7167start: ;
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"
7173at_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>&-
7176at_status=$? at_failed=false
7177$at_check_filter
7178echo >>"$at_stderr"; $as_echo "input-c-glr.y:1.7: error: %code qualifier 'q' is not used
7179input-c-glr.y:2.7-9: error: %code qualifier 'bad' is not used
7180input-c-glr.y:3.8-10: error: %code qualifier 'bad' is not used
7181" | \
7182  $at_diff - "$at_stderr" || at_failed=:
7183at_fn_diff_devnull "$at_stdout" || at_failed=:
7184at_fn_check_status 1 $at_status "$at_srcdir/input.at:995"
7185$at_failed && at_fn_log_failure
7186$at_traceon; }
7187
7188
7189
7190cat >input-c++.y <<'_ATEOF'
7191%code q {}
7192%code bad {}
7193 %code q {}
7194%%
7195start: ;
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"
7201at_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>&-
7204at_status=$? at_failed=false
7205$at_check_filter
7206echo >>"$at_stderr"; $as_echo "input-c++.y:1.7: error: %code qualifier 'q' is not used
7207input-c++.y:2.7-9: error: %code qualifier 'bad' is not used
7208input-c++.y:3.8: error: %code qualifier 'q' is not used
7209" | \
7210  $at_diff - "$at_stderr" || at_failed=:
7211at_fn_diff_devnull "$at_stdout" || at_failed=:
7212at_fn_check_status 1 $at_status "$at_srcdir/input.at:1008"
7213$at_failed && at_fn_log_failure
7214$at_traceon; }
7215
7216
7217
7218cat >input-c++-glr.y <<'_ATEOF'
7219%code bad {}
7220%code q {}
7221%code q {}
7222%%
7223start: ;
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"
7229at_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>&-
7232at_status=$? at_failed=false
7233$at_check_filter
7234echo >>"$at_stderr"; $as_echo "input-c++-glr.y:1.7-9: error: %code qualifier 'bad' is not used
7235input-c++-glr.y:2.7: error: %code qualifier 'q' is not used
7236input-c++-glr.y:3.7: error: %code qualifier 'q' is not used
7237" | \
7238  $at_diff - "$at_stderr" || at_failed=:
7239at_fn_diff_devnull "$at_stdout" || at_failed=:
7240at_fn_check_status 1 $at_status "$at_srcdir/input.at:1021"
7241$at_failed && at_fn_log_failure
7242$at_traceon; }
7243
7244
7245
7246cat >special-char-@@.y <<'_ATEOF'
7247%code bad {}
7248%code q {}
7249%code q {}
7250%%
7251start: ;
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"
7257at_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>&-
7260at_status=$? at_failed=false
7261$at_check_filter
7262echo >>"$at_stderr"; $as_echo "special-char-@@.y:1.7-9: error: %code qualifier 'bad' is not used
7263special-char-@@.y:2.7: error: %code qualifier 'q' is not used
7264special-char-@@.y:3.7: error: %code qualifier 'q' is not used
7265" | \
7266  $at_diff - "$at_stderr" || at_failed=:
7267at_fn_diff_devnull "$at_stdout" || at_failed=:
7268at_fn_check_status 1 $at_status "$at_srcdir/input.at:1034"
7269$at_failed && at_fn_log_failure
7270$at_traceon; }
7271
7272
7273
7274cat >special-char-].y <<'_ATEOF'
7275%code bad {}
7276%code q {}
7277%code q {}
7278%%
7279start: ;
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"
7285at_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>&-
7288at_status=$? at_failed=false
7289$at_check_filter
7290echo >>"$at_stderr"; $as_echo "special-char-].y:1.7-9: error: %code qualifier 'bad' is not used
7291special-char-].y:2.7: error: %code qualifier 'q' is not used
7292special-char-].y:3.7: error: %code qualifier 'q' is not used
7293" | \
7294  $at_diff - "$at_stderr" || at_failed=:
7295at_fn_diff_devnull "$at_stdout" || at_failed=:
7296at_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
7305read at_status <"$at_status_file"
7306#AT_STOP_24
7307#AT_START_25
7308at_fn_group_banner 25 'input.at:1060' \
7309  "%define errors" "                                 " 1
7310at_xfail=no
7311(
7312  $as_echo "25. $at_setup_line: testing $at_desc ..."
7313  $at_traceon
7314
7315
7316cat >input-redefined.y <<'_ATEOF'
7317%define var "value1"
7318%define var "value1"
7319 %define var "value2"
7320%define special1 "]"
7321%define special2 "["
7322%%
7323start: ;
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"
7330at_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>&-
7333at_status=$? at_failed=false
7334$at_check_filter
7335echo >>"$at_stderr"; $as_echo "input-redefined.y:2.9-11: error: %define variable 'var' redefined
7336input-redefined.y:1.9-11:     previous definition
7337input-redefined.y:3.10-12: error: %define variable 'var' redefined
7338input-redefined.y:2.9-11:      previous definition
7339" | \
7340  $at_diff - "$at_stderr" || at_failed=:
7341at_fn_diff_devnull "$at_stdout" || at_failed=:
7342at_fn_check_status 1 $at_status "$at_srcdir/input.at:1072"
7343$at_failed && at_fn_log_failure
7344$at_traceon; }
7345
7346
7347
7348cat >input-unused.y <<'_ATEOF'
7349%define var "value"
7350%%
7351start: ;
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"
7358at_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>&-
7361at_status=$? at_failed=false
7362$at_check_filter
7363echo >>"$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=:
7366at_fn_diff_devnull "$at_stdout" || at_failed=:
7367at_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
7376read at_status <"$at_status_file"
7377#AT_STOP_25
7378#AT_START_26
7379at_fn_group_banner 26 'input.at:1096' \
7380  "%define, --define, --force-define" "              " 1
7381at_xfail=no
7382(
7383  $as_echo "26. $at_setup_line: testing $at_desc ..."
7384  $at_traceon
7385
7386
7387cat >skel.c <<'_ATEOF'
7388m4_divert_push(0)@
7389@output(b4_parser_file_name@)@
7390[var-dd: ]b4_percent_define_get([[var-dd]])[
7391var-ff: ]b4_percent_define_get([[var-ff]])[
7392var-dfg: ]b4_percent_define_get([[var-dfg]])[
7393var-fd: ]b4_percent_define_get([[var-fd]])
7394m4_divert_pop(0)
7395_ATEOF
7396
7397cat >input.y <<'_ATEOF'
7398%define var-dfg "gram"
7399%%
7400start: ;
7401_ATEOF
7402
7403if 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"
7415at_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>&-
7423at_status=$? at_failed=false
7424$at_check_filter
7425echo stderr:; cat "$at_stderr"
7426echo stdout:; cat "$at_stdout"
7427at_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"
7437at_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>&-
7444at_status=$? at_failed=false
7445$at_check_filter
7446echo stderr:; cat "$at_stderr"
7447echo stdout:; cat "$at_stdout"
7448at_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"
7457at_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>&-
7462at_status=$? at_failed=false
7463$at_check_filter
7464at_fn_diff_devnull "$at_stderr" || at_failed=:
7465$at_diff expout "$at_stdout" || at_failed=:
7466at_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"
7475at_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>&-
7480at_status=$? at_failed=false
7481$at_check_filter
7482at_fn_diff_devnull "$at_stderr" || at_failed=:
7483$at_diff expout "$at_stdout" || at_failed=:
7484at_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
7490fi
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"
7497at_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>&-
7504at_status=$? at_failed=false
7505$at_check_filter
7506at_fn_diff_devnull "$at_stderr" || at_failed=:
7507at_fn_diff_devnull "$at_stdout" || at_failed=:
7508at_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"
7515at_fn_check_prepare_trace "input.at:1117"
7516( $at_check_trace; cat input.tab.c
7517) >>"$at_stdout" 2>>"$at_stderr" 5>&-
7518at_status=$? at_failed=false
7519$at_check_filter
7520at_fn_diff_devnull "$at_stderr" || at_failed=:
7521echo >>"$at_stdout"; $as_echo "var-dd: cmd-d2
7522var-ff: cmd-f2
7523var-dfg: cmd-f
7524var-fd: cmd-d
7525" | \
7526  $at_diff - "$at_stdout" || at_failed=:
7527at_fn_check_status 0 $at_status "$at_srcdir/input.at:1117"
7528$at_failed && at_fn_log_failure
7529$at_traceon; }
7530
7531
7532cat >input-dg.y <<'_ATEOF'
7533%define var "gram"
7534%%
7535start: ;
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"
7541at_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>&-
7544at_status=$? at_failed=false
7545$at_check_filter
7546echo >>"$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=:
7550at_fn_diff_devnull "$at_stdout" || at_failed=:
7551at_fn_check_status 1 $at_status "$at_srcdir/input.at:1129"
7552$at_failed && at_fn_log_failure
7553$at_traceon; }
7554
7555
7556
7557cat >input-dg.y <<'_ATEOF'
7558%define var "gram"
7559%%
7560start: ;
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"
7566at_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>&-
7569at_status=$? at_failed=false
7570$at_check_filter
7571echo >>"$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=:
7577at_fn_diff_devnull "$at_stdout" || at_failed=:
7578at_fn_check_status 1 $at_status "$at_srcdir/input.at:1139"
7579$at_failed && at_fn_log_failure
7580$at_traceon; }
7581
7582
7583
7584cat >input-unused.y <<'_ATEOF'
7585%%
7586start: ;
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"
7592at_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>&-
7595at_status=$? at_failed=false
7596$at_check_filter
7597echo >>"$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=:
7601at_fn_diff_devnull "$at_stdout" || at_failed=:
7602at_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
7611read at_status <"$at_status_file"
7612#AT_STOP_26
7613#AT_START_27
7614at_fn_group_banner 27 'input.at:1161' \
7615  "%define Boolean variables" "                      " 1
7616at_xfail=no
7617(
7618  $as_echo "27. $at_setup_line: testing $at_desc ..."
7619  $at_traceon
7620
7621
7622cat >Input.y <<'_ATEOF'
7623%language "Java"
7624%define public "maybe"
7625%define parser_class_name "Input"
7626%%
7627start: ;
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"
7634at_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>&-
7637at_status=$? at_failed=false
7638$at_check_filter
7639echo >>"$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=:
7642at_fn_diff_devnull "$at_stdout" || at_failed=:
7643at_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
7652read at_status <"$at_status_file"
7653#AT_STOP_27
7654#AT_START_28
7655at_fn_group_banner 28 'input.at:1181' \
7656  "%define enum variables" "                         " 1
7657at_xfail=no
7658(
7659  $as_echo "28. $at_setup_line: testing $at_desc ..."
7660  $at_traceon
7661
7662
7663# Front-end.
7664cat >input.y <<'_ATEOF'
7665%define lr.default-reductions bogus
7666%%
7667start: ;
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"
7673at_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>&-
7676at_status=$? at_failed=false
7677$at_check_filter
7678echo >>"$at_stderr"; $as_echo "input.y:1.9-29: error: invalid value for %define variable 'lr.default-reductions': 'bogus'
7679input.y:1.9-29:     accepted value: 'most'
7680input.y:1.9-29:     accepted value: 'consistent'
7681input.y:1.9-29:     accepted value: 'accepting'
7682" | \
7683  $at_diff - "$at_stderr" || at_failed=:
7684at_fn_diff_devnull "$at_stdout" || at_failed=:
7685at_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
7693cat >input.y <<'_ATEOF'
7694%define api.push-pull neither
7695%%
7696start: ;
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"
7702at_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>&-
7705at_status=$? at_failed=false
7706$at_check_filter
7707echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
7708input.y:1.9-21: error: accepted value: 'pull'
7709input.y:1.9-21: error: accepted value: 'push'
7710input.y:1.9-21: error: accepted value: 'both'
7711" | \
7712  $at_diff - "$at_stderr" || at_failed=:
7713at_fn_diff_devnull "$at_stdout" || at_failed=:
7714at_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
7723read at_status <"$at_status_file"
7724#AT_STOP_28
7725#AT_START_29
7726at_fn_group_banner 29 'input.at:1216' \
7727  "%define backward compatibility" "                 " 1
7728at_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
7737cat >input.y <<'_ATEOF'
7738%define api.push_pull "neither"
7739%%
7740start: ;
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"
7746at_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>&-
7749at_status=$? at_failed=false
7750$at_check_filter
7751echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
7752input.y:1.9-21: error: accepted value: 'pull'
7753input.y:1.9-21: error: accepted value: 'push'
7754input.y:1.9-21: error: accepted value: 'both'
7755" | \
7756  $at_diff - "$at_stderr" || at_failed=:
7757at_fn_diff_devnull "$at_stdout" || at_failed=:
7758at_fn_check_status 1 $at_status "$at_srcdir/input.at:1226"
7759$at_failed && at_fn_log_failure
7760$at_traceon; }
7761
7762
7763
7764cat >input.y <<'_ATEOF'
7765%define lr.keep_unreachable_states maybe
7766%%
7767start: ;
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"
7773at_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>&-
7776at_status=$? at_failed=false
7777$at_check_filter
7778echo >>"$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=:
7781at_fn_diff_devnull "$at_stdout" || at_failed=:
7782at_fn_check_status 1 $at_status "$at_srcdir/input.at:1238"
7783$at_failed && at_fn_log_failure
7784$at_traceon; }
7785
7786
7787
7788cat >input.y <<'_ATEOF'
7789%define foo_bar "baz"
7790%%
7791start: ;
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"
7797at_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>&-
7800at_status=$? at_failed=false
7801$at_check_filter
7802echo >>"$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=:
7805at_fn_diff_devnull "$at_stdout" || at_failed=:
7806at_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
7815read at_status <"$at_status_file"
7816#AT_STOP_29
7817#AT_START_30
7818at_fn_group_banner 30 'input.at:1257' \
7819  "Unused %define api.pure" "                        " 1
7820at_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
7833cat >input.y <<'_ATEOF'
7834%define api.pure
7835%language "c++" %defines
7836%%
7837start: ;
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"
7844at_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>&-
7847at_status=$? at_failed=false
7848$at_check_filter
7849echo >>"$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=:
7852at_fn_diff_devnull "$at_stdout" || at_failed=:
7853at_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
7860cat >input.y <<'_ATEOF'
7861%define api.pure false
7862%language "c++" %defines
7863%%
7864start: ;
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"
7871at_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>&-
7874at_status=$? at_failed=false
7875$at_check_filter
7876echo >>"$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=:
7879at_fn_diff_devnull "$at_stdout" || at_failed=:
7880at_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
7887cat >input.y <<'_ATEOF'
7888%define api.pure ""
7889%language "c++" %defines %glr-parser
7890%%
7891start: ;
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"
7898at_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>&-
7901at_status=$? at_failed=false
7902$at_check_filter
7903echo >>"$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=:
7906at_fn_diff_devnull "$at_stdout" || at_failed=:
7907at_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
7914cat >input.y <<'_ATEOF'
7915%define api.pure false
7916%language "c++" %defines %glr-parser
7917%%
7918start: ;
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"
7925at_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>&-
7928at_status=$? at_failed=false
7929$at_check_filter
7930echo >>"$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=:
7933at_fn_diff_devnull "$at_stdout" || at_failed=:
7934at_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
7941cat >input.y <<'_ATEOF'
7942%define api.pure true
7943%language "java"
7944%%
7945start: ;
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"
7952at_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>&-
7955at_status=$? at_failed=false
7956$at_check_filter
7957echo >>"$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=:
7960at_fn_diff_devnull "$at_stdout" || at_failed=:
7961at_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
7968cat >input.y <<'_ATEOF'
7969%define api.pure false
7970%language "java"
7971%%
7972start: ;
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"
7979at_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>&-
7982at_status=$? at_failed=false
7983$at_check_filter
7984echo >>"$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=:
7987at_fn_diff_devnull "$at_stdout" || at_failed=:
7988at_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
7998read at_status <"$at_status_file"
7999#AT_STOP_30
8000#AT_START_31
8001at_fn_group_banner 31 'input.at:1290' \
8002  "C++ namespace reference errors" "                 " 1
8003at_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
8015cat >input.y <<'_ATEOF'
8016%language "C++"
8017%defines
8018%define namespace ""
8019%%
8020start: ;
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"
8027at_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>&-
8030at_status=$? at_failed=false
8031$at_check_filter
8032echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty
8033" | \
8034  $at_diff - "$at_stderr" || at_failed=:
8035at_fn_diff_devnull "$at_stdout" || at_failed=:
8036at_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
8043cat >input.y <<'_ATEOF'
8044%language "C++"
8045%defines
8046%define namespace " 		  	 	"
8047%%
8048start: ;
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"
8055at_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>&-
8058at_status=$? at_failed=false
8059$at_check_filter
8060echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty
8061" | \
8062  $at_diff - "$at_stderr" || at_failed=:
8063at_fn_diff_devnull "$at_stdout" || at_failed=:
8064at_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
8071cat >input.y <<'_ATEOF'
8072%language "C++"
8073%defines
8074%define namespace "foo::::bar"
8075%%
8076start: ;
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"
8083at_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>&-
8086at_status=$? at_failed=false
8087$at_check_filter
8088echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
8089" | \
8090  $at_diff - "$at_stderr" || at_failed=:
8091at_fn_diff_devnull "$at_stdout" || at_failed=:
8092at_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
8099cat >input.y <<'_ATEOF'
8100%language "C++"
8101%defines
8102%define namespace "foo:: 	::bar"
8103%%
8104start: ;
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"
8111at_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>&-
8114at_status=$? at_failed=false
8115$at_check_filter
8116echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
8117" | \
8118  $at_diff - "$at_stderr" || at_failed=:
8119at_fn_diff_devnull "$at_stdout" || at_failed=:
8120at_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
8127cat >input.y <<'_ATEOF'
8128%language "C++"
8129%defines
8130%define namespace "::::bar"
8131%%
8132start: ;
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"
8139at_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>&-
8142at_status=$? at_failed=false
8143$at_check_filter
8144echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
8145" | \
8146  $at_diff - "$at_stderr" || at_failed=:
8147at_fn_diff_devnull "$at_stdout" || at_failed=:
8148at_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
8155cat >input.y <<'_ATEOF'
8156%language "C++"
8157%defines
8158%define namespace ":: ::bar"
8159%%
8160start: ;
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"
8167at_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>&-
8170at_status=$? at_failed=false
8171$at_check_filter
8172echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
8173" | \
8174  $at_diff - "$at_stderr" || at_failed=:
8175at_fn_diff_devnull "$at_stdout" || at_failed=:
8176at_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
8183cat >input.y <<'_ATEOF'
8184%language "C++"
8185%defines
8186%define namespace "foo::bar::	::"
8187%%
8188start: ;
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"
8195at_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>&-
8198at_status=$? at_failed=false
8199$at_check_filter
8200echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
8201input.y:3.9-17: error: namespace reference has a trailing \"::\"
8202" | \
8203  $at_diff - "$at_stderr" || at_failed=:
8204at_fn_diff_devnull "$at_stdout" || at_failed=:
8205at_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
8212cat >input.y <<'_ATEOF'
8213%language "C++"
8214%defines
8215%define namespace "foo::bar::"
8216%%
8217start: ;
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"
8224at_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>&-
8227at_status=$? at_failed=false
8228$at_check_filter
8229echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
8230" | \
8231  $at_diff - "$at_stderr" || at_failed=:
8232at_fn_diff_devnull "$at_stdout" || at_failed=:
8233at_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
8240cat >input.y <<'_ATEOF'
8241%language "C++"
8242%defines
8243%define namespace "foo::bar:: 	"
8244%%
8245start: ;
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"
8252at_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>&-
8255at_status=$? at_failed=false
8256$at_check_filter
8257echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
8258" | \
8259  $at_diff - "$at_stderr" || at_failed=:
8260at_fn_diff_devnull "$at_stdout" || at_failed=:
8261at_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
8268cat >input.y <<'_ATEOF'
8269%language "C++"
8270%defines
8271%define namespace "::"
8272%%
8273start: ;
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"
8280at_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>&-
8283at_status=$? at_failed=false
8284$at_check_filter
8285echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
8286" | \
8287  $at_diff - "$at_stderr" || at_failed=:
8288at_fn_diff_devnull "$at_stdout" || at_failed=:
8289at_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
8299read at_status <"$at_status_file"
8300#AT_STOP_31
8301#AT_START_32
8302at_fn_group_banner 32 'input.at:1346' \
8303  "Bad character literals" "                         " 1
8304at_xfail=no
8305(
8306  $as_echo "32. $at_setup_line: testing $at_desc ..."
8307  $at_traceon
8308
8309
8310cat >empty.y <<'_ATEOF'
8311%%
8312start: '';
8313start: '
8314_ATEOF
8315
8316{ set +x
8317$as_echo "$at_srcdir/input.at:1353: \$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77"
8318at_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>&-
8321at_status=$? at_failed=false
8322$at_check_filter
8323at_fn_diff_devnull "$at_stderr" || at_failed=:
8324at_fn_diff_devnull "$at_stdout" || at_failed=:
8325at_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"
8333at_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>&-
8336at_status=$? at_failed=false
8337$at_check_filter
8338echo >>"$at_stderr"; $as_echo "empty.y:2.8-9: warning: empty character literal
8339empty.y:3.8-4.0: warning: empty character literal
8340empty.y:3.8-4.0: error: missing \"'\" at end of line
8341empty.y:4.8: warning: empty character literal
8342empty.y:4.8: error: missing \"'\" at end of file
8343" | \
8344  $at_diff - "$at_stderr" || at_failed=:
8345at_fn_diff_devnull "$at_stdout" || at_failed=:
8346at_fn_check_status 1 $at_status "$at_srcdir/input.at:1355"
8347$at_failed && at_fn_log_failure
8348$at_traceon; }
8349
8350
8351
8352cat >two.y <<'_ATEOF'
8353%%
8354start: 'ab';
8355start: 'ab
8356_ATEOF
8357
8358{ set +x
8359$as_echo "$at_srcdir/input.at:1368: \$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77"
8360at_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>&-
8363at_status=$? at_failed=false
8364$at_check_filter
8365at_fn_diff_devnull "$at_stderr" || at_failed=:
8366at_fn_diff_devnull "$at_stdout" || at_failed=:
8367at_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"
8375at_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>&-
8378at_status=$? at_failed=false
8379$at_check_filter
8380echo >>"$at_stderr"; $as_echo "two.y:2.8-11: warning: extra characters in character literal
8381two.y:3.8-4.0: warning: extra characters in character literal
8382two.y:3.8-4.0: error: missing \"'\" at end of line
8383two.y:4.8-10: warning: extra characters in character literal
8384two.y:4.8-10: error: missing \"'\" at end of file
8385" | \
8386  $at_diff - "$at_stderr" || at_failed=:
8387at_fn_diff_devnull "$at_stdout" || at_failed=:
8388at_fn_check_status 1 $at_status "$at_srcdir/input.at:1370"
8389$at_failed && at_fn_log_failure
8390$at_traceon; }
8391
8392
8393
8394cat >three.y <<'_ATEOF'
8395%%
8396start: 'abc';
8397start: 'abc
8398_ATEOF
8399
8400{ set +x
8401$as_echo "$at_srcdir/input.at:1383: \$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77"
8402at_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>&-
8405at_status=$? at_failed=false
8406$at_check_filter
8407at_fn_diff_devnull "$at_stderr" || at_failed=:
8408at_fn_diff_devnull "$at_stdout" || at_failed=:
8409at_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"
8417at_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>&-
8420at_status=$? at_failed=false
8421$at_check_filter
8422echo >>"$at_stderr"; $as_echo "three.y:2.8-12: warning: extra characters in character literal
8423three.y:3.8-4.0: warning: extra characters in character literal
8424three.y:3.8-4.0: error: missing \"'\" at end of line
8425three.y:4.8-11: warning: extra characters in character literal
8426three.y:4.8-11: error: missing \"'\" at end of file
8427" | \
8428  $at_diff - "$at_stderr" || at_failed=:
8429at_fn_diff_devnull "$at_stdout" || at_failed=:
8430at_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
8439read at_status <"$at_status_file"
8440#AT_STOP_32
8441#AT_START_33
8442at_fn_group_banner 33 'input.at:1399' \
8443  "Bad escapes in literals" "                        " 1
8444at_xfail=no
8445(
8446  $as_echo "33. $at_setup_line: testing $at_desc ..."
8447  $at_traceon
8448
8449
8450cat >input.y <<'_ATEOF'
8451%%
8452start: '\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"
8465at_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>&-
8469at_status=$? at_failed=false
8470$at_check_filter
8471at_fn_diff_devnull "$at_stderr" || at_failed=:
8472at_fn_diff_devnull "$at_stdout" || at_failed=:
8473at_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"
8481at_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>&-
8484at_status=$? at_failed=false
8485$at_check_filter
8486echo >>"$at_stderr"; $as_echo "input.y:2.9-12: error: invalid number after \\-escape: 777
8487input.y:2.8-13: warning: empty character literal
8488input.y:2.16-17: error: invalid number after \\-escape: 0
8489input.y:2.15-18: warning: empty character literal
8490input.y:2.21-25: error: invalid number after \\-escape: xfff
8491input.y:2.20-26: warning: empty character literal
8492input.y:2.29-31: error: invalid number after \\-escape: x0
8493input.y:2.28-32: warning: empty character literal
8494input.y:3.9-14: error: invalid number after \\-escape: uffff
8495input.y:3.8-15: warning: empty character literal
8496input.y:3.18-23: error: invalid number after \\-escape: u0000
8497input.y:3.17-24: warning: empty character literal
8498input.y:3.27-36: error: invalid number after \\-escape: Uffffffff
8499input.y:3.26-37: warning: empty character literal
8500input.y:3.40-49: error: invalid number after \\-escape: U00000000
8501input.y:3.39-50: warning: empty character literal
8502input.y:4.9-10: error: invalid character after \\-escape: ' '
8503input.y:4.8-11: warning: empty character literal
8504input.y:4.14-15: error: invalid character after \\-escape: A
8505input.y:4.13-16: warning: empty character literal
8506input.y:5.9-16: error: invalid character after \\-escape: \\t
8507input.y:5.17: error: invalid character after \\-escape: \\f
8508input.y:5.18: error: invalid character after \\-escape: \\0
8509input.y:5.19: error: invalid character after \\-escape: \\001
8510" | \
8511  $at_diff - "$at_stderr" || at_failed=:
8512at_fn_diff_devnull "$at_stdout" || at_failed=:
8513at_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
8522read at_status <"$at_status_file"
8523#AT_STOP_33
8524#AT_START_34
8525at_fn_group_banner 34 'input.at:1448' \
8526  "LAC: Errors for %define" "                        " 1
8527at_xfail=no
8528(
8529  $as_echo "34. $at_setup_line: testing $at_desc ..."
8530  $at_traceon
8531
8532
8533cat >input.y <<'_ATEOF'
8534%%
8535start: ;
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"
8543at_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>&-
8546at_status=$? at_failed=false
8547$at_check_filter
8548echo >>"$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=:
8551at_fn_diff_devnull "$at_stdout" || at_failed=:
8552at_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"
8560at_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>&-
8563at_status=$? at_failed=false
8564$at_check_filter
8565echo >>"$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=:
8568at_fn_diff_devnull "$at_stdout" || at_failed=:
8569at_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
8578read at_status <"$at_status_file"
8579#AT_STOP_34
8580#AT_START_35
8581at_fn_group_banner 35 'input.at:1471' \
8582  "-Werror is not affected by -Wnone and -Wall" "    " 1
8583at_xfail=no
8584(
8585  $as_echo "35. $at_setup_line: testing $at_desc ..."
8586  $at_traceon
8587
8588
8589cat >input.y <<'_ATEOF'
8590%%
8591foo-bar: ;
8592_ATEOF
8593
8594
8595# -Werror is not enabled by -Wall or equivalent.
8596if 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"
8604at_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>&-
8608at_status=$? at_failed=false
8609$at_check_filter
8610echo stderr:; cat "$at_stderr"
8611echo stdout:; cat "$at_stdout"
8612at_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"
8618at_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>&-
8621at_status=$? at_failed=false
8622$at_check_filter
8623echo stderr:; cat "$at_stderr"
8624echo stdout:; cat "$at_stdout"
8625at_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"
8634at_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>&-
8639at_status=$? at_failed=false
8640$at_check_filter
8641at_fn_diff_devnull "$at_stderr" || at_failed=:
8642$at_diff expout "$at_stdout" || at_failed=:
8643at_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"
8652at_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>&-
8657at_status=$? at_failed=false
8658$at_check_filter
8659at_fn_diff_devnull "$at_stderr" || at_failed=:
8660$at_diff expout "$at_stdout" || at_failed=:
8661at_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
8667fi
8668{ set +x
8669$as_echo "$at_srcdir/input.at:1479: bison -Wall input.y"
8670at_fn_check_prepare_trace "input.at:1479"
8671( $at_check_trace; bison -Wall input.y
8672) >>"$at_stdout" 2>>"$at_stderr" 5>&-
8673at_status=$? at_failed=false
8674$at_check_filter
8675echo >>"$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=:
8678at_fn_diff_devnull "$at_stdout" || at_failed=:
8679at_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.
8686if 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"
8695at_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>&-
8698at_status=$? at_failed=false
8699$at_check_filter
8700echo stderr:; tee stderr <"$at_stderr"
8701$at_diff expout "$at_stdout" || at_failed=:
8702at_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'
8710input.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"
8740at_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>&-
8744at_status=$? at_failed=false
8745$at_check_filter
8746$at_diff experr "$at_stderr" || at_failed=:
8747at_fn_diff_devnull "$at_stdout" || at_failed=:
8748at_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"
8757at_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>&-
8760at_status=$? at_failed=false
8761$at_check_filter
8762$at_diff experr "$at_stderr" || at_failed=:
8763$at_diff expout "$at_stdout" || at_failed=:
8764at_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"
8774at_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>&-
8777at_status=$? at_failed=false
8778$at_check_filter
8779at_fn_diff_devnull "$at_stderr" || at_failed=:
8780$at_diff expout "$at_stdout" || at_failed=:
8781at_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"
8787at_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>&-
8790at_status=$? at_failed=false
8791$at_check_filter
8792at_fn_diff_devnull "$at_stderr" || at_failed=:
8793$at_diff expout "$at_stdout" || at_failed=:
8794at_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
8800fi
8801if 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"
8809at_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>&-
8813at_status=$? at_failed=false
8814$at_check_filter
8815echo stderr:; cat "$at_stderr"
8816echo stdout:; cat "$at_stdout"
8817at_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"
8823at_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>&-
8826at_status=$? at_failed=false
8827$at_check_filter
8828echo stderr:; cat "$at_stderr"
8829echo stdout:; cat "$at_stdout"
8830at_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"
8839at_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>&-
8844at_status=$? at_failed=false
8845$at_check_filter
8846at_fn_diff_devnull "$at_stderr" || at_failed=:
8847$at_diff expout "$at_stdout" || at_failed=:
8848at_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"
8857at_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>&-
8862at_status=$? at_failed=false
8863$at_check_filter
8864at_fn_diff_devnull "$at_stderr" || at_failed=:
8865$at_diff expout "$at_stdout" || at_failed=:
8866at_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
8872fi
8873{ set +x
8874$as_echo "$at_srcdir/input.at:1482: bison -W input.y"
8875at_fn_check_prepare_trace "input.at:1482"
8876( $at_check_trace; bison -W input.y
8877) >>"$at_stdout" 2>>"$at_stderr" 5>&-
8878at_status=$? at_failed=false
8879$at_check_filter
8880echo >>"$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=:
8883at_fn_diff_devnull "$at_stdout" || at_failed=:
8884at_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.
8891if 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"
8900at_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>&-
8903at_status=$? at_failed=false
8904$at_check_filter
8905echo stderr:; tee stderr <"$at_stderr"
8906$at_diff expout "$at_stdout" || at_failed=:
8907at_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'
8915input.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"
8945at_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>&-
8949at_status=$? at_failed=false
8950$at_check_filter
8951$at_diff experr "$at_stderr" || at_failed=:
8952at_fn_diff_devnull "$at_stdout" || at_failed=:
8953at_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"
8962at_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>&-
8965at_status=$? at_failed=false
8966$at_check_filter
8967$at_diff experr "$at_stderr" || at_failed=:
8968$at_diff expout "$at_stdout" || at_failed=:
8969at_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"
8979at_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>&-
8982at_status=$? at_failed=false
8983$at_check_filter
8984at_fn_diff_devnull "$at_stderr" || at_failed=:
8985$at_diff expout "$at_stdout" || at_failed=:
8986at_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"
8992at_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>&-
8995at_status=$? at_failed=false
8996$at_check_filter
8997at_fn_diff_devnull "$at_stderr" || at_failed=:
8998$at_diff expout "$at_stdout" || at_failed=:
8999at_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
9005fi
9006if 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"
9014at_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>&-
9018at_status=$? at_failed=false
9019$at_check_filter
9020echo stderr:; cat "$at_stderr"
9021echo stdout:; cat "$at_stdout"
9022at_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"
9028at_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>&-
9031at_status=$? at_failed=false
9032$at_check_filter
9033echo stderr:; cat "$at_stderr"
9034echo stdout:; cat "$at_stdout"
9035at_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"
9044at_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>&-
9049at_status=$? at_failed=false
9050$at_check_filter
9051at_fn_diff_devnull "$at_stderr" || at_failed=:
9052$at_diff expout "$at_stdout" || at_failed=:
9053at_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"
9062at_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>&-
9067at_status=$? at_failed=false
9068$at_check_filter
9069at_fn_diff_devnull "$at_stderr" || at_failed=:
9070$at_diff expout "$at_stdout" || at_failed=:
9071at_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
9077fi
9078{ set +x
9079$as_echo "$at_srcdir/input.at:1485: bison -Wno-none input.y"
9080at_fn_check_prepare_trace "input.at:1485"
9081( $at_check_trace; bison -Wno-none input.y
9082) >>"$at_stdout" 2>>"$at_stderr" 5>&-
9083at_status=$? at_failed=false
9084$at_check_filter
9085echo >>"$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=:
9088at_fn_diff_devnull "$at_stdout" || at_failed=:
9089at_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.
9096if 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"
9105at_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>&-
9108at_status=$? at_failed=false
9109$at_check_filter
9110echo stderr:; tee stderr <"$at_stderr"
9111$at_diff expout "$at_stdout" || at_failed=:
9112at_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'
9120input.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"
9150at_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>&-
9154at_status=$? at_failed=false
9155$at_check_filter
9156$at_diff experr "$at_stderr" || at_failed=:
9157at_fn_diff_devnull "$at_stdout" || at_failed=:
9158at_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"
9167at_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>&-
9170at_status=$? at_failed=false
9171$at_check_filter
9172$at_diff experr "$at_stderr" || at_failed=:
9173$at_diff expout "$at_stdout" || at_failed=:
9174at_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"
9184at_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>&-
9187at_status=$? at_failed=false
9188$at_check_filter
9189at_fn_diff_devnull "$at_stderr" || at_failed=:
9190$at_diff expout "$at_stdout" || at_failed=:
9191at_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"
9197at_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>&-
9200at_status=$? at_failed=false
9201$at_check_filter
9202at_fn_diff_devnull "$at_stderr" || at_failed=:
9203$at_diff expout "$at_stdout" || at_failed=:
9204at_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
9210fi
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"
9216at_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>&-
9219at_status=$? at_failed=false
9220$at_check_filter
9221echo stderr:; tee stderr <"$at_stderr"
9222at_fn_diff_devnull "$at_stdout" || at_failed=:
9223at_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"
9230at_fn_check_prepare_trace "input.at:1491"
9231( $at_check_trace; sed 's/^.*bison:/bison:/' stderr
9232) >>"$at_stdout" 2>>"$at_stderr" 5>&-
9233at_status=$? at_failed=false
9234$at_check_filter
9235at_fn_diff_devnull "$at_stderr" || at_failed=:
9236echo >>"$at_stdout"; $as_echo "bison: warnings being treated as errors
9237input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
9238" | \
9239  $at_diff - "$at_stdout" || at_failed=:
9240at_fn_check_status 0 $at_status "$at_srcdir/input.at:1491"
9241$at_failed && at_fn_log_failure
9242$at_traceon; }
9243
9244mv 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"
9248at_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>&-
9251at_status=$? at_failed=false
9252$at_check_filter
9253$at_diff experr "$at_stderr" || at_failed=:
9254at_fn_diff_devnull "$at_stdout" || at_failed=:
9255at_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
9264read at_status <"$at_status_file"
9265#AT_STOP_35
9266#AT_START_36
9267at_fn_group_banner 36 'input.at:1505' \
9268  "%name-prefix and %define api.prefix are incompatible" "" 1
9269at_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
9279cat >input.y <<'_ATEOF'
9280%define api.prefix foo %name-prefix "bar"
9281%%
9282exp:;
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"
9288at_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>&-
9291at_status=$? at_failed=false
9292$at_check_filter
9293echo >>"$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=:
9296at_fn_diff_devnull "$at_stdout" || at_failed=:
9297at_fn_check_status 1 $at_status "$at_srcdir/input.at:1520"
9298$at_failed && at_fn_log_failure
9299$at_traceon; }
9300
9301
9302
9303cat >input.y <<'_ATEOF'
9304
9305%%
9306exp:;
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"
9312at_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>&-
9315at_status=$? at_failed=false
9316$at_check_filter
9317echo >>"$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=:
9320at_fn_diff_devnull "$at_stdout" || at_failed=:
9321at_fn_check_status 1 $at_status "$at_srcdir/input.at:1521"
9322$at_failed && at_fn_log_failure
9323$at_traceon; }
9324
9325
9326
9327cat >input.y <<'_ATEOF'
9328%name-prefix "bar"
9329%%
9330exp:;
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"
9336at_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>&-
9339at_status=$? at_failed=false
9340$at_check_filter
9341echo >>"$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=:
9344at_fn_diff_devnull "$at_stdout" || at_failed=:
9345at_fn_check_status 1 $at_status "$at_srcdir/input.at:1522"
9346$at_failed && at_fn_log_failure
9347$at_traceon; }
9348
9349
9350
9351cat >input.y <<'_ATEOF'
9352%define api.prefix foo
9353%%
9354exp:;
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"
9360at_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>&-
9363at_status=$? at_failed=false
9364$at_check_filter
9365echo >>"$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=:
9368at_fn_diff_devnull "$at_stdout" || at_failed=:
9369at_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
9381read at_status <"$at_status_file"
9382#AT_STOP_36
9383#AT_START_37
9384at_fn_group_banner 37 'input.at:1534' \
9385  "Stray \$ or @" "                                   " 1
9386at_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
9395cat >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%%
9409exp: TOK        { $%; @%; $$ = $1; };
9410_ATEOF
9411
9412
9413
9414if 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"
9422at_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>&-
9426at_status=$? at_failed=false
9427$at_check_filter
9428echo stderr:; cat "$at_stderr"
9429echo stdout:; cat "$at_stdout"
9430at_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"
9436at_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>&-
9439at_status=$? at_failed=false
9440$at_check_filter
9441echo stderr:; cat "$at_stderr"
9442echo stdout:; cat "$at_stdout"
9443at_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"
9452at_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>&-
9457at_status=$? at_failed=false
9458$at_check_filter
9459at_fn_diff_devnull "$at_stderr" || at_failed=:
9460$at_diff expout "$at_stdout" || at_failed=:
9461at_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"
9470at_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>&-
9475at_status=$? at_failed=false
9476$at_check_filter
9477at_fn_diff_devnull "$at_stderr" || at_failed=:
9478$at_diff expout "$at_stdout" || at_failed=:
9479at_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
9485fi
9486{ set +x
9487$as_echo "$at_srcdir/input.at:1548: bison input.y"
9488at_fn_check_prepare_trace "input.at:1548"
9489( $at_check_trace; bison input.y
9490) >>"$at_stdout" 2>>"$at_stderr" 5>&-
9491at_status=$? at_failed=false
9492$at_check_filter
9493echo >>"$at_stderr"; $as_echo "input.y:10.19: warning: stray '\$'
9494input.y:10.23: warning: stray '@'
9495input.y:11.19: warning: stray '\$'
9496input.y:11.23: warning: stray '@'
9497input.y:12.19: warning: stray '\$'
9498input.y:12.23: warning: stray '@'
9499input.y:14.19: warning: stray '\$'
9500input.y:14.23: warning: stray '@'
9501" | \
9502  $at_diff - "$at_stderr" || at_failed=:
9503at_fn_diff_devnull "$at_stdout" || at_failed=:
9504at_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.
9511if 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"
9520at_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>&-
9523at_status=$? at_failed=false
9524$at_check_filter
9525echo stderr:; tee stderr <"$at_stderr"
9526$at_diff expout "$at_stdout" || at_failed=:
9527at_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'
9535input.y:10.19: warning: stray '$'
9536input.y:10.23: warning: stray '@'
9537input.y:11.19: warning: stray '$'
9538input.y:11.23: warning: stray '@'
9539input.y:12.19: warning: stray '$'
9540input.y:12.23: warning: stray '@'
9541input.y:14.19: warning: stray '$'
9542input.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"
9572at_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>&-
9576at_status=$? at_failed=false
9577$at_check_filter
9578$at_diff experr "$at_stderr" || at_failed=:
9579at_fn_diff_devnull "$at_stdout" || at_failed=:
9580at_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"
9589at_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>&-
9592at_status=$? at_failed=false
9593$at_check_filter
9594$at_diff experr "$at_stderr" || at_failed=:
9595$at_diff expout "$at_stdout" || at_failed=:
9596at_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"
9606at_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>&-
9609at_status=$? at_failed=false
9610$at_check_filter
9611at_fn_diff_devnull "$at_stderr" || at_failed=:
9612$at_diff expout "$at_stdout" || at_failed=:
9613at_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"
9619at_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>&-
9622at_status=$? at_failed=false
9623$at_check_filter
9624at_fn_diff_devnull "$at_stderr" || at_failed=:
9625$at_diff expout "$at_stdout" || at_failed=:
9626at_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
9632fi
9633
9634  set +x
9635  $at_times_p && times >"$at_times_file"
9636) 5>&1 2>&1 7>&- | eval $at_tee_pipe
9637read at_status <"$at_status_file"
9638#AT_STOP_37
9639#AT_START_38
9640at_fn_group_banner 38 'input.at:1568' \
9641  "Code injection" "                                 " 1
9642at_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
9655cat >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%%
9677exp:
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.
9692if 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"
9700at_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>&-
9704at_status=$? at_failed=false
9705$at_check_filter
9706echo stderr:; cat "$at_stderr"
9707echo stdout:; cat "$at_stdout"
9708at_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"
9714at_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>&-
9717at_status=$? at_failed=false
9718$at_check_filter
9719echo stderr:; cat "$at_stderr"
9720echo stdout:; cat "$at_stdout"
9721at_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"
9730at_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>&-
9735at_status=$? at_failed=false
9736$at_check_filter
9737at_fn_diff_devnull "$at_stderr" || at_failed=:
9738$at_diff expout "$at_stdout" || at_failed=:
9739at_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"
9748at_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>&-
9753at_status=$? at_failed=false
9754$at_check_filter
9755at_fn_diff_devnull "$at_stderr" || at_failed=:
9756$at_diff expout "$at_stdout" || at_failed=:
9757at_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
9763fi
9764{ set +x
9765$as_echo "$at_srcdir/input.at:1619: bison -d               input.y"
9766at_fn_check_prepare_trace "input.at:1619"
9767( $at_check_trace; bison -d               input.y
9768) >>"$at_stdout" 2>>"$at_stderr" 5>&-
9769at_status=$? at_failed=false
9770$at_check_filter
9771at_fn_diff_devnull "$at_stderr" || at_failed=:
9772at_fn_diff_devnull "$at_stdout" || at_failed=:
9773at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
9774$at_failed && at_fn_log_failure
9775$at_traceon; }
9776
9777
9778if 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"
9786at_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>&-
9790at_status=$? at_failed=false
9791$at_check_filter
9792echo stderr:; cat "$at_stderr"
9793echo stdout:; cat "$at_stdout"
9794at_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"
9800at_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>&-
9803at_status=$? at_failed=false
9804$at_check_filter
9805echo stderr:; cat "$at_stderr"
9806echo stdout:; cat "$at_stdout"
9807at_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"
9816at_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>&-
9821at_status=$? at_failed=false
9822$at_check_filter
9823at_fn_diff_devnull "$at_stderr" || at_failed=:
9824$at_diff expout "$at_stdout" || at_failed=:
9825at_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"
9834at_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>&-
9839at_status=$? at_failed=false
9840$at_check_filter
9841at_fn_diff_devnull "$at_stderr" || at_failed=:
9842$at_diff expout "$at_stdout" || at_failed=:
9843at_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
9849fi
9850{ set +x
9851$as_echo "$at_srcdir/input.at:1619: bison -d -S glr.c      input.y"
9852at_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>&-
9855at_status=$? at_failed=false
9856$at_check_filter
9857at_fn_diff_devnull "$at_stderr" || at_failed=:
9858at_fn_diff_devnull "$at_stdout" || at_failed=:
9859at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
9860$at_failed && at_fn_log_failure
9861$at_traceon; }
9862
9863
9864if 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"
9872at_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>&-
9876at_status=$? at_failed=false
9877$at_check_filter
9878echo stderr:; cat "$at_stderr"
9879echo stdout:; cat "$at_stdout"
9880at_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"
9886at_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>&-
9889at_status=$? at_failed=false
9890$at_check_filter
9891echo stderr:; cat "$at_stderr"
9892echo stdout:; cat "$at_stdout"
9893at_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"
9902at_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>&-
9907at_status=$? at_failed=false
9908$at_check_filter
9909at_fn_diff_devnull "$at_stderr" || at_failed=:
9910$at_diff expout "$at_stdout" || at_failed=:
9911at_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"
9920at_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>&-
9925at_status=$? at_failed=false
9926$at_check_filter
9927at_fn_diff_devnull "$at_stderr" || at_failed=:
9928$at_diff expout "$at_stdout" || at_failed=:
9929at_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
9935fi
9936{ set +x
9937$as_echo "$at_srcdir/input.at:1619: bison -d -S lalr1.cc   input.y"
9938at_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>&-
9941at_status=$? at_failed=false
9942$at_check_filter
9943at_fn_diff_devnull "$at_stderr" || at_failed=:
9944at_fn_diff_devnull "$at_stdout" || at_failed=:
9945at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
9946$at_failed && at_fn_log_failure
9947$at_traceon; }
9948
9949
9950if 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"
9958at_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>&-
9962at_status=$? at_failed=false
9963$at_check_filter
9964echo stderr:; cat "$at_stderr"
9965echo stdout:; cat "$at_stdout"
9966at_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"
9972at_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>&-
9975at_status=$? at_failed=false
9976$at_check_filter
9977echo stderr:; cat "$at_stderr"
9978echo stdout:; cat "$at_stdout"
9979at_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"
9988at_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>&-
9993at_status=$? at_failed=false
9994$at_check_filter
9995at_fn_diff_devnull "$at_stderr" || at_failed=:
9996$at_diff expout "$at_stdout" || at_failed=:
9997at_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"
10006at_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>&-
10011at_status=$? at_failed=false
10012$at_check_filter
10013at_fn_diff_devnull "$at_stderr" || at_failed=:
10014$at_diff expout "$at_stdout" || at_failed=:
10015at_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
10021fi
10022{ set +x
10023$as_echo "$at_srcdir/input.at:1619: bison -d -S glr.cc     input.y"
10024at_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>&-
10027at_status=$? at_failed=false
10028$at_check_filter
10029at_fn_diff_devnull "$at_stderr" || at_failed=:
10030at_fn_diff_devnull "$at_stdout" || at_failed=:
10031at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
10032$at_failed && at_fn_log_failure
10033$at_traceon; }
10034
10035
10036if 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"
10044at_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>&-
10048at_status=$? at_failed=false
10049$at_check_filter
10050echo stderr:; cat "$at_stderr"
10051echo stdout:; cat "$at_stdout"
10052at_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"
10058at_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>&-
10061at_status=$? at_failed=false
10062$at_check_filter
10063echo stderr:; cat "$at_stderr"
10064echo stdout:; cat "$at_stdout"
10065at_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"
10074at_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>&-
10079at_status=$? at_failed=false
10080$at_check_filter
10081at_fn_diff_devnull "$at_stderr" || at_failed=:
10082$at_diff expout "$at_stdout" || at_failed=:
10083at_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"
10092at_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>&-
10097at_status=$? at_failed=false
10098$at_check_filter
10099at_fn_diff_devnull "$at_stderr" || at_failed=:
10100$at_diff expout "$at_stdout" || at_failed=:
10101at_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
10107fi
10108{ set +x
10109$as_echo "$at_srcdir/input.at:1619: bison    -S lalr1.java input.y"
10110at_fn_check_prepare_trace "input.at:1619"
10111( $at_check_trace; bison    -S lalr1.java input.y
10112) >>"$at_stdout" 2>>"$at_stderr" 5>&-
10113at_status=$? at_failed=false
10114$at_check_filter
10115at_fn_diff_devnull "$at_stderr" || at_failed=:
10116at_fn_diff_devnull "$at_stdout" || at_failed=:
10117at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
10118$at_failed && at_fn_log_failure
10119$at_traceon; }
10120
10121
10122
10123cat >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%%
10145exp:
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.
10160if 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"
10168at_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>&-
10172at_status=$? at_failed=false
10173$at_check_filter
10174echo stderr:; cat "$at_stderr"
10175echo stdout:; cat "$at_stdout"
10176at_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"
10182at_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>&-
10185at_status=$? at_failed=false
10186$at_check_filter
10187echo stderr:; cat "$at_stderr"
10188echo stdout:; cat "$at_stdout"
10189at_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"
10198at_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>&-
10203at_status=$? at_failed=false
10204$at_check_filter
10205at_fn_diff_devnull "$at_stderr" || at_failed=:
10206$at_diff expout "$at_stdout" || at_failed=:
10207at_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"
10216at_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>&-
10221at_status=$? at_failed=false
10222$at_check_filter
10223at_fn_diff_devnull "$at_stderr" || at_failed=:
10224$at_diff expout "$at_stdout" || at_failed=:
10225at_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
10231fi
10232{ set +x
10233$as_echo "$at_srcdir/input.at:1620: bison -d               input.y"
10234at_fn_check_prepare_trace "input.at:1620"
10235( $at_check_trace; bison -d               input.y
10236) >>"$at_stdout" 2>>"$at_stderr" 5>&-
10237at_status=$? at_failed=false
10238$at_check_filter
10239at_fn_diff_devnull "$at_stderr" || at_failed=:
10240at_fn_diff_devnull "$at_stdout" || at_failed=:
10241at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
10242$at_failed && at_fn_log_failure
10243$at_traceon; }
10244
10245
10246if 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"
10254at_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>&-
10258at_status=$? at_failed=false
10259$at_check_filter
10260echo stderr:; cat "$at_stderr"
10261echo stdout:; cat "$at_stdout"
10262at_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"
10268at_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>&-
10271at_status=$? at_failed=false
10272$at_check_filter
10273echo stderr:; cat "$at_stderr"
10274echo stdout:; cat "$at_stdout"
10275at_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"
10284at_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>&-
10289at_status=$? at_failed=false
10290$at_check_filter
10291at_fn_diff_devnull "$at_stderr" || at_failed=:
10292$at_diff expout "$at_stdout" || at_failed=:
10293at_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"
10302at_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>&-
10307at_status=$? at_failed=false
10308$at_check_filter
10309at_fn_diff_devnull "$at_stderr" || at_failed=:
10310$at_diff expout "$at_stdout" || at_failed=:
10311at_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
10317fi
10318{ set +x
10319$as_echo "$at_srcdir/input.at:1620: bison -d -S glr.c      input.y"
10320at_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>&-
10323at_status=$? at_failed=false
10324$at_check_filter
10325at_fn_diff_devnull "$at_stderr" || at_failed=:
10326at_fn_diff_devnull "$at_stdout" || at_failed=:
10327at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
10328$at_failed && at_fn_log_failure
10329$at_traceon; }
10330
10331
10332if 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"
10340at_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>&-
10344at_status=$? at_failed=false
10345$at_check_filter
10346echo stderr:; cat "$at_stderr"
10347echo stdout:; cat "$at_stdout"
10348at_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"
10354at_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>&-
10357at_status=$? at_failed=false
10358$at_check_filter
10359echo stderr:; cat "$at_stderr"
10360echo stdout:; cat "$at_stdout"
10361at_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"
10370at_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>&-
10375at_status=$? at_failed=false
10376$at_check_filter
10377at_fn_diff_devnull "$at_stderr" || at_failed=:
10378$at_diff expout "$at_stdout" || at_failed=:
10379at_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"
10388at_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>&-
10393at_status=$? at_failed=false
10394$at_check_filter
10395at_fn_diff_devnull "$at_stderr" || at_failed=:
10396$at_diff expout "$at_stdout" || at_failed=:
10397at_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
10403fi
10404{ set +x
10405$as_echo "$at_srcdir/input.at:1620: bison -d -S lalr1.cc   input.y"
10406at_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>&-
10409at_status=$? at_failed=false
10410$at_check_filter
10411at_fn_diff_devnull "$at_stderr" || at_failed=:
10412at_fn_diff_devnull "$at_stdout" || at_failed=:
10413at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
10414$at_failed && at_fn_log_failure
10415$at_traceon; }
10416
10417
10418if 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"
10426at_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>&-
10430at_status=$? at_failed=false
10431$at_check_filter
10432echo stderr:; cat "$at_stderr"
10433echo stdout:; cat "$at_stdout"
10434at_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"
10440at_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>&-
10443at_status=$? at_failed=false
10444$at_check_filter
10445echo stderr:; cat "$at_stderr"
10446echo stdout:; cat "$at_stdout"
10447at_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"
10456at_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>&-
10461at_status=$? at_failed=false
10462$at_check_filter
10463at_fn_diff_devnull "$at_stderr" || at_failed=:
10464$at_diff expout "$at_stdout" || at_failed=:
10465at_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"
10474at_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>&-
10479at_status=$? at_failed=false
10480$at_check_filter
10481at_fn_diff_devnull "$at_stderr" || at_failed=:
10482$at_diff expout "$at_stdout" || at_failed=:
10483at_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
10489fi
10490{ set +x
10491$as_echo "$at_srcdir/input.at:1620: bison -d -S glr.cc     input.y"
10492at_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>&-
10495at_status=$? at_failed=false
10496$at_check_filter
10497at_fn_diff_devnull "$at_stderr" || at_failed=:
10498at_fn_diff_devnull "$at_stdout" || at_failed=:
10499at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
10500$at_failed && at_fn_log_failure
10501$at_traceon; }
10502
10503
10504if 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"
10512at_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>&-
10516at_status=$? at_failed=false
10517$at_check_filter
10518echo stderr:; cat "$at_stderr"
10519echo stdout:; cat "$at_stdout"
10520at_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"
10526at_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>&-
10529at_status=$? at_failed=false
10530$at_check_filter
10531echo stderr:; cat "$at_stderr"
10532echo stdout:; cat "$at_stdout"
10533at_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"
10542at_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>&-
10547at_status=$? at_failed=false
10548$at_check_filter
10549at_fn_diff_devnull "$at_stderr" || at_failed=:
10550$at_diff expout "$at_stdout" || at_failed=:
10551at_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"
10560at_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>&-
10565at_status=$? at_failed=false
10566$at_check_filter
10567at_fn_diff_devnull "$at_stderr" || at_failed=:
10568$at_diff expout "$at_stdout" || at_failed=:
10569at_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
10575fi
10576{ set +x
10577$as_echo "$at_srcdir/input.at:1620: bison    -S lalr1.java input.y"
10578at_fn_check_prepare_trace "input.at:1620"
10579( $at_check_trace; bison    -S lalr1.java input.y
10580) >>"$at_stdout" 2>>"$at_stderr" 5>&-
10581at_status=$? at_failed=false
10582$at_check_filter
10583at_fn_diff_devnull "$at_stderr" || at_failed=:
10584at_fn_diff_devnull "$at_stdout" || at_failed=:
10585at_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
10597read at_status <"$at_status_file"
10598#AT_STOP_38
10599#AT_START_39
10600at_fn_group_banner 39 'named-refs.at:21' \
10601  "Tutorial calculator" "                            " 2
10602at_xfail=no
10603(
10604  $as_echo "39. $at_setup_line: testing $at_desc ..."
10605  $at_traceon
10606
10607
10608cat >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>
10624typedef int semantic_value;
10625FILE *input;
10626static semantic_value global_result = 0;
10627static int global_count = 0;
10628static int power (int base, int exponent);
10629static void yyerror ( const char *msg);
10630static 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%%
10649input:
10650  line
10651| input line         {}
10652;
10653
10654line:
10655  '\n'
10656| exp '\n'           {}
10657;
10658
10659exp:
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.  */
10681static
10682void yyerror ( const char *msg)
10683{
10684  fprintf (stderr, "%s\n", msg);
10685}
10686static int get_char (void)
10687{
10688  int res = getc (input);
10689  return res;
10690}
10691
10692static void unget_char (int c)
10693{
10694  ungetc (c, input);
10695}
10696
10697static 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
10716static int
10717yylex (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
10739static 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
10748int 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
10772cat >input.txt <<'_ATEOF'
10773
107741 + 2 * 3 = 7
107751 + 2 * -3 = -5
10776-1^2 = -1
10777(-1)^2 = 1
10778---1 = -1
107791 - 2 - 3 = -4
107801 - (2 - 3) = 2
107812^2^3 = 256
10782(2^2)^3 = 64
10783_ATEOF
10784
10785
10786if 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"
10794at_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>&-
10798at_status=$? at_failed=false
10799$at_check_filter
10800echo stderr:; cat "$at_stderr"
10801echo stdout:; cat "$at_stdout"
10802at_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"
10808at_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>&-
10811at_status=$? at_failed=false
10812$at_check_filter
10813echo stderr:; cat "$at_stderr"
10814echo stdout:; cat "$at_stdout"
10815at_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"
10824at_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>&-
10829at_status=$? at_failed=false
10830$at_check_filter
10831at_fn_diff_devnull "$at_stderr" || at_failed=:
10832$at_diff expout "$at_stdout" || at_failed=:
10833at_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"
10842at_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>&-
10847at_status=$? at_failed=false
10848$at_check_filter
10849at_fn_diff_devnull "$at_stderr" || at_failed=:
10850$at_diff expout "$at_stdout" || at_failed=:
10851at_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
10857fi
10858{ set +x
10859$as_echo "$at_srcdir/named-refs.at:184: bison -o test.c test.y"
10860at_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>&-
10863at_status=$? at_failed=false
10864$at_check_filter
10865at_fn_diff_devnull "$at_stderr" || at_failed=:
10866at_fn_diff_devnull "$at_stdout" || at_failed=:
10867at_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"
10874at_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>&-
10877at_status=$? at_failed=false
10878$at_check_filter
10879echo stderr:; cat "$at_stderr"
10880echo stdout:; cat "$at_stdout"
10881at_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"
10887at_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>&-
10890at_status=$? at_failed=false
10891$at_check_filter
10892echo stderr:; cat "$at_stderr"
10893echo stdout:; cat "$at_stdout"
10894at_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"
10900at_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>&-
10903at_status=$? at_failed=false
10904$at_check_filter
10905echo stderr:; tee stderr <"$at_stderr"
10906at_fn_diff_devnull "$at_stdout" || at_failed=:
10907at_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"
10913at_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>&-
10916at_status=$? at_failed=false
10917$at_check_filter
10918echo stderr:; tee stderr <"$at_stderr"
10919at_fn_diff_devnull "$at_stdout" || at_failed=:
10920at_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
10929read at_status <"$at_status_file"
10930#AT_STOP_39
10931#AT_START_40
10932at_fn_group_banner 40 'named-refs.at:195' \
10933  "Undefined and ambiguous references" "             " 2
10934at_xfail=no
10935(
10936  $as_echo "40. $at_setup_line: testing $at_desc ..."
10937  $at_traceon
10938
10939
10940cat >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%{
10951static int power (int base, int exponent);
10952static void yyerror ( const char *msg);
10953static 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%%
10972input:
10973  line
10974| input line         {}
10975;
10976
10977line:
10978  '\n'
10979| exp '\n'           {}
10980;
10981
10982exp:
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"
11009at_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>&-
11012at_status=$? at_failed=false
11013$at_check_filter
11014echo >>"$at_stderr"; $as_echo "test.y:50.51-60: error: invalid reference: '\$<ival>lo9'
11015test.y:50.3-68:      symbol not found in production: lo9
11016test.y:51.51-60: warning: misleading reference: '\$<ival>exp'
11017test.y:42.1-3:       refers to: \$exp at \$\$
11018test.y:51.7:         possibly meant: \$x, hiding \$exp at \$1
11019test.y:51.41:        possibly meant: \$r, hiding \$exp at \$4
11020test.y:52.51-52: error: \$l of 'exp' has no declared type
11021test.y:55.40-43: error: invalid reference: '\$r12'
11022test.y:55.3-47:      symbol not found in production: r12
11023test.y:56.29-33: error: invalid reference: '\$expo'
11024test.y:56.3-46:      symbol not found in production: expo
11025" | \
11026  $at_diff - "$at_stderr" || at_failed=:
11027at_fn_diff_devnull "$at_stdout" || at_failed=:
11028at_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
11037read at_status <"$at_status_file"
11038#AT_STOP_40
11039#AT_START_41
11040at_fn_group_banner 41 'named-refs.at:271' \
11041  "Misleading references" "                          " 2
11042at_xfail=no
11043(
11044  $as_echo "41. $at_setup_line: testing $at_desc ..."
11045  $at_traceon
11046
11047cat >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%%
11058start: foo foo.bar { $foo.bar; }
11059foo: '1'
11060foo.bar: '2'
11061_ATEOF
11062
11063
11064if 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"
11072at_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>&-
11076at_status=$? at_failed=false
11077$at_check_filter
11078echo stderr:; cat "$at_stderr"
11079echo stdout:; cat "$at_stdout"
11080at_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"
11086at_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>&-
11089at_status=$? at_failed=false
11090$at_check_filter
11091echo stderr:; cat "$at_stderr"
11092echo stdout:; cat "$at_stdout"
11093at_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"
11102at_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>&-
11107at_status=$? at_failed=false
11108$at_check_filter
11109at_fn_diff_devnull "$at_stderr" || at_failed=:
11110$at_diff expout "$at_stdout" || at_failed=:
11111at_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"
11120at_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>&-
11125at_status=$? at_failed=false
11126$at_check_filter
11127at_fn_diff_devnull "$at_stderr" || at_failed=:
11128$at_diff expout "$at_stdout" || at_failed=:
11129at_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
11135fi
11136{ set +x
11137$as_echo "$at_srcdir/named-refs.at:279: bison -o test.c test.y"
11138at_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>&-
11141at_status=$? at_failed=false
11142$at_check_filter
11143echo >>"$at_stderr"; $as_echo "test.y:11.22-29: warning: misleading reference: '\$foo.bar'
11144test.y:11.8-10:      refers to: \$foo at \$1
11145test.y:11.12-18:     possibly meant: \$[foo.bar] at \$2
11146" | \
11147  $at_diff - "$at_stderr" || at_failed=:
11148at_fn_diff_devnull "$at_stdout" || at_failed=:
11149at_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.
11156if 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"
11165at_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>&-
11168at_status=$? at_failed=false
11169$at_check_filter
11170echo stderr:; tee stderr <"$at_stderr"
11171$at_diff expout "$at_stdout" || at_failed=:
11172at_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'
11180test.y:11.22-29: warning: misleading reference: '$foo.bar'
11181test.y:11.8-10:      refers to: $foo at $1
11182test.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"
11212at_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>&-
11216at_status=$? at_failed=false
11217$at_check_filter
11218$at_diff experr "$at_stderr" || at_failed=:
11219at_fn_diff_devnull "$at_stdout" || at_failed=:
11220at_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"
11229at_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>&-
11232at_status=$? at_failed=false
11233$at_check_filter
11234$at_diff experr "$at_stderr" || at_failed=:
11235$at_diff expout "$at_stdout" || at_failed=:
11236at_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"
11246at_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>&-
11249at_status=$? at_failed=false
11250$at_check_filter
11251at_fn_diff_devnull "$at_stderr" || at_failed=:
11252$at_diff expout "$at_stdout" || at_failed=:
11253at_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"
11259at_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>&-
11262at_status=$? at_failed=false
11263$at_check_filter
11264at_fn_diff_devnull "$at_stderr" || at_failed=:
11265$at_diff expout "$at_stdout" || at_failed=:
11266at_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
11272fi
11273  set +x
11274  $at_times_p && times >"$at_times_file"
11275) 5>&1 2>&1 7>&- | eval $at_tee_pipe
11276read at_status <"$at_status_file"
11277#AT_STOP_41
11278#AT_START_42
11279at_fn_group_banner 42 'named-refs.at:288' \
11280  "Many kinds of errors" "                           " 2
11281at_xfail=no
11282(
11283  $as_echo "42. $at_setup_line: testing $at_desc ..."
11284  $at_traceon
11285
11286cat >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%%
11309if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
11310          { $if_stmt1 = new IfStmt($cond1, $then.f1, $else); };
11311if_stmt2: IF expr[cond] THEN stmt[then] FI
11312          { $if_stmt2 = new IfStmt($cond, $stmt.field, 0); };
11313if_stmt3: IF expr[cond] THEN stmt.list FI
11314          { $if_stmt3 = new IfStmt($cond, $stmt.list, 0); };
11315if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
11316          { $if_stmt4 = new IfStmt($cond, $xyz, $cond); };
11317if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
11318          { $if_stmt5 = new IfStmt($cond, $stmt.list, $else); };
11319if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
11320          { $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); };
11321if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
11322          { $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); };
11323if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
11324          { $if_stmt8 = new IfStmt($cond, $then.1, $else); };
11325if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
11326          { $if_stmt9 = new IfStmt($cond, $then.1.field, $else); };
11327if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
11328          { $if_stmt10 = new IfStmt($cond, $stmt.x, 0); };
11329if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
11330          { $if-stmt-a = new IfStmt($cond, $then, $else); };
11331if-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); };
11333program: stmt.list;
11334stmt.list:  stmt ';' stmt.list { $3->insert($stmt); $$ = $3; }
11335        |   stmt ';' { SL = new StmtList();  SL->insert($1); $$ = SL; }
11336        ;
11337stmt:  assign_stmt { $$ = $1; }
11338    |  if_stmt { $$ = $1; }
11339    |  if_stmt1 { $$ = $1; }
11340    |  while_stmt { $$ = $1; }
11341    ;
11342assign_stmt: IDENT ASSIGNOP expr
11343       { $$ = new AssignStmt(string($1),$3); };
11344if_stmt: IF expr[cond] THEN stmt.list FI
11345       { $if_stmt = new IfStmt($cond, $[stmt.list], 0); };
11346while_stmt[res]: WHILE expr DO stmt.list OD
11347       { $res = new WhileStmt($[expr], $[stmt.list]); };
11348expr: expr '+' term   { $$ = new Plus($1,$3); }
11349    | expr '-' term   { $$ = new Minus($1,$3); }
11350    | term            { $$ = $1; }
11351    ;
11352term: term '*' factor   { $$ = new Times($1,$3); }
11353    | factor            { $$ = $1; }
11354    ;
11355factor:     '(' 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"
11365at_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>&-
11368at_status=$? at_failed=false
11369$at_check_filter
11370echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
11371test.y:23.11-24.62:  symbol not found in production: cond1
11372test.y:26.43-53: error: invalid reference: '\$stmt.field'
11373test.y:25.11-26.60:  symbol not found in production: stmt
11374test.y:25.35-38:     possibly meant: \$then.field, hiding \$stmt.field at \$4
11375test.y:28.43-52: error: invalid reference: '\$stmt.list'
11376test.y:27.11-28.59:  symbol not found in production: stmt
11377test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
11378test.y:30.43-46: error: ambiguous reference: '\$xyz'
11379test.y:29.35-37:     refers to: \$xyz at \$4
11380test.y:29.50-52:     refers to: \$xyz at \$6
11381test.y:32.43-52: error: invalid reference: '\$stmt.list'
11382test.y:31.11-32.63:  symbol not found in production: stmt
11383test.y:31.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
11384test.y:31.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
11385test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
11386test.y:33.11-34.69:  symbol not found in production: stmt
11387test.y:33.40-43:     possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
11388test.y:33.61-64:     possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
11389test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
11390test.y:35.11-36.71:  symbol not found in production: stmt.list
11391test.y:35.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
11392test.y:35.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
11393test.y:38.43-49: error: invalid reference: '\$then.1'
11394test.y:37.11-38.60:  symbol not found in production: then
11395test.y:37.40-45:     possibly meant: \$[then.1] at \$4
11396test.y:40.43-55: error: invalid reference: '\$then.1.field'
11397test.y:39.11-40.66:  symbol not found in production: then
11398test.y:39.40-45:     possibly meant: \$[then.1].field at \$4
11399test.y:42.44-50: error: invalid reference: '\$stmt.x'
11400test.y:41.12-42.57:  symbol not found in production: stmt
11401test.y:41.36-41:     possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
11402test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
11403test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
11404test.y:43.12-44.59:  symbol not found in production: if
11405test.y:43.1-9:       possibly meant: \$[if-stmt-a] at \$\$
11406test.y:46.46-54: error: invalid reference: '\$then-a.f'
11407test.y:45.12-46.65:  symbol not found in production: then
11408test.y:45.41-46:     possibly meant: \$[then-a].f at \$4
11409" | \
11410  $at_diff - "$at_stderr" || at_failed=:
11411at_fn_diff_devnull "$at_stdout" || at_failed=:
11412at_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"
11421at_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>&-
11424at_status=$? at_failed=false
11425$at_check_filter
11426echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
11427           { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); };
11428                                    ^^^^^^
11429test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11432test.y:26.43-53: error: invalid reference: '\$stmt.field'
11433           { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); };
11434                                           ^^^^^^^^^^^
11435test.y:25.11-26.60:  symbol not found in production: stmt
11436 if_stmt2: IF expr[cond] THEN stmt[then] FI
11437           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11438test.y:25.35-38:     possibly meant: \$then.field, hiding \$stmt.field at \$4
11439 if_stmt2: IF expr[cond] THEN stmt[then] FI
11440                                   ^^^^
11441test.y:28.43-52: error: invalid reference: '\$stmt.list'
11442           { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); };
11443                                           ^^^^^^^^^^
11444test.y:27.11-28.59:  symbol not found in production: stmt
11445 if_stmt3: IF expr[cond] THEN stmt.list FI
11446           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11447test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
11448 if_stmt3: IF expr[cond] THEN stmt.list FI
11449                              ^^^^^^^^^
11450test.y:30.43-46: error: ambiguous reference: '\$xyz'
11451           { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); };
11452                                           ^^^^
11453test.y:29.35-37:     refers to: \$xyz at \$4
11454 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
11455                                   ^^^
11456test.y:29.50-52:     refers to: \$xyz at \$6
11457 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
11458                                                  ^^^
11459test.y:32.43-52: error: invalid reference: '\$stmt.list'
11460           { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); };
11461                                           ^^^^^^^^^^
11462test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11465test.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                                        ^^^^
11468test.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                                                             ^^^^
11471test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
11472           { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); };
11473                                           ^^^^^^^^^^^^^^^^
11474test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11477test.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                                        ^^^^
11480test.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                                                             ^^^^
11483test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
11484           { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); };
11485                                           ^^^^^^^^^^^^
11486test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11489test.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                                        ^^^^
11492test.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                                                             ^^^^
11495test.y:38.43-49: error: invalid reference: '\$then.1'
11496           { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); };
11497                                           ^^^^^^^
11498test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11501test.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                                        ^^^^^^
11504test.y:40.43-55: error: invalid reference: '\$then.1.field'
11505           { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); };
11506                                           ^^^^^^^^^^^^^
11507test.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           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11510test.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                                        ^^^^^^
11513test.y:42.44-50: error: invalid reference: '\$stmt.x'
11514           { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); };
11515                                            ^^^^^^^
11516test.y:41.12-42.57:  symbol not found in production: stmt
11517 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
11518            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11519test.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                                    ^^^^^^
11522test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
11523 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
11524                                    ^^^^^^
11525test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
11526           { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); };
11527             ^^^^^^^^^^
11528test.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            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11531test.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 ^^^^^^^^^
11534test.y:46.46-54: error: invalid reference: '\$then-a.f'
11535           { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); };
11536                                              ^^^^^^^^^
11537test.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            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11540test.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=:
11545at_fn_diff_devnull "$at_stdout" || at_failed=:
11546at_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
11555read at_status <"$at_status_file"
11556#AT_STOP_42
11557#AT_START_43
11558at_fn_group_banner 43 'named-refs.at:521' \
11559  "Missing identifiers in brackets" "                " 2
11560at_xfail=no
11561(
11562  $as_echo "43. $at_setup_line: testing $at_desc ..."
11563  $at_traceon
11564
11565cat >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%%
11576start: 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"
11584at_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>&-
11587at_status=$? at_failed=false
11588$at_check_filter
11589echo >>"$at_stderr"; $as_echo "test.y:11.12: error: an identifier expected
11590" | \
11591  $at_diff - "$at_stderr" || at_failed=:
11592at_fn_diff_devnull "$at_stdout" || at_failed=:
11593at_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
11601read at_status <"$at_status_file"
11602#AT_STOP_43
11603#AT_START_44
11604at_fn_group_banner 44 'named-refs.at:535' \
11605  "Redundant words in brackets" "                    " 2
11606at_xfail=no
11607(
11608  $as_echo "44. $at_setup_line: testing $at_desc ..."
11609  $at_traceon
11610
11611cat >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%%
11622start: 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"
11630at_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>&-
11633at_status=$? at_failed=false
11634$at_check_filter
11635echo >>"$at_stderr"; $as_echo "test.y:11.15: error: unexpected identifier in bracketed name: 'd'
11636" | \
11637  $at_diff - "$at_stderr" || at_failed=:
11638at_fn_diff_devnull "$at_stdout" || at_failed=:
11639at_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
11647read at_status <"$at_status_file"
11648#AT_STOP_44
11649#AT_START_45
11650at_fn_group_banner 45 'named-refs.at:549' \
11651  "Comments in brackets" "                           " 2
11652at_xfail=no
11653(
11654  $as_echo "45. $at_setup_line: testing $at_desc ..."
11655  $at_traceon
11656
11657cat >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%%
11668start: 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"
11676at_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>&-
11679at_status=$? at_failed=false
11680$at_check_filter
11681echo >>"$at_stderr"; $as_echo "test.y:11.25: error: an identifier expected
11682" | \
11683  $at_diff - "$at_stderr" || at_failed=:
11684at_fn_diff_devnull "$at_stdout" || at_failed=:
11685at_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
11693read at_status <"$at_status_file"
11694#AT_STOP_45
11695#AT_START_46
11696at_fn_group_banner 46 'named-refs.at:563' \
11697  "Stray symbols in brackets" "                      " 2
11698at_xfail=no
11699(
11700  $as_echo "46. $at_setup_line: testing $at_desc ..."
11701  $at_traceon
11702
11703cat >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%%
11714start: 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"
11721at_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>&-
11724at_status=$? at_failed=false
11725$at_check_filter
11726at_fn_diff_devnull "$at_stderr" || at_failed=:
11727at_fn_diff_devnull "$at_stdout" || at_failed=:
11728at_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"
11735at_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>&-
11738at_status=$? at_failed=false
11739$at_check_filter
11740echo >>"$at_stderr"; $as_echo "test.y:11.13: error: invalid character in bracketed name: '%'
11741test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
11742test.y:11.29-30: error: invalid characters in bracketed name: '+\\0\\001\\002\\377'
11743" | \
11744  $at_diff - "$at_stderr" || at_failed=:
11745at_fn_diff_devnull "$at_stdout" || at_failed=:
11746at_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
11754read at_status <"$at_status_file"
11755#AT_STOP_46
11756#AT_START_47
11757at_fn_group_banner 47 'named-refs.at:580' \
11758  "Redundant words in LHS brackets" "                " 2
11759at_xfail=no
11760(
11761  $as_echo "47. $at_setup_line: testing $at_desc ..."
11762  $at_traceon
11763
11764cat >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%%
11775start[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"
11782at_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>&-
11785at_status=$? at_failed=false
11786$at_check_filter
11787echo >>"$at_stderr"; $as_echo "test.y:11.9: error: unexpected identifier in bracketed name: 's'
11788" | \
11789  $at_diff - "$at_stderr" || at_failed=:
11790at_fn_diff_devnull "$at_stdout" || at_failed=:
11791at_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
11799read at_status <"$at_status_file"
11800#AT_STOP_47
11801#AT_START_48
11802at_fn_group_banner 48 'named-refs.at:595' \
11803  "Factored LHS" "                                   " 2
11804at_xfail=no
11805(
11806  $as_echo "48. $at_setup_line: testing $at_desc ..."
11807  $at_traceon
11808
11809cat >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%%
11820start[a]: "foo" | "bar";
11821_ATEOF
11822
11823
11824if 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"
11832at_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>&-
11836at_status=$? at_failed=false
11837$at_check_filter
11838echo stderr:; cat "$at_stderr"
11839echo stdout:; cat "$at_stdout"
11840at_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"
11846at_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>&-
11849at_status=$? at_failed=false
11850$at_check_filter
11851echo stderr:; cat "$at_stderr"
11852echo stdout:; cat "$at_stdout"
11853at_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"
11862at_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>&-
11867at_status=$? at_failed=false
11868$at_check_filter
11869at_fn_diff_devnull "$at_stderr" || at_failed=:
11870$at_diff expout "$at_stdout" || at_failed=:
11871at_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"
11880at_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>&-
11885at_status=$? at_failed=false
11886$at_check_filter
11887at_fn_diff_devnull "$at_stderr" || at_failed=:
11888$at_diff expout "$at_stdout" || at_failed=:
11889at_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
11895fi
11896{ set +x
11897$as_echo "$at_srcdir/named-refs.at:601: bison -o test.c test.y"
11898at_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>&-
11901at_status=$? at_failed=false
11902$at_check_filter
11903at_fn_diff_devnull "$at_stderr" || at_failed=:
11904at_fn_diff_devnull "$at_stdout" || at_failed=:
11905at_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
11913read at_status <"$at_status_file"
11914#AT_STOP_48
11915#AT_START_49
11916at_fn_group_banner 49 'named-refs.at:606' \
11917  "Unresolved references" "                          " 2
11918at_xfail=no
11919(
11920  $as_echo "49. $at_setup_line: testing $at_desc ..."
11921  $at_traceon
11922
11923cat >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%%
11934stat:
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
11944stat1:
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
11954sym_a: 'a';
11955sym_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"
11962at_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>&-
11965at_status=$? at_failed=false
11966$at_check_filter
11967echo >>"$at_stderr"; $as_echo "test.y:12.22-31: error: invalid reference: '\$sym.field'
11968test.y:12.3-35:      symbol not found in production: sym
11969test.y:13.22-35: error: invalid reference: '\$<aa>sym.field'
11970test.y:13.3-39:      symbol not found in production: sym
11971test.y:14.22-33: error: invalid reference: '\$[sym.field]'
11972test.y:14.3-37:      symbol not found in production: sym.field
11973test.y:15.22-37: error: invalid reference: '\$<aa>[sym.field]'
11974test.y:15.3-41:      symbol not found in production: sym.field
11975test.y:16.22-25: error: invalid reference: '\$sym'
11976test.y:16.3-29:      symbol not found in production: sym
11977test.y:17.22-29: error: invalid reference: '\$<aa>sym'
11978test.y:17.3-33:      symbol not found in production: sym
11979test.y:18.22-27: error: invalid reference: '\$[sym]'
11980test.y:18.3-65:      symbol not found in production before \$3: sym
11981test.y:18.52-61: error: invalid reference: '\$<aa>[sym]'
11982test.y:18.3-65:      symbol not found in production: sym
11983test.y:22.22-31: error: invalid reference: '\$sym-field'
11984test.y:22.3-35:      symbol not found in production: sym
11985test.y:23.22-35: error: invalid reference: '\$<aa>sym-field'
11986test.y:23.3-39:      symbol not found in production: sym
11987test.y:24.22-33: error: invalid reference: '\$[sym-field]'
11988test.y:24.3-37:      symbol not found in production: sym-field
11989test.y:25.22-37: error: invalid reference: '\$<aa>[sym-field]'
11990test.y:25.3-41:      symbol not found in production: sym-field
11991test.y:26.22-25: error: invalid reference: '\$sym'
11992test.y:26.3-29:      symbol not found in production: sym
11993test.y:27.22-29: error: invalid reference: '\$<aa>sym'
11994test.y:27.3-33:      symbol not found in production: sym
11995test.y:28.22-27: error: invalid reference: '\$[sym]'
11996test.y:28.3-65:      symbol not found in production before \$3: sym
11997test.y:28.52-61: error: invalid reference: '\$<aa>[sym]'
11998test.y:28.3-65:      symbol not found in production: sym
11999" | \
12000  $at_diff - "$at_stderr" || at_failed=:
12001at_fn_diff_devnull "$at_stdout" || at_failed=:
12002at_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
12010read at_status <"$at_status_file"
12011#AT_STOP_49
12012#AT_START_50
12013at_fn_group_banner 50 'named-refs.at:671' \
12014  "\$ or @ followed by . or -" "                      " 2
12015at_xfail=no
12016(
12017  $as_echo "50. $at_setup_line: testing $at_desc ..."
12018  $at_traceon
12019
12020cat >test.y <<'_ATEOF'
12021
12022%%
12023start:
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"
12033at_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>&-
12036at_status=$? at_failed=false
12037$at_check_filter
12038echo >>"$at_stderr"; $as_echo "test.y:4.12-18: error: invalid reference: '\$.field'
12039test.y:4.13:        syntax error after '\$', expecting integer, letter, '_', '[', or '\$'
12040test.y:4.3-8:       possibly meant: \$[.field] at \$1
12041test.y:5.12-18: error: invalid reference: '@.field'
12042test.y:5.13:        syntax error after '@', expecting integer, letter, '_', '[', or '\$'
12043" | \
12044  $at_diff - "$at_stderr" || at_failed=:
12045at_fn_diff_devnull "$at_stdout" || at_failed=:
12046at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:681"
12047$at_failed && at_fn_log_failure
12048$at_traceon; }
12049
12050
12051cat >test.y <<'_ATEOF'
12052
12053%%
12054start:
12055  'a' { $-field; }
12056| 'b' { @-field; }
12057;
12058_ATEOF
12059
12060if 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"
12068at_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>&-
12072at_status=$? at_failed=false
12073$at_check_filter
12074echo stderr:; cat "$at_stderr"
12075echo stdout:; cat "$at_stdout"
12076at_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"
12082at_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>&-
12085at_status=$? at_failed=false
12086$at_check_filter
12087echo stderr:; cat "$at_stderr"
12088echo stdout:; cat "$at_stdout"
12089at_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"
12098at_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>&-
12103at_status=$? at_failed=false
12104$at_check_filter
12105at_fn_diff_devnull "$at_stderr" || at_failed=:
12106$at_diff expout "$at_stdout" || at_failed=:
12107at_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"
12116at_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>&-
12121at_status=$? at_failed=false
12122$at_check_filter
12123at_fn_diff_devnull "$at_stderr" || at_failed=:
12124$at_diff expout "$at_stdout" || at_failed=:
12125at_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
12131fi
12132{ set +x
12133$as_echo "$at_srcdir/named-refs.at:696: bison test.y"
12134at_fn_check_prepare_trace "named-refs.at:696"
12135( $at_check_trace; bison test.y
12136) >>"$at_stdout" 2>>"$at_stderr" 5>&-
12137at_status=$? at_failed=false
12138$at_check_filter
12139echo >>"$at_stderr"; $as_echo "test.y:4.9: warning: stray '\$'
12140test.y:5.9: warning: stray '@'
12141" | \
12142  $at_diff - "$at_stderr" || at_failed=:
12143at_fn_diff_devnull "$at_stdout" || at_failed=:
12144at_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.
12151if 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"
12160at_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>&-
12163at_status=$? at_failed=false
12164$at_check_filter
12165echo stderr:; tee stderr <"$at_stderr"
12166$at_diff expout "$at_stdout" || at_failed=:
12167at_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'
12175test.y:4.9: warning: stray '$'
12176test.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"
12206at_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>&-
12210at_status=$? at_failed=false
12211$at_check_filter
12212$at_diff experr "$at_stderr" || at_failed=:
12213at_fn_diff_devnull "$at_stdout" || at_failed=:
12214at_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"
12223at_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>&-
12226at_status=$? at_failed=false
12227$at_check_filter
12228$at_diff experr "$at_stderr" || at_failed=:
12229$at_diff expout "$at_stdout" || at_failed=:
12230at_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"
12240at_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>&-
12243at_status=$? at_failed=false
12244$at_check_filter
12245at_fn_diff_devnull "$at_stderr" || at_failed=:
12246$at_diff expout "$at_stdout" || at_failed=:
12247at_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"
12253at_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>&-
12256at_status=$? at_failed=false
12257$at_check_filter
12258at_fn_diff_devnull "$at_stderr" || at_failed=:
12259$at_diff expout "$at_stdout" || at_failed=:
12260at_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
12266fi
12267  set +x
12268  $at_times_p && times >"$at_times_file"
12269) 5>&1 2>&1 7>&- | eval $at_tee_pipe
12270read at_status <"$at_status_file"
12271#AT_STOP_50
12272#AT_START_51
12273at_fn_group_banner 51 'output.at:44' \
12274  "Output files:  -dv " "                            " 3
12275at_xfail=no
12276(
12277  $as_echo "51. $at_setup_line: testing $at_desc ..."
12278  $at_traceon
12279
12280
12281for 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
12285done
12286cat >foo.y <<'_ATEOF'
12287
12288%%
12289foo: {};
12290_ATEOF
12291
12292
12293if 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 "
12301at_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>&-
12305at_status=$? at_failed=false
12306$at_check_filter
12307echo stderr:; cat "$at_stderr"
12308echo stdout:; cat "$at_stdout"
12309at_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 "
12315at_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>&-
12318at_status=$? at_failed=false
12319$at_check_filter
12320echo stderr:; cat "$at_stderr"
12321echo stdout:; cat "$at_stdout"
12322at_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"
12331at_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>&-
12336at_status=$? at_failed=false
12337$at_check_filter
12338at_fn_diff_devnull "$at_stderr" || at_failed=:
12339$at_diff expout "$at_stdout" || at_failed=:
12340at_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"
12349at_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>&-
12354at_status=$? at_failed=false
12355$at_check_filter
12356at_fn_diff_devnull "$at_stderr" || at_failed=:
12357$at_diff expout "$at_stdout" || at_failed=:
12358at_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
12364fi
12365{ set +x
12366$as_echo "$at_srcdir/output.at:44: bison -dv foo.y "
12367at_fn_check_prepare_trace "output.at:44"
12368( $at_check_trace; bison -dv foo.y
12369) >>"$at_stdout" 2>>"$at_stderr" 5>&-
12370at_status=$? at_failed=false
12371$at_check_filter
12372at_fn_diff_devnull "$at_stderr" || at_failed=:
12373at_fn_diff_devnull "$at_stdout" || at_failed=:
12374at_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"
12381at_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>&-
12384at_status=$? at_failed=false
12385$at_check_filter
12386at_fn_diff_devnull "$at_stderr" || at_failed=:
12387echo stdout:; cat "$at_stdout"
12388at_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
12396read at_status <"$at_status_file"
12397#AT_STOP_51
12398#AT_START_52
12399at_fn_group_banner 52 'output.at:50' \
12400  "Output files:  -dv >&-" "                         " 3
12401at_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"
12408at_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>&-
12411at_status=$? at_failed=false
12412$at_check_filter
12413at_fn_diff_devnull "$at_stderr" || at_failed=:
12414at_fn_diff_devnull "$at_stdout" || at_failed=:
12415at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
12416$at_failed && at_fn_log_failure
12417$at_traceon; }
12418
12419for 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
12423done
12424cat >foo.y <<'_ATEOF'
12425
12426%%
12427foo: {};
12428_ATEOF
12429
12430
12431if 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 >&-"
12439at_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>&-
12443at_status=$? at_failed=false
12444$at_check_filter
12445echo stderr:; cat "$at_stderr"
12446echo stdout:; cat "$at_stdout"
12447at_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 >&-"
12453at_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>&-
12456at_status=$? at_failed=false
12457$at_check_filter
12458echo stderr:; cat "$at_stderr"
12459echo stdout:; cat "$at_stdout"
12460at_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"
12469at_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>&-
12474at_status=$? at_failed=false
12475$at_check_filter
12476at_fn_diff_devnull "$at_stderr" || at_failed=:
12477$at_diff expout "$at_stdout" || at_failed=:
12478at_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"
12487at_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>&-
12492at_status=$? at_failed=false
12493$at_check_filter
12494at_fn_diff_devnull "$at_stderr" || at_failed=:
12495$at_diff expout "$at_stdout" || at_failed=:
12496at_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
12502fi
12503{ set +x
12504$as_echo "$at_srcdir/output.at:50: bison -dv foo.y >&-"
12505at_fn_check_prepare_trace "output.at:50"
12506( $at_check_trace; bison -dv foo.y >&-
12507) >>"$at_stdout" 2>>"$at_stderr" 5>&-
12508at_status=$? at_failed=false
12509$at_check_filter
12510at_fn_diff_devnull "$at_stderr" || at_failed=:
12511at_fn_diff_devnull "$at_stdout" || at_failed=:
12512at_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"
12519at_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>&-
12522at_status=$? at_failed=false
12523$at_check_filter
12524at_fn_diff_devnull "$at_stderr" || at_failed=:
12525echo stdout:; cat "$at_stdout"
12526at_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
12534read at_status <"$at_status_file"
12535#AT_STOP_52
12536#AT_START_53
12537at_fn_group_banner 53 'output.at:55' \
12538  "Output files:  -dv -o foo.c " "                   " 3
12539at_xfail=no
12540(
12541  $as_echo "53. $at_setup_line: testing $at_desc ..."
12542  $at_traceon
12543
12544
12545for file in foo.y foo.c foo.h foo.output; do
12546  case "$file" in
12547    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
12548  esac
12549done
12550cat >foo.y <<'_ATEOF'
12551
12552%%
12553foo: {};
12554_ATEOF
12555
12556
12557if 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 "
12565at_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>&-
12569at_status=$? at_failed=false
12570$at_check_filter
12571echo stderr:; cat "$at_stderr"
12572echo stdout:; cat "$at_stdout"
12573at_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 "
12579at_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>&-
12582at_status=$? at_failed=false
12583$at_check_filter
12584echo stderr:; cat "$at_stderr"
12585echo stdout:; cat "$at_stdout"
12586at_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"
12595at_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>&-
12600at_status=$? at_failed=false
12601$at_check_filter
12602at_fn_diff_devnull "$at_stderr" || at_failed=:
12603$at_diff expout "$at_stdout" || at_failed=:
12604at_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"
12613at_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>&-
12618at_status=$? at_failed=false
12619$at_check_filter
12620at_fn_diff_devnull "$at_stderr" || at_failed=:
12621$at_diff expout "$at_stdout" || at_failed=:
12622at_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
12628fi
12629{ set +x
12630$as_echo "$at_srcdir/output.at:55: bison -dv -o foo.c foo.y "
12631at_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>&-
12634at_status=$? at_failed=false
12635$at_check_filter
12636at_fn_diff_devnull "$at_stderr" || at_failed=:
12637at_fn_diff_devnull "$at_stdout" || at_failed=:
12638at_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"
12645at_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>&-
12648at_status=$? at_failed=false
12649$at_check_filter
12650at_fn_diff_devnull "$at_stderr" || at_failed=:
12651echo stdout:; cat "$at_stdout"
12652at_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
12660read at_status <"$at_status_file"
12661#AT_STOP_53
12662#AT_START_54
12663at_fn_group_banner 54 'output.at:57' \
12664  "Output files:  -dv -o foo.tab.c " "               " 3
12665at_xfail=no
12666(
12667  $as_echo "54. $at_setup_line: testing $at_desc ..."
12668  $at_traceon
12669
12670
12671for 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
12675done
12676cat >foo.y <<'_ATEOF'
12677
12678%%
12679foo: {};
12680_ATEOF
12681
12682
12683if 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 "
12691at_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>&-
12695at_status=$? at_failed=false
12696$at_check_filter
12697echo stderr:; cat "$at_stderr"
12698echo stdout:; cat "$at_stdout"
12699at_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 "
12705at_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>&-
12708at_status=$? at_failed=false
12709$at_check_filter
12710echo stderr:; cat "$at_stderr"
12711echo stdout:; cat "$at_stdout"
12712at_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"
12721at_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>&-
12726at_status=$? at_failed=false
12727$at_check_filter
12728at_fn_diff_devnull "$at_stderr" || at_failed=:
12729$at_diff expout "$at_stdout" || at_failed=:
12730at_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"
12739at_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>&-
12744at_status=$? at_failed=false
12745$at_check_filter
12746at_fn_diff_devnull "$at_stderr" || at_failed=:
12747$at_diff expout "$at_stdout" || at_failed=:
12748at_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
12754fi
12755{ set +x
12756$as_echo "$at_srcdir/output.at:57: bison -dv -o foo.tab.c foo.y "
12757at_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>&-
12760at_status=$? at_failed=false
12761$at_check_filter
12762at_fn_diff_devnull "$at_stderr" || at_failed=:
12763at_fn_diff_devnull "$at_stdout" || at_failed=:
12764at_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"
12771at_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>&-
12774at_status=$? at_failed=false
12775$at_check_filter
12776at_fn_diff_devnull "$at_stderr" || at_failed=:
12777echo stdout:; cat "$at_stdout"
12778at_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
12786read at_status <"$at_status_file"
12787#AT_STOP_54
12788#AT_START_55
12789at_fn_group_banner 55 'output.at:59' \
12790  "Output files:  -dv -y " "                         " 3
12791at_xfail=no
12792(
12793  $as_echo "55. $at_setup_line: testing $at_desc ..."
12794  $at_traceon
12795
12796
12797for 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
12801done
12802cat >foo.y <<'_ATEOF'
12803
12804%%
12805foo: {};
12806_ATEOF
12807
12808
12809if 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 "
12817at_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>&-
12821at_status=$? at_failed=false
12822$at_check_filter
12823echo stderr:; cat "$at_stderr"
12824echo stdout:; cat "$at_stdout"
12825at_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 "
12831at_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>&-
12834at_status=$? at_failed=false
12835$at_check_filter
12836echo stderr:; cat "$at_stderr"
12837echo stdout:; cat "$at_stdout"
12838at_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"
12847at_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>&-
12852at_status=$? at_failed=false
12853$at_check_filter
12854at_fn_diff_devnull "$at_stderr" || at_failed=:
12855$at_diff expout "$at_stdout" || at_failed=:
12856at_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"
12865at_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>&-
12870at_status=$? at_failed=false
12871$at_check_filter
12872at_fn_diff_devnull "$at_stderr" || at_failed=:
12873$at_diff expout "$at_stdout" || at_failed=:
12874at_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
12880fi
12881{ set +x
12882$as_echo "$at_srcdir/output.at:59: bison -dv -y foo.y "
12883at_fn_check_prepare_trace "output.at:59"
12884( $at_check_trace; bison -dv -y foo.y
12885) >>"$at_stdout" 2>>"$at_stderr" 5>&-
12886at_status=$? at_failed=false
12887$at_check_filter
12888at_fn_diff_devnull "$at_stderr" || at_failed=:
12889at_fn_diff_devnull "$at_stdout" || at_failed=:
12890at_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"
12897at_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>&-
12900at_status=$? at_failed=false
12901$at_check_filter
12902at_fn_diff_devnull "$at_stderr" || at_failed=:
12903echo stdout:; cat "$at_stdout"
12904at_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
12912read at_status <"$at_status_file"
12913#AT_STOP_55
12914#AT_START_56
12915at_fn_group_banner 56 'output.at:61' \
12916  "Output files:  -dv -b bar " "                     " 3
12917at_xfail=no
12918(
12919  $as_echo "56. $at_setup_line: testing $at_desc ..."
12920  $at_traceon
12921
12922
12923for 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
12927done
12928cat >foo.y <<'_ATEOF'
12929
12930%%
12931foo: {};
12932_ATEOF
12933
12934
12935if 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 "
12943at_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>&-
12947at_status=$? at_failed=false
12948$at_check_filter
12949echo stderr:; cat "$at_stderr"
12950echo stdout:; cat "$at_stdout"
12951at_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 "
12957at_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>&-
12960at_status=$? at_failed=false
12961$at_check_filter
12962echo stderr:; cat "$at_stderr"
12963echo stdout:; cat "$at_stdout"
12964at_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"
12973at_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>&-
12978at_status=$? at_failed=false
12979$at_check_filter
12980at_fn_diff_devnull "$at_stderr" || at_failed=:
12981$at_diff expout "$at_stdout" || at_failed=:
12982at_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"
12991at_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>&-
12996at_status=$? at_failed=false
12997$at_check_filter
12998at_fn_diff_devnull "$at_stderr" || at_failed=:
12999$at_diff expout "$at_stdout" || at_failed=:
13000at_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
13006fi
13007{ set +x
13008$as_echo "$at_srcdir/output.at:61: bison -dv -b bar foo.y "
13009at_fn_check_prepare_trace "output.at:61"
13010( $at_check_trace; bison -dv -b bar foo.y
13011) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13012at_status=$? at_failed=false
13013$at_check_filter
13014at_fn_diff_devnull "$at_stderr" || at_failed=:
13015at_fn_diff_devnull "$at_stdout" || at_failed=:
13016at_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"
13023at_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>&-
13026at_status=$? at_failed=false
13027$at_check_filter
13028at_fn_diff_devnull "$at_stderr" || at_failed=:
13029echo stdout:; cat "$at_stdout"
13030at_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
13038read at_status <"$at_status_file"
13039#AT_STOP_56
13040#AT_START_57
13041at_fn_group_banner 57 'output.at:63' \
13042  "Output files:  -dv -g -o foo.c " "                " 3
13043at_xfail=no
13044(
13045  $as_echo "57. $at_setup_line: testing $at_desc ..."
13046  $at_traceon
13047
13048
13049for 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
13053done
13054cat >foo.y <<'_ATEOF'
13055
13056%%
13057foo: {};
13058_ATEOF
13059
13060
13061if 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 "
13069at_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>&-
13073at_status=$? at_failed=false
13074$at_check_filter
13075echo stderr:; cat "$at_stderr"
13076echo stdout:; cat "$at_stdout"
13077at_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 "
13083at_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>&-
13086at_status=$? at_failed=false
13087$at_check_filter
13088echo stderr:; cat "$at_stderr"
13089echo stdout:; cat "$at_stdout"
13090at_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"
13099at_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>&-
13104at_status=$? at_failed=false
13105$at_check_filter
13106at_fn_diff_devnull "$at_stderr" || at_failed=:
13107$at_diff expout "$at_stdout" || at_failed=:
13108at_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"
13117at_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>&-
13122at_status=$? at_failed=false
13123$at_check_filter
13124at_fn_diff_devnull "$at_stderr" || at_failed=:
13125$at_diff expout "$at_stdout" || at_failed=:
13126at_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
13132fi
13133{ set +x
13134$as_echo "$at_srcdir/output.at:63: bison -dv -g -o foo.c foo.y "
13135at_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>&-
13138at_status=$? at_failed=false
13139$at_check_filter
13140at_fn_diff_devnull "$at_stderr" || at_failed=:
13141at_fn_diff_devnull "$at_stdout" || at_failed=:
13142at_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"
13149at_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>&-
13152at_status=$? at_failed=false
13153$at_check_filter
13154at_fn_diff_devnull "$at_stderr" || at_failed=:
13155echo stdout:; cat "$at_stdout"
13156at_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
13164read at_status <"$at_status_file"
13165#AT_STOP_57
13166#AT_START_58
13167at_fn_group_banner 58 'output.at:67' \
13168  "Output files: %defines %verbose  " "              " 3
13169at_xfail=no
13170(
13171  $as_echo "58. $at_setup_line: testing $at_desc ..."
13172  $at_traceon
13173
13174
13175for 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
13179done
13180cat >foo.y <<'_ATEOF'
13181%defines %verbose
13182%%
13183foo: {};
13184_ATEOF
13185
13186
13187if 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 "
13195at_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>&-
13199at_status=$? at_failed=false
13200$at_check_filter
13201echo stderr:; cat "$at_stderr"
13202echo stdout:; cat "$at_stdout"
13203at_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 "
13209at_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>&-
13212at_status=$? at_failed=false
13213$at_check_filter
13214echo stderr:; cat "$at_stderr"
13215echo stdout:; cat "$at_stdout"
13216at_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"
13225at_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>&-
13230at_status=$? at_failed=false
13231$at_check_filter
13232at_fn_diff_devnull "$at_stderr" || at_failed=:
13233$at_diff expout "$at_stdout" || at_failed=:
13234at_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"
13243at_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>&-
13248at_status=$? at_failed=false
13249$at_check_filter
13250at_fn_diff_devnull "$at_stderr" || at_failed=:
13251$at_diff expout "$at_stdout" || at_failed=:
13252at_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
13258fi
13259{ set +x
13260$as_echo "$at_srcdir/output.at:67: bison  foo.y "
13261at_fn_check_prepare_trace "output.at:67"
13262( $at_check_trace; bison  foo.y
13263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13264at_status=$? at_failed=false
13265$at_check_filter
13266at_fn_diff_devnull "$at_stderr" || at_failed=:
13267at_fn_diff_devnull "$at_stdout" || at_failed=:
13268at_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"
13275at_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>&-
13278at_status=$? at_failed=false
13279$at_check_filter
13280at_fn_diff_devnull "$at_stderr" || at_failed=:
13281echo stdout:; cat "$at_stdout"
13282at_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
13290read at_status <"$at_status_file"
13291#AT_STOP_58
13292#AT_START_59
13293at_fn_group_banner 59 'output.at:69' \
13294  "Output files: %defines %verbose %yacc  " "        " 3
13295at_xfail=no
13296(
13297  $as_echo "59. $at_setup_line: testing $at_desc ..."
13298  $at_traceon
13299
13300
13301for 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
13305done
13306cat >foo.y <<'_ATEOF'
13307%defines %verbose %yacc
13308%%
13309foo: {};
13310_ATEOF
13311
13312
13313if 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 "
13321at_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>&-
13325at_status=$? at_failed=false
13326$at_check_filter
13327echo stderr:; cat "$at_stderr"
13328echo stdout:; cat "$at_stdout"
13329at_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 "
13335at_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>&-
13338at_status=$? at_failed=false
13339$at_check_filter
13340echo stderr:; cat "$at_stderr"
13341echo stdout:; cat "$at_stdout"
13342at_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"
13351at_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>&-
13356at_status=$? at_failed=false
13357$at_check_filter
13358at_fn_diff_devnull "$at_stderr" || at_failed=:
13359$at_diff expout "$at_stdout" || at_failed=:
13360at_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"
13369at_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>&-
13374at_status=$? at_failed=false
13375$at_check_filter
13376at_fn_diff_devnull "$at_stderr" || at_failed=:
13377$at_diff expout "$at_stdout" || at_failed=:
13378at_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
13384fi
13385{ set +x
13386$as_echo "$at_srcdir/output.at:69: bison  foo.y "
13387at_fn_check_prepare_trace "output.at:69"
13388( $at_check_trace; bison  foo.y
13389) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13390at_status=$? at_failed=false
13391$at_check_filter
13392at_fn_diff_devnull "$at_stderr" || at_failed=:
13393at_fn_diff_devnull "$at_stdout" || at_failed=:
13394at_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"
13401at_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>&-
13404at_status=$? at_failed=false
13405$at_check_filter
13406at_fn_diff_devnull "$at_stderr" || at_failed=:
13407echo stdout:; cat "$at_stdout"
13408at_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
13416read at_status <"$at_status_file"
13417#AT_STOP_59
13418#AT_START_60
13419at_fn_group_banner 60 'output.at:72' \
13420  "Output files: %defines %verbose %yacc  " "        " 3
13421at_xfail=no
13422(
13423  $as_echo "60. $at_setup_line: testing $at_desc ..."
13424  $at_traceon
13425
13426
13427for 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
13431done
13432cat >foo.yy <<'_ATEOF'
13433%defines %verbose %yacc
13434%%
13435foo: {};
13436_ATEOF
13437
13438
13439if 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 "
13447at_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>&-
13451at_status=$? at_failed=false
13452$at_check_filter
13453echo stderr:; cat "$at_stderr"
13454echo stdout:; cat "$at_stdout"
13455at_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 "
13461at_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>&-
13464at_status=$? at_failed=false
13465$at_check_filter
13466echo stderr:; cat "$at_stderr"
13467echo stdout:; cat "$at_stdout"
13468at_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"
13477at_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>&-
13482at_status=$? at_failed=false
13483$at_check_filter
13484at_fn_diff_devnull "$at_stderr" || at_failed=:
13485$at_diff expout "$at_stdout" || at_failed=:
13486at_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"
13495at_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>&-
13500at_status=$? at_failed=false
13501$at_check_filter
13502at_fn_diff_devnull "$at_stderr" || at_failed=:
13503$at_diff expout "$at_stdout" || at_failed=:
13504at_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
13510fi
13511{ set +x
13512$as_echo "$at_srcdir/output.at:72: bison  foo.yy "
13513at_fn_check_prepare_trace "output.at:72"
13514( $at_check_trace; bison  foo.yy
13515) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13516at_status=$? at_failed=false
13517$at_check_filter
13518at_fn_diff_devnull "$at_stderr" || at_failed=:
13519at_fn_diff_devnull "$at_stdout" || at_failed=:
13520at_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"
13527at_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>&-
13530at_status=$? at_failed=false
13531$at_check_filter
13532at_fn_diff_devnull "$at_stderr" || at_failed=:
13533echo stdout:; cat "$at_stdout"
13534at_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
13542read at_status <"$at_status_file"
13543#AT_STOP_60
13544#AT_START_61
13545at_fn_group_banner 61 'output.at:76' \
13546  "Output files: %file-prefix \"bar\" %defines %verbose  " "" 3
13547at_xfail=no
13548(
13549  $as_echo "61. $at_setup_line: testing $at_desc ..."
13550  $at_traceon
13551
13552
13553for 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
13557done
13558cat >foo.y <<'_ATEOF'
13559%file-prefix "bar" %defines %verbose
13560%%
13561foo: {};
13562_ATEOF
13563
13564
13565if 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 "
13573at_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>&-
13577at_status=$? at_failed=false
13578$at_check_filter
13579echo stderr:; cat "$at_stderr"
13580echo stdout:; cat "$at_stdout"
13581at_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 "
13587at_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>&-
13590at_status=$? at_failed=false
13591$at_check_filter
13592echo stderr:; cat "$at_stderr"
13593echo stdout:; cat "$at_stdout"
13594at_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"
13603at_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>&-
13608at_status=$? at_failed=false
13609$at_check_filter
13610at_fn_diff_devnull "$at_stderr" || at_failed=:
13611$at_diff expout "$at_stdout" || at_failed=:
13612at_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"
13621at_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>&-
13626at_status=$? at_failed=false
13627$at_check_filter
13628at_fn_diff_devnull "$at_stderr" || at_failed=:
13629$at_diff expout "$at_stdout" || at_failed=:
13630at_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
13636fi
13637{ set +x
13638$as_echo "$at_srcdir/output.at:76: bison  foo.y "
13639at_fn_check_prepare_trace "output.at:76"
13640( $at_check_trace; bison  foo.y
13641) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13642at_status=$? at_failed=false
13643$at_check_filter
13644at_fn_diff_devnull "$at_stderr" || at_failed=:
13645at_fn_diff_devnull "$at_stdout" || at_failed=:
13646at_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"
13653at_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>&-
13656at_status=$? at_failed=false
13657$at_check_filter
13658at_fn_diff_devnull "$at_stderr" || at_failed=:
13659echo stdout:; cat "$at_stdout"
13660at_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
13668read at_status <"$at_status_file"
13669#AT_STOP_61
13670#AT_START_62
13671at_fn_group_banner 62 'output.at:78' \
13672  "Output files: %output=\"bar.c\" %defines %verbose %yacc  " "" 3
13673at_xfail=no
13674(
13675  $as_echo "62. $at_setup_line: testing $at_desc ..."
13676  $at_traceon
13677
13678
13679for file in foo.y bar.output bar.c bar.h; do
13680  case "$file" in
13681    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
13682  esac
13683done
13684cat >foo.y <<'_ATEOF'
13685%output="bar.c" %defines %verbose %yacc
13686%%
13687foo: {};
13688_ATEOF
13689
13690
13691if 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 "
13699at_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>&-
13703at_status=$? at_failed=false
13704$at_check_filter
13705echo stderr:; cat "$at_stderr"
13706echo stdout:; cat "$at_stdout"
13707at_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 "
13713at_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>&-
13716at_status=$? at_failed=false
13717$at_check_filter
13718echo stderr:; cat "$at_stderr"
13719echo stdout:; cat "$at_stdout"
13720at_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"
13729at_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>&-
13734at_status=$? at_failed=false
13735$at_check_filter
13736at_fn_diff_devnull "$at_stderr" || at_failed=:
13737$at_diff expout "$at_stdout" || at_failed=:
13738at_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"
13747at_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>&-
13752at_status=$? at_failed=false
13753$at_check_filter
13754at_fn_diff_devnull "$at_stderr" || at_failed=:
13755$at_diff expout "$at_stdout" || at_failed=:
13756at_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
13762fi
13763{ set +x
13764$as_echo "$at_srcdir/output.at:78: bison  foo.y "
13765at_fn_check_prepare_trace "output.at:78"
13766( $at_check_trace; bison  foo.y
13767) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13768at_status=$? at_failed=false
13769$at_check_filter
13770at_fn_diff_devnull "$at_stderr" || at_failed=:
13771at_fn_diff_devnull "$at_stdout" || at_failed=:
13772at_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"
13779at_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>&-
13782at_status=$? at_failed=false
13783$at_check_filter
13784at_fn_diff_devnull "$at_stderr" || at_failed=:
13785echo stdout:; cat "$at_stdout"
13786at_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
13794read at_status <"$at_status_file"
13795#AT_STOP_62
13796#AT_START_63
13797at_fn_group_banner 63 'output.at:80' \
13798  "Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  " "" 3
13799at_xfail=no
13800(
13801  $as_echo "63. $at_setup_line: testing $at_desc ..."
13802  $at_traceon
13803
13804
13805for file in foo.y bar.output bar.c bar.h; do
13806  case "$file" in
13807    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
13808  esac
13809done
13810cat >foo.y <<'_ATEOF'
13811%file-prefix="baz" %output "bar.c" %defines %verbose %yacc
13812%%
13813foo: {};
13814_ATEOF
13815
13816
13817if 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 "
13825at_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>&-
13829at_status=$? at_failed=false
13830$at_check_filter
13831echo stderr:; cat "$at_stderr"
13832echo stdout:; cat "$at_stdout"
13833at_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 "
13839at_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>&-
13842at_status=$? at_failed=false
13843$at_check_filter
13844echo stderr:; cat "$at_stderr"
13845echo stdout:; cat "$at_stdout"
13846at_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"
13855at_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>&-
13860at_status=$? at_failed=false
13861$at_check_filter
13862at_fn_diff_devnull "$at_stderr" || at_failed=:
13863$at_diff expout "$at_stdout" || at_failed=:
13864at_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"
13873at_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>&-
13878at_status=$? at_failed=false
13879$at_check_filter
13880at_fn_diff_devnull "$at_stderr" || at_failed=:
13881$at_diff expout "$at_stdout" || at_failed=:
13882at_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
13888fi
13889{ set +x
13890$as_echo "$at_srcdir/output.at:80: bison  foo.y "
13891at_fn_check_prepare_trace "output.at:80"
13892( $at_check_trace; bison  foo.y
13893) >>"$at_stdout" 2>>"$at_stderr" 5>&-
13894at_status=$? at_failed=false
13895$at_check_filter
13896at_fn_diff_devnull "$at_stderr" || at_failed=:
13897at_fn_diff_devnull "$at_stdout" || at_failed=:
13898at_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"
13905at_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>&-
13908at_status=$? at_failed=false
13909$at_check_filter
13910at_fn_diff_devnull "$at_stderr" || at_failed=:
13911echo stdout:; cat "$at_stdout"
13912at_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
13920read at_status <"$at_status_file"
13921#AT_STOP_63
13922#AT_START_64
13923at_fn_group_banner 64 'output.at:87' \
13924  "Output files: %defines %verbose  " "              " 3
13925at_xfail=no
13926(
13927  $as_echo "64. $at_setup_line: testing $at_desc ..."
13928  $at_traceon
13929
13930
13931for 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
13935done
13936cat >foo.yy <<'_ATEOF'
13937%defines %verbose
13938%%
13939foo: {};
13940_ATEOF
13941
13942
13943if 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 "
13951at_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>&-
13955at_status=$? at_failed=false
13956$at_check_filter
13957echo stderr:; cat "$at_stderr"
13958echo stdout:; cat "$at_stdout"
13959at_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 "
13965at_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>&-
13968at_status=$? at_failed=false
13969$at_check_filter
13970echo stderr:; cat "$at_stderr"
13971echo stdout:; cat "$at_stdout"
13972at_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"
13981at_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>&-
13986at_status=$? at_failed=false
13987$at_check_filter
13988at_fn_diff_devnull "$at_stderr" || at_failed=:
13989$at_diff expout "$at_stdout" || at_failed=:
13990at_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"
13999at_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>&-
14004at_status=$? at_failed=false
14005$at_check_filter
14006at_fn_diff_devnull "$at_stderr" || at_failed=:
14007$at_diff expout "$at_stdout" || at_failed=:
14008at_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
14014fi
14015{ set +x
14016$as_echo "$at_srcdir/output.at:87: bison  foo.yy "
14017at_fn_check_prepare_trace "output.at:87"
14018( $at_check_trace; bison  foo.yy
14019) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14020at_status=$? at_failed=false
14021$at_check_filter
14022at_fn_diff_devnull "$at_stderr" || at_failed=:
14023at_fn_diff_devnull "$at_stdout" || at_failed=:
14024at_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"
14031at_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>&-
14034at_status=$? at_failed=false
14035$at_check_filter
14036at_fn_diff_devnull "$at_stderr" || at_failed=:
14037echo stdout:; cat "$at_stdout"
14038at_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
14046read at_status <"$at_status_file"
14047#AT_STOP_64
14048#AT_START_65
14049at_fn_group_banner 65 'output.at:90' \
14050  "Output files: %defines %verbose  -o foo.c " "     " 3
14051at_xfail=no
14052(
14053  $as_echo "65. $at_setup_line: testing $at_desc ..."
14054  $at_traceon
14055
14056
14057for file in foo.yy foo.c foo.h foo.output; do
14058  case "$file" in
14059    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
14060  esac
14061done
14062cat >foo.yy <<'_ATEOF'
14063%defines %verbose
14064%%
14065foo: {};
14066_ATEOF
14067
14068
14069if 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 "
14077at_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>&-
14081at_status=$? at_failed=false
14082$at_check_filter
14083echo stderr:; cat "$at_stderr"
14084echo stdout:; cat "$at_stdout"
14085at_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 "
14091at_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>&-
14094at_status=$? at_failed=false
14095$at_check_filter
14096echo stderr:; cat "$at_stderr"
14097echo stdout:; cat "$at_stdout"
14098at_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"
14107at_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>&-
14112at_status=$? at_failed=false
14113$at_check_filter
14114at_fn_diff_devnull "$at_stderr" || at_failed=:
14115$at_diff expout "$at_stdout" || at_failed=:
14116at_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"
14125at_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>&-
14130at_status=$? at_failed=false
14131$at_check_filter
14132at_fn_diff_devnull "$at_stderr" || at_failed=:
14133$at_diff expout "$at_stdout" || at_failed=:
14134at_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
14140fi
14141{ set +x
14142$as_echo "$at_srcdir/output.at:90: bison -o foo.c foo.yy "
14143at_fn_check_prepare_trace "output.at:90"
14144( $at_check_trace; bison -o foo.c foo.yy
14145) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14146at_status=$? at_failed=false
14147$at_check_filter
14148at_fn_diff_devnull "$at_stderr" || at_failed=:
14149at_fn_diff_devnull "$at_stdout" || at_failed=:
14150at_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"
14157at_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>&-
14160at_status=$? at_failed=false
14161$at_check_filter
14162at_fn_diff_devnull "$at_stderr" || at_failed=:
14163echo stdout:; cat "$at_stdout"
14164at_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
14172read at_status <"$at_status_file"
14173#AT_STOP_65
14174#AT_START_66
14175at_fn_group_banner 66 'output.at:93' \
14176  "Output files:  --defines=foo.hpp -o foo.c++ " "   " 3
14177at_xfail=no
14178(
14179  $as_echo "66. $at_setup_line: testing $at_desc ..."
14180  $at_traceon
14181
14182
14183for file in foo.yy foo.c++ foo.hpp; do
14184  case "$file" in
14185    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
14186  esac
14187done
14188cat >foo.yy <<'_ATEOF'
14189
14190%%
14191foo: {};
14192_ATEOF
14193
14194
14195if 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 "
14203at_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>&-
14207at_status=$? at_failed=false
14208$at_check_filter
14209echo stderr:; cat "$at_stderr"
14210echo stdout:; cat "$at_stdout"
14211at_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 "
14217at_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>&-
14220at_status=$? at_failed=false
14221$at_check_filter
14222echo stderr:; cat "$at_stderr"
14223echo stdout:; cat "$at_stdout"
14224at_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"
14233at_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>&-
14238at_status=$? at_failed=false
14239$at_check_filter
14240at_fn_diff_devnull "$at_stderr" || at_failed=:
14241$at_diff expout "$at_stdout" || at_failed=:
14242at_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"
14251at_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>&-
14256at_status=$? at_failed=false
14257$at_check_filter
14258at_fn_diff_devnull "$at_stderr" || at_failed=:
14259$at_diff expout "$at_stdout" || at_failed=:
14260at_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
14266fi
14267{ set +x
14268$as_echo "$at_srcdir/output.at:93: bison --defines=foo.hpp -o foo.c++ foo.yy "
14269at_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>&-
14272at_status=$? at_failed=false
14273$at_check_filter
14274at_fn_diff_devnull "$at_stderr" || at_failed=:
14275at_fn_diff_devnull "$at_stdout" || at_failed=:
14276at_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"
14283at_fn_check_prepare_trace "output.at:93"
14284( $at_check_trace; ls foo.c++ foo.hpp
14285) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14286at_status=$? at_failed=false
14287$at_check_filter
14288at_fn_diff_devnull "$at_stderr" || at_failed=:
14289echo stdout:; cat "$at_stdout"
14290at_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
14298read at_status <"$at_status_file"
14299#AT_STOP_66
14300#AT_START_67
14301at_fn_group_banner 67 'output.at:97' \
14302  "Output files: %defines \"foo.hpp\" -o foo.c++ " "   " 3
14303at_xfail=no
14304(
14305  $as_echo "67. $at_setup_line: testing $at_desc ..."
14306  $at_traceon
14307
14308
14309for file in foo.yy foo.c++ foo.hpp; do
14310  case "$file" in
14311    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
14312  esac
14313done
14314cat >foo.yy <<'_ATEOF'
14315%defines "foo.hpp"
14316%%
14317foo: {};
14318_ATEOF
14319
14320
14321if 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 "
14329at_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>&-
14333at_status=$? at_failed=false
14334$at_check_filter
14335echo stderr:; cat "$at_stderr"
14336echo stdout:; cat "$at_stdout"
14337at_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 "
14343at_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>&-
14346at_status=$? at_failed=false
14347$at_check_filter
14348echo stderr:; cat "$at_stderr"
14349echo stdout:; cat "$at_stdout"
14350at_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"
14359at_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>&-
14364at_status=$? at_failed=false
14365$at_check_filter
14366at_fn_diff_devnull "$at_stderr" || at_failed=:
14367$at_diff expout "$at_stdout" || at_failed=:
14368at_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"
14377at_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>&-
14382at_status=$? at_failed=false
14383$at_check_filter
14384at_fn_diff_devnull "$at_stderr" || at_failed=:
14385$at_diff expout "$at_stdout" || at_failed=:
14386at_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
14392fi
14393{ set +x
14394$as_echo "$at_srcdir/output.at:97: bison -o foo.c++ foo.yy "
14395at_fn_check_prepare_trace "output.at:97"
14396( $at_check_trace; bison -o foo.c++ foo.yy
14397) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14398at_status=$? at_failed=false
14399$at_check_filter
14400at_fn_diff_devnull "$at_stderr" || at_failed=:
14401at_fn_diff_devnull "$at_stdout" || at_failed=:
14402at_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"
14409at_fn_check_prepare_trace "output.at:97"
14410( $at_check_trace; ls foo.c++ foo.hpp
14411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14412at_status=$? at_failed=false
14413$at_check_filter
14414at_fn_diff_devnull "$at_stderr" || at_failed=:
14415echo stdout:; cat "$at_stdout"
14416at_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
14424read at_status <"$at_status_file"
14425#AT_STOP_67
14426#AT_START_68
14427at_fn_group_banner 68 'output.at:101' \
14428  "Output files:  -o foo.c++ --graph=foo.gph " "     " 3
14429at_xfail=no
14430(
14431  $as_echo "68. $at_setup_line: testing $at_desc ..."
14432  $at_traceon
14433
14434
14435for file in foo.yy foo.c++ foo.gph; do
14436  case "$file" in
14437    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
14438  esac
14439done
14440cat >foo.yy <<'_ATEOF'
14441
14442%%
14443foo: {};
14444_ATEOF
14445
14446
14447if 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 "
14455at_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>&-
14459at_status=$? at_failed=false
14460$at_check_filter
14461echo stderr:; cat "$at_stderr"
14462echo stdout:; cat "$at_stdout"
14463at_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 "
14469at_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>&-
14472at_status=$? at_failed=false
14473$at_check_filter
14474echo stderr:; cat "$at_stderr"
14475echo stdout:; cat "$at_stdout"
14476at_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"
14485at_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>&-
14490at_status=$? at_failed=false
14491$at_check_filter
14492at_fn_diff_devnull "$at_stderr" || at_failed=:
14493$at_diff expout "$at_stdout" || at_failed=:
14494at_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"
14503at_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>&-
14508at_status=$? at_failed=false
14509$at_check_filter
14510at_fn_diff_devnull "$at_stderr" || at_failed=:
14511$at_diff expout "$at_stdout" || at_failed=:
14512at_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
14518fi
14519{ set +x
14520$as_echo "$at_srcdir/output.at:101: bison -o foo.c++ --graph=foo.gph foo.yy "
14521at_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>&-
14524at_status=$? at_failed=false
14525$at_check_filter
14526at_fn_diff_devnull "$at_stderr" || at_failed=:
14527at_fn_diff_devnull "$at_stdout" || at_failed=:
14528at_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"
14535at_fn_check_prepare_trace "output.at:101"
14536( $at_check_trace; ls foo.c++ foo.gph
14537) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14538at_status=$? at_failed=false
14539$at_check_filter
14540at_fn_diff_devnull "$at_stderr" || at_failed=:
14541echo stdout:; cat "$at_stdout"
14542at_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
14550read at_status <"$at_status_file"
14551#AT_STOP_68
14552#AT_START_69
14553at_fn_group_banner 69 'output.at:116' \
14554  "Output files: %skeleton \"lalr1.cc\" %defines %verbose  " "" 3
14555at_xfail=no
14556(
14557  $as_echo "69. $at_setup_line: testing $at_desc ..."
14558  $at_traceon
14559
14560
14561for 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
14565done
14566cat >foo.yy <<'_ATEOF'
14567%skeleton "lalr1.cc" %defines %verbose
14568%%
14569foo: {};
14570_ATEOF
14571
14572
14573if 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 "
14581at_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>&-
14585at_status=$? at_failed=false
14586$at_check_filter
14587echo stderr:; cat "$at_stderr"
14588echo stdout:; cat "$at_stdout"
14589at_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 "
14595at_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>&-
14598at_status=$? at_failed=false
14599$at_check_filter
14600echo stderr:; cat "$at_stderr"
14601echo stdout:; cat "$at_stdout"
14602at_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"
14611at_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>&-
14616at_status=$? at_failed=false
14617$at_check_filter
14618at_fn_diff_devnull "$at_stderr" || at_failed=:
14619$at_diff expout "$at_stdout" || at_failed=:
14620at_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"
14629at_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>&-
14634at_status=$? at_failed=false
14635$at_check_filter
14636at_fn_diff_devnull "$at_stderr" || at_failed=:
14637$at_diff expout "$at_stdout" || at_failed=:
14638at_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
14644fi
14645{ set +x
14646$as_echo "$at_srcdir/output.at:116: bison  foo.yy "
14647at_fn_check_prepare_trace "output.at:116"
14648( $at_check_trace; bison  foo.yy
14649) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14650at_status=$? at_failed=false
14651$at_check_filter
14652at_fn_diff_devnull "$at_stderr" || at_failed=:
14653at_fn_diff_devnull "$at_stdout" || at_failed=:
14654at_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"
14661at_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>&-
14664at_status=$? at_failed=false
14665$at_check_filter
14666at_fn_diff_devnull "$at_stderr" || at_failed=:
14667echo stdout:; cat "$at_stdout"
14668at_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
14676read at_status <"$at_status_file"
14677#AT_STOP_69
14678#AT_START_70
14679at_fn_group_banner 70 'output.at:119' \
14680  "Output files: %skeleton \"lalr1.cc\" %defines %verbose  " "" 3
14681at_xfail=no
14682(
14683  $as_echo "70. $at_setup_line: testing $at_desc ..."
14684  $at_traceon
14685
14686
14687for 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
14691done
14692cat >subdir/foo.yy <<'_ATEOF'
14693%skeleton "lalr1.cc" %defines %verbose
14694%%
14695foo: {};
14696_ATEOF
14697
14698
14699if 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 "
14707at_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>&-
14711at_status=$? at_failed=false
14712$at_check_filter
14713echo stderr:; cat "$at_stderr"
14714echo stdout:; cat "$at_stdout"
14715at_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 "
14721at_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>&-
14724at_status=$? at_failed=false
14725$at_check_filter
14726echo stderr:; cat "$at_stderr"
14727echo stdout:; cat "$at_stdout"
14728at_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"
14737at_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>&-
14742at_status=$? at_failed=false
14743$at_check_filter
14744at_fn_diff_devnull "$at_stderr" || at_failed=:
14745$at_diff expout "$at_stdout" || at_failed=:
14746at_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"
14755at_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>&-
14760at_status=$? at_failed=false
14761$at_check_filter
14762at_fn_diff_devnull "$at_stderr" || at_failed=:
14763$at_diff expout "$at_stdout" || at_failed=:
14764at_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
14770fi
14771{ set +x
14772$as_echo "$at_srcdir/output.at:119: bison  subdir/foo.yy "
14773at_fn_check_prepare_trace "output.at:119"
14774( $at_check_trace; bison  subdir/foo.yy
14775) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14776at_status=$? at_failed=false
14777$at_check_filter
14778at_fn_diff_devnull "$at_stderr" || at_failed=:
14779at_fn_diff_devnull "$at_stdout" || at_failed=:
14780at_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"
14787at_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>&-
14790at_status=$? at_failed=false
14791$at_check_filter
14792at_fn_diff_devnull "$at_stderr" || at_failed=:
14793echo stdout:; cat "$at_stdout"
14794at_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"
14801at_fn_check_prepare_trace "output.at:119"
14802( $at_check_trace; grep 'include .subdir/' foo.tab.cc
14803) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14804at_status=$? at_failed=false
14805$at_check_filter
14806at_fn_diff_devnull "$at_stderr" || at_failed=:
14807at_fn_diff_devnull "$at_stdout" || at_failed=:
14808at_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"
14814at_fn_check_prepare_trace "output.at:119"
14815( $at_check_trace; grep 'include .subdir/' foo.tab.hh
14816) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14817at_status=$? at_failed=false
14818$at_check_filter
14819at_fn_diff_devnull "$at_stderr" || at_failed=:
14820at_fn_diff_devnull "$at_stdout" || at_failed=:
14821at_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
14829read at_status <"$at_status_file"
14830#AT_STOP_70
14831#AT_START_71
14832at_fn_group_banner 71 'output.at:123' \
14833  "Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc " "" 3
14834at_xfail=no
14835(
14836  $as_echo "71. $at_setup_line: testing $at_desc ..."
14837  $at_traceon
14838
14839
14840for 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
14844done
14845cat >subdir/foo.yy <<'_ATEOF'
14846%skeleton "lalr1.cc" %defines %verbose
14847%%
14848foo: {};
14849_ATEOF
14850
14851
14852if 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 "
14860at_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>&-
14864at_status=$? at_failed=false
14865$at_check_filter
14866echo stderr:; cat "$at_stderr"
14867echo stdout:; cat "$at_stdout"
14868at_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 "
14874at_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>&-
14877at_status=$? at_failed=false
14878$at_check_filter
14879echo stderr:; cat "$at_stderr"
14880echo stdout:; cat "$at_stdout"
14881at_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"
14890at_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>&-
14895at_status=$? at_failed=false
14896$at_check_filter
14897at_fn_diff_devnull "$at_stderr" || at_failed=:
14898$at_diff expout "$at_stdout" || at_failed=:
14899at_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"
14908at_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>&-
14913at_status=$? at_failed=false
14914$at_check_filter
14915at_fn_diff_devnull "$at_stderr" || at_failed=:
14916$at_diff expout "$at_stdout" || at_failed=:
14917at_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
14923fi
14924{ set +x
14925$as_echo "$at_srcdir/output.at:123: bison -o subdir/foo.cc subdir/foo.yy "
14926at_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>&-
14929at_status=$? at_failed=false
14930$at_check_filter
14931at_fn_diff_devnull "$at_stderr" || at_failed=:
14932at_fn_diff_devnull "$at_stdout" || at_failed=:
14933at_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"
14940at_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>&-
14943at_status=$? at_failed=false
14944$at_check_filter
14945at_fn_diff_devnull "$at_stderr" || at_failed=:
14946echo stdout:; cat "$at_stdout"
14947at_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"
14954at_fn_check_prepare_trace "output.at:123"
14955( $at_check_trace; grep 'include .subdir/' subdir/foo.cc
14956) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14957at_status=$? at_failed=false
14958$at_check_filter
14959at_fn_diff_devnull "$at_stderr" || at_failed=:
14960at_fn_diff_devnull "$at_stdout" || at_failed=:
14961at_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"
14967at_fn_check_prepare_trace "output.at:123"
14968( $at_check_trace; grep 'include .subdir/' subdir/foo.hh
14969) >>"$at_stdout" 2>>"$at_stderr" 5>&-
14970at_status=$? at_failed=false
14971$at_check_filter
14972at_fn_diff_devnull "$at_stderr" || at_failed=:
14973at_fn_diff_devnull "$at_stdout" || at_failed=:
14974at_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
14982read at_status <"$at_status_file"
14983#AT_STOP_71
14984#AT_START_72
14985at_fn_group_banner 72 'output.at:128' \
14986  "Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  " "" 3
14987at_xfail=no
14988(
14989  $as_echo "72. $at_setup_line: testing $at_desc ..."
14990  $at_traceon
14991
14992
14993for 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
14997done
14998cat >gram_dir/foo.yy <<'_ATEOF'
14999%skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"
15000%%
15001foo: {};
15002_ATEOF
15003
15004
15005if 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 "
15013at_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>&-
15017at_status=$? at_failed=false
15018$at_check_filter
15019echo stderr:; cat "$at_stderr"
15020echo stdout:; cat "$at_stdout"
15021at_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 "
15027at_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>&-
15030at_status=$? at_failed=false
15031$at_check_filter
15032echo stderr:; cat "$at_stderr"
15033echo stdout:; cat "$at_stdout"
15034at_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"
15043at_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>&-
15048at_status=$? at_failed=false
15049$at_check_filter
15050at_fn_diff_devnull "$at_stderr" || at_failed=:
15051$at_diff expout "$at_stdout" || at_failed=:
15052at_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"
15061at_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>&-
15066at_status=$? at_failed=false
15067$at_check_filter
15068at_fn_diff_devnull "$at_stderr" || at_failed=:
15069$at_diff expout "$at_stdout" || at_failed=:
15070at_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
15076fi
15077{ set +x
15078$as_echo "$at_srcdir/output.at:128: bison  gram_dir/foo.yy "
15079at_fn_check_prepare_trace "output.at:128"
15080( $at_check_trace; bison  gram_dir/foo.yy
15081) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15082at_status=$? at_failed=false
15083$at_check_filter
15084at_fn_diff_devnull "$at_stderr" || at_failed=:
15085at_fn_diff_devnull "$at_stdout" || at_failed=:
15086at_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"
15093at_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>&-
15096at_status=$? at_failed=false
15097$at_check_filter
15098at_fn_diff_devnull "$at_stderr" || at_failed=:
15099echo stdout:; cat "$at_stdout"
15100at_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
15108read at_status <"$at_status_file"
15109#AT_STOP_72
15110#AT_START_73
15111at_fn_group_banner 73 'output.at:158' \
15112  "Conflicting output files:  --graph=\"foo.tab.c\"" " " 3
15113at_xfail=no
15114(
15115  $as_echo "73. $at_setup_line: testing $at_desc ..."
15116  $at_traceon
15117
15118case "foo.y" in
15119  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
15120esac
15121cat >foo.y <<'_ATEOF'
15122
15123%%
15124foo: {};
15125_ATEOF
15126
15127
15128cp 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"
15135at_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>&-
15138at_status=$? at_failed=false
15139$at_check_filter
15140echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.tab.c'
15141" | \
15142  $at_diff - "$at_stderr" || at_failed=:
15143at_fn_diff_devnull "$at_stdout" || at_failed=:
15144at_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.
15151if 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"
15160at_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>&-
15163at_status=$? at_failed=false
15164$at_check_filter
15165echo stderr:; tee stderr <"$at_stderr"
15166$at_diff expout "$at_stdout" || at_failed=:
15167at_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'
15175foo.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"
15205at_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>&-
15209at_status=$? at_failed=false
15210$at_check_filter
15211$at_diff experr "$at_stderr" || at_failed=:
15212at_fn_diff_devnull "$at_stdout" || at_failed=:
15213at_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"
15222at_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>&-
15225at_status=$? at_failed=false
15226$at_check_filter
15227$at_diff experr "$at_stderr" || at_failed=:
15228$at_diff expout "$at_stdout" || at_failed=:
15229at_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"
15239at_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>&-
15242at_status=$? at_failed=false
15243$at_check_filter
15244at_fn_diff_devnull "$at_stderr" || at_failed=:
15245$at_diff expout "$at_stdout" || at_failed=:
15246at_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"
15252at_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>&-
15255at_status=$? at_failed=false
15256$at_check_filter
15257at_fn_diff_devnull "$at_stderr" || at_failed=:
15258$at_diff expout "$at_stdout" || at_failed=:
15259at_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
15265fi
15266{ set +x
15267$as_echo "$at_srcdir/output.at:158: cat foo.y"
15268at_fn_check_prepare_trace "output.at:158"
15269( $at_check_trace; cat foo.y
15270) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15271at_status=$? at_failed=false
15272$at_check_filter
15273at_fn_diff_devnull "$at_stderr" || at_failed=:
15274$at_diff expout "$at_stdout" || at_failed=:
15275at_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
15282read at_status <"$at_status_file"
15283#AT_STOP_73
15284#AT_START_74
15285at_fn_group_banner 74 'output.at:163' \
15286  "Conflicting output files: %defines \"foo.output\" -v" "" 3
15287at_xfail=no
15288(
15289  $as_echo "74. $at_setup_line: testing $at_desc ..."
15290  $at_traceon
15291
15292case "foo.y" in
15293  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
15294esac
15295cat >foo.y <<'_ATEOF'
15296%defines "foo.output"
15297%%
15298foo: {};
15299_ATEOF
15300
15301
15302cp 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"
15309at_fn_check_prepare_trace "output.at:163"
15310( $at_check_trace; bison -v foo.y
15311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15312at_status=$? at_failed=false
15313$at_check_filter
15314echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.output'
15315" | \
15316  $at_diff - "$at_stderr" || at_failed=:
15317at_fn_diff_devnull "$at_stdout" || at_failed=:
15318at_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.
15325if 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"
15334at_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>&-
15337at_status=$? at_failed=false
15338$at_check_filter
15339echo stderr:; tee stderr <"$at_stderr"
15340$at_diff expout "$at_stdout" || at_failed=:
15341at_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'
15349foo.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"
15379at_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>&-
15383at_status=$? at_failed=false
15384$at_check_filter
15385$at_diff experr "$at_stderr" || at_failed=:
15386at_fn_diff_devnull "$at_stdout" || at_failed=:
15387at_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"
15396at_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>&-
15399at_status=$? at_failed=false
15400$at_check_filter
15401$at_diff experr "$at_stderr" || at_failed=:
15402$at_diff expout "$at_stdout" || at_failed=:
15403at_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"
15413at_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>&-
15416at_status=$? at_failed=false
15417$at_check_filter
15418at_fn_diff_devnull "$at_stderr" || at_failed=:
15419$at_diff expout "$at_stdout" || at_failed=:
15420at_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"
15426at_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>&-
15429at_status=$? at_failed=false
15430$at_check_filter
15431at_fn_diff_devnull "$at_stderr" || at_failed=:
15432$at_diff expout "$at_stdout" || at_failed=:
15433at_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
15439fi
15440{ set +x
15441$as_echo "$at_srcdir/output.at:163: cat foo.y"
15442at_fn_check_prepare_trace "output.at:163"
15443( $at_check_trace; cat foo.y
15444) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15445at_status=$? at_failed=false
15446$at_check_filter
15447at_fn_diff_devnull "$at_stderr" || at_failed=:
15448$at_diff expout "$at_stdout" || at_failed=:
15449at_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
15456read at_status <"$at_status_file"
15457#AT_STOP_74
15458#AT_START_75
15459at_fn_group_banner 75 'output.at:168' \
15460  "Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\"" "" 3
15461at_xfail=no
15462(
15463  $as_echo "75. $at_setup_line: testing $at_desc ..."
15464  $at_traceon
15465
15466case "foo.y" in
15467  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
15468esac
15469cat >foo.y <<'_ATEOF'
15470%skeleton "lalr1.cc" %defines
15471%%
15472foo: {};
15473_ATEOF
15474
15475
15476cp 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"
15483at_fn_check_prepare_trace "output.at:168"
15484( $at_check_trace; bison --graph="location.hh" foo.y
15485) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15486at_status=$? at_failed=false
15487$at_check_filter
15488echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'location.hh'
15489" | \
15490  $at_diff - "$at_stderr" || at_failed=:
15491at_fn_diff_devnull "$at_stdout" || at_failed=:
15492at_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.
15499if 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"
15508at_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>&-
15511at_status=$? at_failed=false
15512$at_check_filter
15513echo stderr:; tee stderr <"$at_stderr"
15514$at_diff expout "$at_stdout" || at_failed=:
15515at_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'
15523foo.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"
15553at_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>&-
15557at_status=$? at_failed=false
15558$at_check_filter
15559$at_diff experr "$at_stderr" || at_failed=:
15560at_fn_diff_devnull "$at_stdout" || at_failed=:
15561at_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"
15570at_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>&-
15573at_status=$? at_failed=false
15574$at_check_filter
15575$at_diff experr "$at_stderr" || at_failed=:
15576$at_diff expout "$at_stdout" || at_failed=:
15577at_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"
15587at_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>&-
15590at_status=$? at_failed=false
15591$at_check_filter
15592at_fn_diff_devnull "$at_stderr" || at_failed=:
15593$at_diff expout "$at_stdout" || at_failed=:
15594at_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"
15600at_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>&-
15603at_status=$? at_failed=false
15604$at_check_filter
15605at_fn_diff_devnull "$at_stderr" || at_failed=:
15606$at_diff expout "$at_stdout" || at_failed=:
15607at_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
15613fi
15614{ set +x
15615$as_echo "$at_srcdir/output.at:168: cat foo.y"
15616at_fn_check_prepare_trace "output.at:168"
15617( $at_check_trace; cat foo.y
15618) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15619at_status=$? at_failed=false
15620$at_check_filter
15621at_fn_diff_devnull "$at_stderr" || at_failed=:
15622$at_diff expout "$at_stdout" || at_failed=:
15623at_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
15630read at_status <"$at_status_file"
15631#AT_STOP_75
15632#AT_START_76
15633at_fn_group_banner 76 'output.at:173' \
15634  "Conflicting output files:  -o foo.y" "            " 3
15635at_xfail=no
15636(
15637  $as_echo "76. $at_setup_line: testing $at_desc ..."
15638  $at_traceon
15639
15640case "foo.y" in
15641  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
15642esac
15643cat >foo.y <<'_ATEOF'
15644
15645%%
15646foo: {};
15647_ATEOF
15648
15649
15650cp 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"
15657at_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>&-
15660at_status=$? at_failed=false
15661$at_check_filter
15662echo >>"$at_stderr"; $as_echo "foo.y: error: refusing to overwrite the input file 'foo.y'
15663" | \
15664  $at_diff - "$at_stderr" || at_failed=:
15665at_fn_diff_devnull "$at_stdout" || at_failed=:
15666at_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"
15673at_fn_check_prepare_trace "output.at:173"
15674( $at_check_trace; cat foo.y
15675) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15676at_status=$? at_failed=false
15677$at_check_filter
15678at_fn_diff_devnull "$at_stderr" || at_failed=:
15679$at_diff expout "$at_stdout" || at_failed=:
15680at_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
15687read at_status <"$at_status_file"
15688#AT_STOP_76
15689#AT_START_77
15690at_fn_group_banner 77 'output.at:219' \
15691  "Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 3
15692at_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"
15703at_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>&-
15706at_status=$? at_failed=false
15707$at_check_filter
15708at_fn_diff_devnull "$at_stderr" || at_failed=:
15709at_fn_diff_devnull "$at_stdout" || at_failed=:
15710at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
15711$at_failed && at_fn_log_failure
15712$at_traceon; }
15713
15714
15715cat >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 {
15726void yyerror ( const char *msg);
15727int yylex (void);
15728}
15729%%
15730start: {};
15731_ATEOF
15732
15733
15734if 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"
15742at_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>&-
15746at_status=$? at_failed=false
15747$at_check_filter
15748echo stderr:; cat "$at_stderr"
15749echo stdout:; cat "$at_stdout"
15750at_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"
15756at_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>&-
15759at_status=$? at_failed=false
15760$at_check_filter
15761echo stderr:; cat "$at_stderr"
15762echo stdout:; cat "$at_stdout"
15763at_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"
15772at_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>&-
15777at_status=$? at_failed=false
15778$at_check_filter
15779at_fn_diff_devnull "$at_stderr" || at_failed=:
15780$at_diff expout "$at_stdout" || at_failed=:
15781at_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"
15790at_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>&-
15795at_status=$? at_failed=false
15796$at_check_filter
15797at_fn_diff_devnull "$at_stderr" || at_failed=:
15798$at_diff expout "$at_stdout" || at_failed=:
15799at_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
15805fi
15806{ set +x
15807$as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
15808at_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>&-
15811at_status=$? at_failed=false
15812$at_check_filter
15813at_fn_diff_devnull "$at_stderr" || at_failed=:
15814at_fn_diff_devnull "$at_stdout" || at_failed=:
15815at_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\""
15822at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
15823( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
15824) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15825at_status=$? at_failed=false
15826$at_check_filter
15827at_fn_diff_devnull "$at_stderr" || at_failed=:
15828echo stdout:; cat "$at_stdout"
15829at_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"
15835at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:219"
15836( $at_check_trace; $BISON_C_WORKS
15837) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15838at_status=$? at_failed=false
15839$at_check_filter
15840echo stderr:; cat "$at_stderr"
15841echo stdout:; cat "$at_stdout"
15842at_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\" "
15848at_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>&-
15851at_status=$? at_failed=false
15852$at_check_filter
15853echo stderr:; cat "$at_stderr"
15854echo stdout:; cat "$at_stdout"
15855at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
15856$at_failed && at_fn_log_failure
15857$at_traceon; }
15858
15859
15860
15861cat >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%%
15873start: {};
15874_ATEOF
15875
15876
15877if 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"
15885at_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>&-
15889at_status=$? at_failed=false
15890$at_check_filter
15891echo stderr:; cat "$at_stderr"
15892echo stdout:; cat "$at_stdout"
15893at_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"
15899at_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>&-
15902at_status=$? at_failed=false
15903$at_check_filter
15904echo stderr:; cat "$at_stderr"
15905echo stdout:; cat "$at_stdout"
15906at_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"
15915at_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>&-
15920at_status=$? at_failed=false
15921$at_check_filter
15922at_fn_diff_devnull "$at_stderr" || at_failed=:
15923$at_diff expout "$at_stdout" || at_failed=:
15924at_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"
15933at_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>&-
15938at_status=$? at_failed=false
15939$at_check_filter
15940at_fn_diff_devnull "$at_stderr" || at_failed=:
15941$at_diff expout "$at_stdout" || at_failed=:
15942at_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
15948fi
15949{ set +x
15950$as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
15951at_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>&-
15954at_status=$? at_failed=false
15955$at_check_filter
15956at_fn_diff_devnull "$at_stderr" || at_failed=:
15957at_fn_diff_devnull "$at_stdout" || at_failed=:
15958at_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\""
15965at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
15966( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
15967) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15968at_status=$? at_failed=false
15969$at_check_filter
15970at_fn_diff_devnull "$at_stderr" || at_failed=:
15971echo stdout:; cat "$at_stdout"
15972at_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"
15979at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:219"
15980( $at_check_trace; $BISON_CXX_WORKS
15981) >>"$at_stdout" 2>>"$at_stderr" 5>&-
15982at_status=$? at_failed=false
15983$at_check_filter
15984echo stderr:; cat "$at_stderr"
15985echo stdout:; cat "$at_stdout"
15986at_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\" "
15992at_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>&-
15995at_status=$? at_failed=false
15996$at_check_filter
15997echo stderr:; cat "$at_stderr"
15998echo stdout:; cat "$at_stdout"
15999at_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
16009read at_status <"$at_status_file"
16010#AT_STOP_77
16011#AT_START_78
16012at_fn_group_banner 78 'output.at:226' \
16013  "Output file name: (" "                            " 3
16014at_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"
16025at_fn_check_prepare_trace "output.at:226"
16026( $at_check_trace; touch "(.tmp" || exit 77
16027) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16028at_status=$? at_failed=false
16029$at_check_filter
16030at_fn_diff_devnull "$at_stderr" || at_failed=:
16031at_fn_diff_devnull "$at_stdout" || at_failed=:
16032at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
16033$at_failed && at_fn_log_failure
16034$at_traceon; }
16035
16036
16037cat >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 {
16048void yyerror ( const char *msg);
16049int yylex (void);
16050}
16051%%
16052start: {};
16053_ATEOF
16054
16055
16056if 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"
16064at_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>&-
16068at_status=$? at_failed=false
16069$at_check_filter
16070echo stderr:; cat "$at_stderr"
16071echo stdout:; cat "$at_stdout"
16072at_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"
16078at_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>&-
16081at_status=$? at_failed=false
16082$at_check_filter
16083echo stderr:; cat "$at_stderr"
16084echo stdout:; cat "$at_stdout"
16085at_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"
16094at_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>&-
16099at_status=$? at_failed=false
16100$at_check_filter
16101at_fn_diff_devnull "$at_stderr" || at_failed=:
16102$at_diff expout "$at_stdout" || at_failed=:
16103at_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"
16112at_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>&-
16117at_status=$? at_failed=false
16118$at_check_filter
16119at_fn_diff_devnull "$at_stderr" || at_failed=:
16120$at_diff expout "$at_stdout" || at_failed=:
16121at_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
16127fi
16128{ set +x
16129$as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" glr.y"
16130at_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>&-
16133at_status=$? at_failed=false
16134$at_check_filter
16135at_fn_diff_devnull "$at_stderr" || at_failed=:
16136at_fn_diff_devnull "$at_stdout" || at_failed=:
16137at_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\""
16144at_fn_check_prepare_trace "output.at:226"
16145( $at_check_trace; ls "(.c" "(.h"
16146) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16147at_status=$? at_failed=false
16148$at_check_filter
16149at_fn_diff_devnull "$at_stderr" || at_failed=:
16150echo stdout:; cat "$at_stdout"
16151at_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"
16157at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:226"
16158( $at_check_trace; $BISON_C_WORKS
16159) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16160at_status=$? at_failed=false
16161$at_check_filter
16162echo stderr:; cat "$at_stderr"
16163echo stdout:; cat "$at_stdout"
16164at_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\" "
16170at_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>&-
16173at_status=$? at_failed=false
16174$at_check_filter
16175echo stderr:; cat "$at_stderr"
16176echo stdout:; cat "$at_stdout"
16177at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
16178$at_failed && at_fn_log_failure
16179$at_traceon; }
16180
16181
16182
16183cat >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%%
16195start: {};
16196_ATEOF
16197
16198
16199if 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"
16207at_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>&-
16211at_status=$? at_failed=false
16212$at_check_filter
16213echo stderr:; cat "$at_stderr"
16214echo stdout:; cat "$at_stdout"
16215at_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"
16221at_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>&-
16224at_status=$? at_failed=false
16225$at_check_filter
16226echo stderr:; cat "$at_stderr"
16227echo stdout:; cat "$at_stdout"
16228at_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"
16237at_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>&-
16242at_status=$? at_failed=false
16243$at_check_filter
16244at_fn_diff_devnull "$at_stderr" || at_failed=:
16245$at_diff expout "$at_stdout" || at_failed=:
16246at_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"
16255at_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>&-
16260at_status=$? at_failed=false
16261$at_check_filter
16262at_fn_diff_devnull "$at_stderr" || at_failed=:
16263$at_diff expout "$at_stdout" || at_failed=:
16264at_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
16270fi
16271{ set +x
16272$as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" cxx.y"
16273at_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>&-
16276at_status=$? at_failed=false
16277$at_check_filter
16278at_fn_diff_devnull "$at_stderr" || at_failed=:
16279at_fn_diff_devnull "$at_stdout" || at_failed=:
16280at_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\""
16287at_fn_check_prepare_trace "output.at:226"
16288( $at_check_trace; ls "(.c" "(.h"
16289) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16290at_status=$? at_failed=false
16291$at_check_filter
16292at_fn_diff_devnull "$at_stderr" || at_failed=:
16293echo stdout:; cat "$at_stdout"
16294at_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"
16301at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:226"
16302( $at_check_trace; $BISON_CXX_WORKS
16303) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16304at_status=$? at_failed=false
16305$at_check_filter
16306echo stderr:; cat "$at_stderr"
16307echo stdout:; cat "$at_stdout"
16308at_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\" "
16314at_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>&-
16317at_status=$? at_failed=false
16318$at_check_filter
16319echo stderr:; cat "$at_stderr"
16320echo stdout:; cat "$at_stdout"
16321at_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
16331read at_status <"$at_status_file"
16332#AT_STOP_78
16333#AT_START_79
16334at_fn_group_banner 79 'output.at:227' \
16335  "Output file name: )" "                            " 3
16336at_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"
16347at_fn_check_prepare_trace "output.at:227"
16348( $at_check_trace; touch ").tmp" || exit 77
16349) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16350at_status=$? at_failed=false
16351$at_check_filter
16352at_fn_diff_devnull "$at_stderr" || at_failed=:
16353at_fn_diff_devnull "$at_stdout" || at_failed=:
16354at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
16355$at_failed && at_fn_log_failure
16356$at_traceon; }
16357
16358
16359cat >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 {
16370void yyerror ( const char *msg);
16371int yylex (void);
16372}
16373%%
16374start: {};
16375_ATEOF
16376
16377
16378if 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"
16386at_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>&-
16390at_status=$? at_failed=false
16391$at_check_filter
16392echo stderr:; cat "$at_stderr"
16393echo stdout:; cat "$at_stdout"
16394at_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"
16400at_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>&-
16403at_status=$? at_failed=false
16404$at_check_filter
16405echo stderr:; cat "$at_stderr"
16406echo stdout:; cat "$at_stdout"
16407at_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"
16416at_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>&-
16421at_status=$? at_failed=false
16422$at_check_filter
16423at_fn_diff_devnull "$at_stderr" || at_failed=:
16424$at_diff expout "$at_stdout" || at_failed=:
16425at_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"
16434at_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>&-
16439at_status=$? at_failed=false
16440$at_check_filter
16441at_fn_diff_devnull "$at_stderr" || at_failed=:
16442$at_diff expout "$at_stdout" || at_failed=:
16443at_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
16449fi
16450{ set +x
16451$as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" glr.y"
16452at_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>&-
16455at_status=$? at_failed=false
16456$at_check_filter
16457at_fn_diff_devnull "$at_stderr" || at_failed=:
16458at_fn_diff_devnull "$at_stdout" || at_failed=:
16459at_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\""
16466at_fn_check_prepare_trace "output.at:227"
16467( $at_check_trace; ls ").c" ").h"
16468) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16469at_status=$? at_failed=false
16470$at_check_filter
16471at_fn_diff_devnull "$at_stderr" || at_failed=:
16472echo stdout:; cat "$at_stdout"
16473at_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"
16479at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:227"
16480( $at_check_trace; $BISON_C_WORKS
16481) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16482at_status=$? at_failed=false
16483$at_check_filter
16484echo stderr:; cat "$at_stderr"
16485echo stdout:; cat "$at_stdout"
16486at_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\" "
16492at_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>&-
16495at_status=$? at_failed=false
16496$at_check_filter
16497echo stderr:; cat "$at_stderr"
16498echo stdout:; cat "$at_stdout"
16499at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
16500$at_failed && at_fn_log_failure
16501$at_traceon; }
16502
16503
16504
16505cat >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%%
16517start: {};
16518_ATEOF
16519
16520
16521if 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"
16529at_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>&-
16533at_status=$? at_failed=false
16534$at_check_filter
16535echo stderr:; cat "$at_stderr"
16536echo stdout:; cat "$at_stdout"
16537at_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"
16543at_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>&-
16546at_status=$? at_failed=false
16547$at_check_filter
16548echo stderr:; cat "$at_stderr"
16549echo stdout:; cat "$at_stdout"
16550at_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"
16559at_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>&-
16564at_status=$? at_failed=false
16565$at_check_filter
16566at_fn_diff_devnull "$at_stderr" || at_failed=:
16567$at_diff expout "$at_stdout" || at_failed=:
16568at_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"
16577at_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>&-
16582at_status=$? at_failed=false
16583$at_check_filter
16584at_fn_diff_devnull "$at_stderr" || at_failed=:
16585$at_diff expout "$at_stdout" || at_failed=:
16586at_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
16592fi
16593{ set +x
16594$as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" cxx.y"
16595at_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>&-
16598at_status=$? at_failed=false
16599$at_check_filter
16600at_fn_diff_devnull "$at_stderr" || at_failed=:
16601at_fn_diff_devnull "$at_stdout" || at_failed=:
16602at_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\""
16609at_fn_check_prepare_trace "output.at:227"
16610( $at_check_trace; ls ").c" ").h"
16611) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16612at_status=$? at_failed=false
16613$at_check_filter
16614at_fn_diff_devnull "$at_stderr" || at_failed=:
16615echo stdout:; cat "$at_stdout"
16616at_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"
16623at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:227"
16624( $at_check_trace; $BISON_CXX_WORKS
16625) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16626at_status=$? at_failed=false
16627$at_check_filter
16628echo stderr:; cat "$at_stderr"
16629echo stdout:; cat "$at_stdout"
16630at_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\" "
16636at_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>&-
16639at_status=$? at_failed=false
16640$at_check_filter
16641echo stderr:; cat "$at_stderr"
16642echo stdout:; cat "$at_stdout"
16643at_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
16653read at_status <"$at_status_file"
16654#AT_STOP_79
16655#AT_START_80
16656at_fn_group_banner 80 'output.at:228' \
16657  "Output file name: #" "                            " 3
16658at_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"
16669at_fn_check_prepare_trace "output.at:228"
16670( $at_check_trace; touch "#.tmp" || exit 77
16671) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16672at_status=$? at_failed=false
16673$at_check_filter
16674at_fn_diff_devnull "$at_stderr" || at_failed=:
16675at_fn_diff_devnull "$at_stdout" || at_failed=:
16676at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
16677$at_failed && at_fn_log_failure
16678$at_traceon; }
16679
16680
16681cat >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 {
16692void yyerror ( const char *msg);
16693int yylex (void);
16694}
16695%%
16696start: {};
16697_ATEOF
16698
16699
16700if 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"
16708at_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>&-
16712at_status=$? at_failed=false
16713$at_check_filter
16714echo stderr:; cat "$at_stderr"
16715echo stdout:; cat "$at_stdout"
16716at_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"
16722at_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>&-
16725at_status=$? at_failed=false
16726$at_check_filter
16727echo stderr:; cat "$at_stderr"
16728echo stdout:; cat "$at_stdout"
16729at_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"
16738at_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>&-
16743at_status=$? at_failed=false
16744$at_check_filter
16745at_fn_diff_devnull "$at_stderr" || at_failed=:
16746$at_diff expout "$at_stdout" || at_failed=:
16747at_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"
16756at_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>&-
16761at_status=$? at_failed=false
16762$at_check_filter
16763at_fn_diff_devnull "$at_stderr" || at_failed=:
16764$at_diff expout "$at_stdout" || at_failed=:
16765at_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
16771fi
16772{ set +x
16773$as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" glr.y"
16774at_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>&-
16777at_status=$? at_failed=false
16778$at_check_filter
16779at_fn_diff_devnull "$at_stderr" || at_failed=:
16780at_fn_diff_devnull "$at_stdout" || at_failed=:
16781at_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\""
16788at_fn_check_prepare_trace "output.at:228"
16789( $at_check_trace; ls "#.c" "#.h"
16790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16791at_status=$? at_failed=false
16792$at_check_filter
16793at_fn_diff_devnull "$at_stderr" || at_failed=:
16794echo stdout:; cat "$at_stdout"
16795at_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"
16801at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:228"
16802( $at_check_trace; $BISON_C_WORKS
16803) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16804at_status=$? at_failed=false
16805$at_check_filter
16806echo stderr:; cat "$at_stderr"
16807echo stdout:; cat "$at_stdout"
16808at_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\" "
16814at_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>&-
16817at_status=$? at_failed=false
16818$at_check_filter
16819echo stderr:; cat "$at_stderr"
16820echo stdout:; cat "$at_stdout"
16821at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
16822$at_failed && at_fn_log_failure
16823$at_traceon; }
16824
16825
16826
16827cat >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%%
16839start: {};
16840_ATEOF
16841
16842
16843if 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"
16851at_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>&-
16855at_status=$? at_failed=false
16856$at_check_filter
16857echo stderr:; cat "$at_stderr"
16858echo stdout:; cat "$at_stdout"
16859at_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"
16865at_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>&-
16868at_status=$? at_failed=false
16869$at_check_filter
16870echo stderr:; cat "$at_stderr"
16871echo stdout:; cat "$at_stdout"
16872at_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"
16881at_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>&-
16886at_status=$? at_failed=false
16887$at_check_filter
16888at_fn_diff_devnull "$at_stderr" || at_failed=:
16889$at_diff expout "$at_stdout" || at_failed=:
16890at_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"
16899at_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>&-
16904at_status=$? at_failed=false
16905$at_check_filter
16906at_fn_diff_devnull "$at_stderr" || at_failed=:
16907$at_diff expout "$at_stdout" || at_failed=:
16908at_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
16914fi
16915{ set +x
16916$as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" cxx.y"
16917at_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>&-
16920at_status=$? at_failed=false
16921$at_check_filter
16922at_fn_diff_devnull "$at_stderr" || at_failed=:
16923at_fn_diff_devnull "$at_stdout" || at_failed=:
16924at_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\""
16931at_fn_check_prepare_trace "output.at:228"
16932( $at_check_trace; ls "#.c" "#.h"
16933) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16934at_status=$? at_failed=false
16935$at_check_filter
16936at_fn_diff_devnull "$at_stderr" || at_failed=:
16937echo stdout:; cat "$at_stdout"
16938at_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"
16945at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:228"
16946( $at_check_trace; $BISON_CXX_WORKS
16947) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16948at_status=$? at_failed=false
16949$at_check_filter
16950echo stderr:; cat "$at_stderr"
16951echo stdout:; cat "$at_stdout"
16952at_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\" "
16958at_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>&-
16961at_status=$? at_failed=false
16962$at_check_filter
16963echo stderr:; cat "$at_stderr"
16964echo stdout:; cat "$at_stdout"
16965at_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
16975read at_status <"$at_status_file"
16976#AT_STOP_80
16977#AT_START_81
16978at_fn_group_banner 81 'output.at:229' \
16979  "Output file name: @@" "                           " 3
16980at_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"
16991at_fn_check_prepare_trace "output.at:229"
16992( $at_check_trace; touch "@@.tmp" || exit 77
16993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
16994at_status=$? at_failed=false
16995$at_check_filter
16996at_fn_diff_devnull "$at_stderr" || at_failed=:
16997at_fn_diff_devnull "$at_stdout" || at_failed=:
16998at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
16999$at_failed && at_fn_log_failure
17000$at_traceon; }
17001
17002
17003cat >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 {
17014void yyerror ( const char *msg);
17015int yylex (void);
17016}
17017%%
17018start: {};
17019_ATEOF
17020
17021
17022if 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"
17030at_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>&-
17034at_status=$? at_failed=false
17035$at_check_filter
17036echo stderr:; cat "$at_stderr"
17037echo stdout:; cat "$at_stdout"
17038at_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"
17044at_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>&-
17047at_status=$? at_failed=false
17048$at_check_filter
17049echo stderr:; cat "$at_stderr"
17050echo stdout:; cat "$at_stdout"
17051at_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"
17060at_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>&-
17065at_status=$? at_failed=false
17066$at_check_filter
17067at_fn_diff_devnull "$at_stderr" || at_failed=:
17068$at_diff expout "$at_stdout" || at_failed=:
17069at_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"
17078at_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>&-
17083at_status=$? at_failed=false
17084$at_check_filter
17085at_fn_diff_devnull "$at_stderr" || at_failed=:
17086$at_diff expout "$at_stdout" || at_failed=:
17087at_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
17093fi
17094{ set +x
17095$as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" glr.y"
17096at_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>&-
17099at_status=$? at_failed=false
17100$at_check_filter
17101at_fn_diff_devnull "$at_stderr" || at_failed=:
17102at_fn_diff_devnull "$at_stdout" || at_failed=:
17103at_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\""
17110at_fn_check_prepare_trace "output.at:229"
17111( $at_check_trace; ls "@@.c" "@@.h"
17112) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17113at_status=$? at_failed=false
17114$at_check_filter
17115at_fn_diff_devnull "$at_stderr" || at_failed=:
17116echo stdout:; cat "$at_stdout"
17117at_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"
17123at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:229"
17124( $at_check_trace; $BISON_C_WORKS
17125) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17126at_status=$? at_failed=false
17127$at_check_filter
17128echo stderr:; cat "$at_stderr"
17129echo stdout:; cat "$at_stdout"
17130at_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\" "
17136at_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>&-
17139at_status=$? at_failed=false
17140$at_check_filter
17141echo stderr:; cat "$at_stderr"
17142echo stdout:; cat "$at_stdout"
17143at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
17144$at_failed && at_fn_log_failure
17145$at_traceon; }
17146
17147
17148
17149cat >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%%
17161start: {};
17162_ATEOF
17163
17164
17165if 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"
17173at_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>&-
17177at_status=$? at_failed=false
17178$at_check_filter
17179echo stderr:; cat "$at_stderr"
17180echo stdout:; cat "$at_stdout"
17181at_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"
17187at_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>&-
17190at_status=$? at_failed=false
17191$at_check_filter
17192echo stderr:; cat "$at_stderr"
17193echo stdout:; cat "$at_stdout"
17194at_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"
17203at_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>&-
17208at_status=$? at_failed=false
17209$at_check_filter
17210at_fn_diff_devnull "$at_stderr" || at_failed=:
17211$at_diff expout "$at_stdout" || at_failed=:
17212at_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"
17221at_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>&-
17226at_status=$? at_failed=false
17227$at_check_filter
17228at_fn_diff_devnull "$at_stderr" || at_failed=:
17229$at_diff expout "$at_stdout" || at_failed=:
17230at_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
17236fi
17237{ set +x
17238$as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" cxx.y"
17239at_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>&-
17242at_status=$? at_failed=false
17243$at_check_filter
17244at_fn_diff_devnull "$at_stderr" || at_failed=:
17245at_fn_diff_devnull "$at_stdout" || at_failed=:
17246at_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\""
17253at_fn_check_prepare_trace "output.at:229"
17254( $at_check_trace; ls "@@.c" "@@.h"
17255) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17256at_status=$? at_failed=false
17257$at_check_filter
17258at_fn_diff_devnull "$at_stderr" || at_failed=:
17259echo stdout:; cat "$at_stdout"
17260at_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"
17267at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:229"
17268( $at_check_trace; $BISON_CXX_WORKS
17269) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17270at_status=$? at_failed=false
17271$at_check_filter
17272echo stderr:; cat "$at_stderr"
17273echo stdout:; cat "$at_stdout"
17274at_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\" "
17280at_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>&-
17283at_status=$? at_failed=false
17284$at_check_filter
17285echo stderr:; cat "$at_stderr"
17286echo stdout:; cat "$at_stdout"
17287at_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
17297read at_status <"$at_status_file"
17298#AT_STOP_81
17299#AT_START_82
17300at_fn_group_banner 82 'output.at:230' \
17301  "Output file name: @{" "                           " 3
17302at_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"
17313at_fn_check_prepare_trace "output.at:230"
17314( $at_check_trace; touch "@{.tmp" || exit 77
17315) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17316at_status=$? at_failed=false
17317$at_check_filter
17318at_fn_diff_devnull "$at_stderr" || at_failed=:
17319at_fn_diff_devnull "$at_stdout" || at_failed=:
17320at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
17321$at_failed && at_fn_log_failure
17322$at_traceon; }
17323
17324
17325cat >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 {
17336void yyerror ( const char *msg);
17337int yylex (void);
17338}
17339%%
17340start: {};
17341_ATEOF
17342
17343
17344if 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"
17352at_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>&-
17356at_status=$? at_failed=false
17357$at_check_filter
17358echo stderr:; cat "$at_stderr"
17359echo stdout:; cat "$at_stdout"
17360at_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"
17366at_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>&-
17369at_status=$? at_failed=false
17370$at_check_filter
17371echo stderr:; cat "$at_stderr"
17372echo stdout:; cat "$at_stdout"
17373at_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"
17382at_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>&-
17387at_status=$? at_failed=false
17388$at_check_filter
17389at_fn_diff_devnull "$at_stderr" || at_failed=:
17390$at_diff expout "$at_stdout" || at_failed=:
17391at_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"
17400at_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>&-
17405at_status=$? at_failed=false
17406$at_check_filter
17407at_fn_diff_devnull "$at_stderr" || at_failed=:
17408$at_diff expout "$at_stdout" || at_failed=:
17409at_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
17415fi
17416{ set +x
17417$as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" glr.y"
17418at_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>&-
17421at_status=$? at_failed=false
17422$at_check_filter
17423at_fn_diff_devnull "$at_stderr" || at_failed=:
17424at_fn_diff_devnull "$at_stdout" || at_failed=:
17425at_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\""
17432at_fn_check_prepare_trace "output.at:230"
17433( $at_check_trace; ls "@{.c" "@{.h"
17434) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17435at_status=$? at_failed=false
17436$at_check_filter
17437at_fn_diff_devnull "$at_stderr" || at_failed=:
17438echo stdout:; cat "$at_stdout"
17439at_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"
17445at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:230"
17446( $at_check_trace; $BISON_C_WORKS
17447) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17448at_status=$? at_failed=false
17449$at_check_filter
17450echo stderr:; cat "$at_stderr"
17451echo stdout:; cat "$at_stdout"
17452at_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\" "
17458at_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>&-
17461at_status=$? at_failed=false
17462$at_check_filter
17463echo stderr:; cat "$at_stderr"
17464echo stdout:; cat "$at_stdout"
17465at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
17466$at_failed && at_fn_log_failure
17467$at_traceon; }
17468
17469
17470
17471cat >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%%
17483start: {};
17484_ATEOF
17485
17486
17487if 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"
17495at_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>&-
17499at_status=$? at_failed=false
17500$at_check_filter
17501echo stderr:; cat "$at_stderr"
17502echo stdout:; cat "$at_stdout"
17503at_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"
17509at_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>&-
17512at_status=$? at_failed=false
17513$at_check_filter
17514echo stderr:; cat "$at_stderr"
17515echo stdout:; cat "$at_stdout"
17516at_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"
17525at_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>&-
17530at_status=$? at_failed=false
17531$at_check_filter
17532at_fn_diff_devnull "$at_stderr" || at_failed=:
17533$at_diff expout "$at_stdout" || at_failed=:
17534at_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"
17543at_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>&-
17548at_status=$? at_failed=false
17549$at_check_filter
17550at_fn_diff_devnull "$at_stderr" || at_failed=:
17551$at_diff expout "$at_stdout" || at_failed=:
17552at_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
17558fi
17559{ set +x
17560$as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" cxx.y"
17561at_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>&-
17564at_status=$? at_failed=false
17565$at_check_filter
17566at_fn_diff_devnull "$at_stderr" || at_failed=:
17567at_fn_diff_devnull "$at_stdout" || at_failed=:
17568at_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\""
17575at_fn_check_prepare_trace "output.at:230"
17576( $at_check_trace; ls "@{.c" "@{.h"
17577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17578at_status=$? at_failed=false
17579$at_check_filter
17580at_fn_diff_devnull "$at_stderr" || at_failed=:
17581echo stdout:; cat "$at_stdout"
17582at_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"
17589at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:230"
17590( $at_check_trace; $BISON_CXX_WORKS
17591) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17592at_status=$? at_failed=false
17593$at_check_filter
17594echo stderr:; cat "$at_stderr"
17595echo stdout:; cat "$at_stdout"
17596at_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\" "
17602at_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>&-
17605at_status=$? at_failed=false
17606$at_check_filter
17607echo stderr:; cat "$at_stderr"
17608echo stdout:; cat "$at_stdout"
17609at_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
17619read at_status <"$at_status_file"
17620#AT_STOP_82
17621#AT_START_83
17622at_fn_group_banner 83 'output.at:231' \
17623  "Output file name: @}" "                           " 3
17624at_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"
17635at_fn_check_prepare_trace "output.at:231"
17636( $at_check_trace; touch "@}.tmp" || exit 77
17637) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17638at_status=$? at_failed=false
17639$at_check_filter
17640at_fn_diff_devnull "$at_stderr" || at_failed=:
17641at_fn_diff_devnull "$at_stdout" || at_failed=:
17642at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
17643$at_failed && at_fn_log_failure
17644$at_traceon; }
17645
17646
17647cat >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 {
17658void yyerror ( const char *msg);
17659int yylex (void);
17660}
17661%%
17662start: {};
17663_ATEOF
17664
17665
17666if 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"
17674at_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>&-
17678at_status=$? at_failed=false
17679$at_check_filter
17680echo stderr:; cat "$at_stderr"
17681echo stdout:; cat "$at_stdout"
17682at_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"
17688at_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>&-
17691at_status=$? at_failed=false
17692$at_check_filter
17693echo stderr:; cat "$at_stderr"
17694echo stdout:; cat "$at_stdout"
17695at_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"
17704at_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>&-
17709at_status=$? at_failed=false
17710$at_check_filter
17711at_fn_diff_devnull "$at_stderr" || at_failed=:
17712$at_diff expout "$at_stdout" || at_failed=:
17713at_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"
17722at_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>&-
17727at_status=$? at_failed=false
17728$at_check_filter
17729at_fn_diff_devnull "$at_stderr" || at_failed=:
17730$at_diff expout "$at_stdout" || at_failed=:
17731at_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
17737fi
17738{ set +x
17739$as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" glr.y"
17740at_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>&-
17743at_status=$? at_failed=false
17744$at_check_filter
17745at_fn_diff_devnull "$at_stderr" || at_failed=:
17746at_fn_diff_devnull "$at_stdout" || at_failed=:
17747at_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\""
17754at_fn_check_prepare_trace "output.at:231"
17755( $at_check_trace; ls "@}.c" "@}.h"
17756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17757at_status=$? at_failed=false
17758$at_check_filter
17759at_fn_diff_devnull "$at_stderr" || at_failed=:
17760echo stdout:; cat "$at_stdout"
17761at_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"
17767at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:231"
17768( $at_check_trace; $BISON_C_WORKS
17769) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17770at_status=$? at_failed=false
17771$at_check_filter
17772echo stderr:; cat "$at_stderr"
17773echo stdout:; cat "$at_stdout"
17774at_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\" "
17780at_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>&-
17783at_status=$? at_failed=false
17784$at_check_filter
17785echo stderr:; cat "$at_stderr"
17786echo stdout:; cat "$at_stdout"
17787at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
17788$at_failed && at_fn_log_failure
17789$at_traceon; }
17790
17791
17792
17793cat >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%%
17805start: {};
17806_ATEOF
17807
17808
17809if 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"
17817at_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>&-
17821at_status=$? at_failed=false
17822$at_check_filter
17823echo stderr:; cat "$at_stderr"
17824echo stdout:; cat "$at_stdout"
17825at_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"
17831at_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>&-
17834at_status=$? at_failed=false
17835$at_check_filter
17836echo stderr:; cat "$at_stderr"
17837echo stdout:; cat "$at_stdout"
17838at_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"
17847at_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>&-
17852at_status=$? at_failed=false
17853$at_check_filter
17854at_fn_diff_devnull "$at_stderr" || at_failed=:
17855$at_diff expout "$at_stdout" || at_failed=:
17856at_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"
17865at_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>&-
17870at_status=$? at_failed=false
17871$at_check_filter
17872at_fn_diff_devnull "$at_stderr" || at_failed=:
17873$at_diff expout "$at_stdout" || at_failed=:
17874at_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
17880fi
17881{ set +x
17882$as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" cxx.y"
17883at_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>&-
17886at_status=$? at_failed=false
17887$at_check_filter
17888at_fn_diff_devnull "$at_stderr" || at_failed=:
17889at_fn_diff_devnull "$at_stdout" || at_failed=:
17890at_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\""
17897at_fn_check_prepare_trace "output.at:231"
17898( $at_check_trace; ls "@}.c" "@}.h"
17899) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17900at_status=$? at_failed=false
17901$at_check_filter
17902at_fn_diff_devnull "$at_stderr" || at_failed=:
17903echo stdout:; cat "$at_stdout"
17904at_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"
17911at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:231"
17912( $at_check_trace; $BISON_CXX_WORKS
17913) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17914at_status=$? at_failed=false
17915$at_check_filter
17916echo stderr:; cat "$at_stderr"
17917echo stdout:; cat "$at_stdout"
17918at_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\" "
17924at_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>&-
17927at_status=$? at_failed=false
17928$at_check_filter
17929echo stderr:; cat "$at_stderr"
17930echo stdout:; cat "$at_stdout"
17931at_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
17941read at_status <"$at_status_file"
17942#AT_STOP_83
17943#AT_START_84
17944at_fn_group_banner 84 'output.at:232' \
17945  "Output file name: [" "                            " 3
17946at_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"
17957at_fn_check_prepare_trace "output.at:232"
17958( $at_check_trace; touch "[.tmp" || exit 77
17959) >>"$at_stdout" 2>>"$at_stderr" 5>&-
17960at_status=$? at_failed=false
17961$at_check_filter
17962at_fn_diff_devnull "$at_stderr" || at_failed=:
17963at_fn_diff_devnull "$at_stdout" || at_failed=:
17964at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
17965$at_failed && at_fn_log_failure
17966$at_traceon; }
17967
17968
17969cat >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 {
17980void yyerror ( const char *msg);
17981int yylex (void);
17982}
17983%%
17984start: {};
17985_ATEOF
17986
17987
17988if 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"
17996at_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>&-
18000at_status=$? at_failed=false
18001$at_check_filter
18002echo stderr:; cat "$at_stderr"
18003echo stdout:; cat "$at_stdout"
18004at_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"
18010at_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>&-
18013at_status=$? at_failed=false
18014$at_check_filter
18015echo stderr:; cat "$at_stderr"
18016echo stdout:; cat "$at_stdout"
18017at_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"
18026at_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>&-
18031at_status=$? at_failed=false
18032$at_check_filter
18033at_fn_diff_devnull "$at_stderr" || at_failed=:
18034$at_diff expout "$at_stdout" || at_failed=:
18035at_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"
18044at_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>&-
18049at_status=$? at_failed=false
18050$at_check_filter
18051at_fn_diff_devnull "$at_stderr" || at_failed=:
18052$at_diff expout "$at_stdout" || at_failed=:
18053at_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
18059fi
18060{ set +x
18061$as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" glr.y"
18062at_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>&-
18065at_status=$? at_failed=false
18066$at_check_filter
18067at_fn_diff_devnull "$at_stderr" || at_failed=:
18068at_fn_diff_devnull "$at_stdout" || at_failed=:
18069at_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\""
18076at_fn_check_prepare_trace "output.at:232"
18077( $at_check_trace; ls "[.c" "[.h"
18078) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18079at_status=$? at_failed=false
18080$at_check_filter
18081at_fn_diff_devnull "$at_stderr" || at_failed=:
18082echo stdout:; cat "$at_stdout"
18083at_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"
18089at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:232"
18090( $at_check_trace; $BISON_C_WORKS
18091) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18092at_status=$? at_failed=false
18093$at_check_filter
18094echo stderr:; cat "$at_stderr"
18095echo stdout:; cat "$at_stdout"
18096at_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\" "
18102at_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>&-
18105at_status=$? at_failed=false
18106$at_check_filter
18107echo stderr:; cat "$at_stderr"
18108echo stdout:; cat "$at_stdout"
18109at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
18110$at_failed && at_fn_log_failure
18111$at_traceon; }
18112
18113
18114
18115cat >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%%
18127start: {};
18128_ATEOF
18129
18130
18131if 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"
18139at_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>&-
18143at_status=$? at_failed=false
18144$at_check_filter
18145echo stderr:; cat "$at_stderr"
18146echo stdout:; cat "$at_stdout"
18147at_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"
18153at_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>&-
18156at_status=$? at_failed=false
18157$at_check_filter
18158echo stderr:; cat "$at_stderr"
18159echo stdout:; cat "$at_stdout"
18160at_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"
18169at_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>&-
18174at_status=$? at_failed=false
18175$at_check_filter
18176at_fn_diff_devnull "$at_stderr" || at_failed=:
18177$at_diff expout "$at_stdout" || at_failed=:
18178at_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"
18187at_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>&-
18192at_status=$? at_failed=false
18193$at_check_filter
18194at_fn_diff_devnull "$at_stderr" || at_failed=:
18195$at_diff expout "$at_stdout" || at_failed=:
18196at_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
18202fi
18203{ set +x
18204$as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" cxx.y"
18205at_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>&-
18208at_status=$? at_failed=false
18209$at_check_filter
18210at_fn_diff_devnull "$at_stderr" || at_failed=:
18211at_fn_diff_devnull "$at_stdout" || at_failed=:
18212at_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\""
18219at_fn_check_prepare_trace "output.at:232"
18220( $at_check_trace; ls "[.c" "[.h"
18221) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18222at_status=$? at_failed=false
18223$at_check_filter
18224at_fn_diff_devnull "$at_stderr" || at_failed=:
18225echo stdout:; cat "$at_stdout"
18226at_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"
18233at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:232"
18234( $at_check_trace; $BISON_CXX_WORKS
18235) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18236at_status=$? at_failed=false
18237$at_check_filter
18238echo stderr:; cat "$at_stderr"
18239echo stdout:; cat "$at_stdout"
18240at_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\" "
18246at_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>&-
18249at_status=$? at_failed=false
18250$at_check_filter
18251echo stderr:; cat "$at_stderr"
18252echo stdout:; cat "$at_stdout"
18253at_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
18263read at_status <"$at_status_file"
18264#AT_STOP_84
18265#AT_START_85
18266at_fn_group_banner 85 'output.at:233' \
18267  "Output file name: ]" "                            " 3
18268at_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"
18279at_fn_check_prepare_trace "output.at:233"
18280( $at_check_trace; touch "].tmp" || exit 77
18281) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18282at_status=$? at_failed=false
18283$at_check_filter
18284at_fn_diff_devnull "$at_stderr" || at_failed=:
18285at_fn_diff_devnull "$at_stdout" || at_failed=:
18286at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
18287$at_failed && at_fn_log_failure
18288$at_traceon; }
18289
18290
18291cat >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 {
18302void yyerror ( const char *msg);
18303int yylex (void);
18304}
18305%%
18306start: {};
18307_ATEOF
18308
18309
18310if 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"
18318at_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>&-
18322at_status=$? at_failed=false
18323$at_check_filter
18324echo stderr:; cat "$at_stderr"
18325echo stdout:; cat "$at_stdout"
18326at_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"
18332at_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>&-
18335at_status=$? at_failed=false
18336$at_check_filter
18337echo stderr:; cat "$at_stderr"
18338echo stdout:; cat "$at_stdout"
18339at_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"
18348at_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>&-
18353at_status=$? at_failed=false
18354$at_check_filter
18355at_fn_diff_devnull "$at_stderr" || at_failed=:
18356$at_diff expout "$at_stdout" || at_failed=:
18357at_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"
18366at_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>&-
18371at_status=$? at_failed=false
18372$at_check_filter
18373at_fn_diff_devnull "$at_stderr" || at_failed=:
18374$at_diff expout "$at_stdout" || at_failed=:
18375at_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
18381fi
18382{ set +x
18383$as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" glr.y"
18384at_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>&-
18387at_status=$? at_failed=false
18388$at_check_filter
18389at_fn_diff_devnull "$at_stderr" || at_failed=:
18390at_fn_diff_devnull "$at_stdout" || at_failed=:
18391at_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\""
18398at_fn_check_prepare_trace "output.at:233"
18399( $at_check_trace; ls "].c" "].h"
18400) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18401at_status=$? at_failed=false
18402$at_check_filter
18403at_fn_diff_devnull "$at_stderr" || at_failed=:
18404echo stdout:; cat "$at_stdout"
18405at_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"
18411at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:233"
18412( $at_check_trace; $BISON_C_WORKS
18413) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18414at_status=$? at_failed=false
18415$at_check_filter
18416echo stderr:; cat "$at_stderr"
18417echo stdout:; cat "$at_stdout"
18418at_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\" "
18424at_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>&-
18427at_status=$? at_failed=false
18428$at_check_filter
18429echo stderr:; cat "$at_stderr"
18430echo stdout:; cat "$at_stdout"
18431at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
18432$at_failed && at_fn_log_failure
18433$at_traceon; }
18434
18435
18436
18437cat >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%%
18449start: {};
18450_ATEOF
18451
18452
18453if 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"
18461at_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>&-
18465at_status=$? at_failed=false
18466$at_check_filter
18467echo stderr:; cat "$at_stderr"
18468echo stdout:; cat "$at_stdout"
18469at_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"
18475at_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>&-
18478at_status=$? at_failed=false
18479$at_check_filter
18480echo stderr:; cat "$at_stderr"
18481echo stdout:; cat "$at_stdout"
18482at_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"
18491at_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>&-
18496at_status=$? at_failed=false
18497$at_check_filter
18498at_fn_diff_devnull "$at_stderr" || at_failed=:
18499$at_diff expout "$at_stdout" || at_failed=:
18500at_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"
18509at_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>&-
18514at_status=$? at_failed=false
18515$at_check_filter
18516at_fn_diff_devnull "$at_stderr" || at_failed=:
18517$at_diff expout "$at_stdout" || at_failed=:
18518at_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
18524fi
18525{ set +x
18526$as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" cxx.y"
18527at_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>&-
18530at_status=$? at_failed=false
18531$at_check_filter
18532at_fn_diff_devnull "$at_stderr" || at_failed=:
18533at_fn_diff_devnull "$at_stdout" || at_failed=:
18534at_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\""
18541at_fn_check_prepare_trace "output.at:233"
18542( $at_check_trace; ls "].c" "].h"
18543) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18544at_status=$? at_failed=false
18545$at_check_filter
18546at_fn_diff_devnull "$at_stderr" || at_failed=:
18547echo stdout:; cat "$at_stdout"
18548at_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"
18555at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:233"
18556( $at_check_trace; $BISON_CXX_WORKS
18557) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18558at_status=$? at_failed=false
18559$at_check_filter
18560echo stderr:; cat "$at_stderr"
18561echo stdout:; cat "$at_stdout"
18562at_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\" "
18568at_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>&-
18571at_status=$? at_failed=false
18572$at_check_filter
18573echo stderr:; cat "$at_stderr"
18574echo stdout:; cat "$at_stdout"
18575at_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
18585read at_status <"$at_status_file"
18586#AT_STOP_85
18587#AT_START_86
18588at_fn_group_banner 86 'output.at:260' \
18589  "Graph with no conflicts" "                        " 3
18590at_xfail=no
18591(
18592  $as_echo "86. $at_setup_line: testing $at_desc ..."
18593  $at_traceon
18594
18595
18596cat >input.y <<'_ATEOF'
18597%%
18598exp: a '?' b;
18599a: ;
18600b: 'b';
18601_ATEOF
18602
18603if 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"
18611at_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>&-
18615at_status=$? at_failed=false
18616$at_check_filter
18617echo stderr:; cat "$at_stderr"
18618echo stdout:; cat "$at_stdout"
18619at_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"
18625at_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>&-
18628at_status=$? at_failed=false
18629$at_check_filter
18630echo stderr:; cat "$at_stderr"
18631echo stdout:; cat "$at_stdout"
18632at_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"
18641at_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>&-
18646at_status=$? at_failed=false
18647$at_check_filter
18648at_fn_diff_devnull "$at_stderr" || at_failed=:
18649$at_diff expout "$at_stdout" || at_failed=:
18650at_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"
18659at_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>&-
18664at_status=$? at_failed=false
18665$at_check_filter
18666at_fn_diff_devnull "$at_stderr" || at_failed=:
18667$at_diff expout "$at_stdout" || at_failed=:
18668at_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
18674fi
18675{ set +x
18676$as_echo "$at_srcdir/output.at:260: bison -rall --graph input.y"
18677at_fn_check_prepare_trace "output.at:260"
18678( $at_check_trace; bison -rall --graph input.y
18679) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18680at_status=$? at_failed=false
18681$at_check_filter
18682echo stderr:; cat "$at_stderr"
18683at_fn_diff_devnull "$at_stdout" || at_failed=:
18684at_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"
18691at_fn_check_prepare_trace "output.at:260"
18692( $at_check_trace; grep -v // input.dot
18693) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18694at_status=$? at_failed=false
18695$at_check_filter
18696at_fn_diff_devnull "$at_stderr" || at_failed=:
18697echo >>"$at_stdout"; $as_echo "
18698digraph \"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=:
18727at_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
18734read at_status <"$at_status_file"
18735#AT_STOP_86
18736#AT_START_87
18737at_fn_group_banner 87 'output.at:294' \
18738  "Graph with unsolved S/R" "                        " 3
18739at_xfail=no
18740(
18741  $as_echo "87. $at_setup_line: testing $at_desc ..."
18742  $at_traceon
18743
18744
18745cat >input.y <<'_ATEOF'
18746%%
18747start:
18748    'a'
18749  | empty_a 'a'
18750  | 'b'
18751  | empty_b 'b'
18752  | 'c'
18753  | empty_c 'c'
18754  ;
18755empty_a: %prec 'a';
18756empty_b: %prec 'b';
18757empty_c: %prec 'c';
18758_ATEOF
18759
18760if 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"
18768at_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>&-
18772at_status=$? at_failed=false
18773$at_check_filter
18774echo stderr:; cat "$at_stderr"
18775echo stdout:; cat "$at_stdout"
18776at_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"
18782at_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>&-
18785at_status=$? at_failed=false
18786$at_check_filter
18787echo stderr:; cat "$at_stderr"
18788echo stdout:; cat "$at_stdout"
18789at_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"
18798at_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>&-
18803at_status=$? at_failed=false
18804$at_check_filter
18805at_fn_diff_devnull "$at_stderr" || at_failed=:
18806$at_diff expout "$at_stdout" || at_failed=:
18807at_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"
18816at_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>&-
18821at_status=$? at_failed=false
18822$at_check_filter
18823at_fn_diff_devnull "$at_stderr" || at_failed=:
18824$at_diff expout "$at_stdout" || at_failed=:
18825at_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
18831fi
18832{ set +x
18833$as_echo "$at_srcdir/output.at:294: bison -rall --graph input.y"
18834at_fn_check_prepare_trace "output.at:294"
18835( $at_check_trace; bison -rall --graph input.y
18836) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18837at_status=$? at_failed=false
18838$at_check_filter
18839echo stderr:; cat "$at_stderr"
18840at_fn_diff_devnull "$at_stdout" || at_failed=:
18841at_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"
18848at_fn_check_prepare_trace "output.at:294"
18849( $at_check_trace; grep -v // input.dot
18850) >>"$at_stdout" 2>>"$at_stderr" 5>&-
18851at_status=$? at_failed=false
18852$at_check_filter
18853at_fn_diff_devnull "$at_stderr" || at_failed=:
18854echo >>"$at_stdout"; $as_echo "
18855digraph \"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=:
18906at_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
18913read at_status <"$at_status_file"
18914#AT_STOP_87
18915#AT_START_88
18916at_fn_group_banner 88 'output.at:358' \
18917  "Graph with solved S/R" "                          " 3
18918at_xfail=no
18919(
18920  $as_echo "88. $at_setup_line: testing $at_desc ..."
18921  $at_traceon
18922
18923
18924cat >input.y <<'_ATEOF'
18925%left 'a'
18926%right 'b'
18927%right 'c'
18928%%
18929start:
18930    'a'
18931  | empty_a 'a'
18932  | 'b'
18933  | empty_b 'b'
18934  | 'c'
18935  | empty_c 'c'
18936  ;
18937empty_a: %prec 'a';
18938empty_b: %prec 'b';
18939empty_c: %prec 'c';
18940_ATEOF
18941
18942if 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"
18950at_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>&-
18954at_status=$? at_failed=false
18955$at_check_filter
18956echo stderr:; cat "$at_stderr"
18957echo stdout:; cat "$at_stdout"
18958at_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"
18964at_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>&-
18967at_status=$? at_failed=false
18968$at_check_filter
18969echo stderr:; cat "$at_stderr"
18970echo stdout:; cat "$at_stdout"
18971at_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"
18980at_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>&-
18985at_status=$? at_failed=false
18986$at_check_filter
18987at_fn_diff_devnull "$at_stderr" || at_failed=:
18988$at_diff expout "$at_stdout" || at_failed=:
18989at_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"
18998at_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>&-
19003at_status=$? at_failed=false
19004$at_check_filter
19005at_fn_diff_devnull "$at_stderr" || at_failed=:
19006$at_diff expout "$at_stdout" || at_failed=:
19007at_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
19013fi
19014{ set +x
19015$as_echo "$at_srcdir/output.at:358: bison -rall --graph input.y"
19016at_fn_check_prepare_trace "output.at:358"
19017( $at_check_trace; bison -rall --graph input.y
19018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19019at_status=$? at_failed=false
19020$at_check_filter
19021echo stderr:; cat "$at_stderr"
19022at_fn_diff_devnull "$at_stdout" || at_failed=:
19023at_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"
19030at_fn_check_prepare_trace "output.at:358"
19031( $at_check_trace; grep -v // input.dot
19032) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19033at_status=$? at_failed=false
19034$at_check_filter
19035at_fn_diff_devnull "$at_stderr" || at_failed=:
19036echo >>"$at_stdout"; $as_echo "
19037digraph \"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=:
19080at_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
19087read at_status <"$at_status_file"
19088#AT_STOP_88
19089#AT_START_89
19090at_fn_group_banner 89 'output.at:417' \
19091  "Graph with R/R" "                                 " 3
19092at_xfail=no
19093(
19094  $as_echo "89. $at_setup_line: testing $at_desc ..."
19095  $at_traceon
19096
19097
19098cat >input.y <<'_ATEOF'
19099%%
19100exp: a | b;
19101a: ;
19102b: ;
19103_ATEOF
19104
19105if 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"
19113at_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>&-
19117at_status=$? at_failed=false
19118$at_check_filter
19119echo stderr:; cat "$at_stderr"
19120echo stdout:; cat "$at_stdout"
19121at_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"
19127at_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>&-
19130at_status=$? at_failed=false
19131$at_check_filter
19132echo stderr:; cat "$at_stderr"
19133echo stdout:; cat "$at_stdout"
19134at_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"
19143at_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>&-
19148at_status=$? at_failed=false
19149$at_check_filter
19150at_fn_diff_devnull "$at_stderr" || at_failed=:
19151$at_diff expout "$at_stdout" || at_failed=:
19152at_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"
19161at_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>&-
19166at_status=$? at_failed=false
19167$at_check_filter
19168at_fn_diff_devnull "$at_stderr" || at_failed=:
19169$at_diff expout "$at_stdout" || at_failed=:
19170at_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
19176fi
19177{ set +x
19178$as_echo "$at_srcdir/output.at:417: bison -rall --graph input.y"
19179at_fn_check_prepare_trace "output.at:417"
19180( $at_check_trace; bison -rall --graph input.y
19181) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19182at_status=$? at_failed=false
19183$at_check_filter
19184echo stderr:; cat "$at_stderr"
19185at_fn_diff_devnull "$at_stdout" || at_failed=:
19186at_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"
19193at_fn_check_prepare_trace "output.at:417"
19194( $at_check_trace; grep -v // input.dot
19195) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19196at_status=$? at_failed=false
19197$at_check_filter
19198at_fn_diff_devnull "$at_stderr" || at_failed=:
19199echo >>"$at_stdout"; $as_echo "
19200digraph \"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=:
19227at_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
19234read at_status <"$at_status_file"
19235#AT_STOP_89
19236#AT_START_90
19237at_fn_group_banner 90 'output.at:449' \
19238  "Graph with reductions with multiple LAT" "        " 3
19239at_xfail=no
19240(
19241  $as_echo "90. $at_setup_line: testing $at_desc ..."
19242  $at_traceon
19243
19244
19245cat >input.y <<'_ATEOF'
19246%%
19247exp: a ';' | a ';' | a '.' | b '?' | b '!' | c '?' | c ';';
19248a: ;
19249b: ;
19250c: ;
19251_ATEOF
19252
19253if 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"
19261at_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>&-
19265at_status=$? at_failed=false
19266$at_check_filter
19267echo stderr:; cat "$at_stderr"
19268echo stdout:; cat "$at_stdout"
19269at_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"
19275at_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>&-
19278at_status=$? at_failed=false
19279$at_check_filter
19280echo stderr:; cat "$at_stderr"
19281echo stdout:; cat "$at_stdout"
19282at_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"
19291at_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>&-
19296at_status=$? at_failed=false
19297$at_check_filter
19298at_fn_diff_devnull "$at_stderr" || at_failed=:
19299$at_diff expout "$at_stdout" || at_failed=:
19300at_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"
19309at_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>&-
19314at_status=$? at_failed=false
19315$at_check_filter
19316at_fn_diff_devnull "$at_stderr" || at_failed=:
19317$at_diff expout "$at_stdout" || at_failed=:
19318at_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
19324fi
19325{ set +x
19326$as_echo "$at_srcdir/output.at:449: bison -rall --graph input.y"
19327at_fn_check_prepare_trace "output.at:449"
19328( $at_check_trace; bison -rall --graph input.y
19329) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19330at_status=$? at_failed=false
19331$at_check_filter
19332echo stderr:; cat "$at_stderr"
19333at_fn_diff_devnull "$at_stdout" || at_failed=:
19334at_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"
19341at_fn_check_prepare_trace "output.at:449"
19342( $at_check_trace; grep -v // input.dot
19343) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19344at_status=$? at_failed=false
19345$at_check_filter
19346at_fn_diff_devnull "$at_stderr" || at_failed=:
19347echo >>"$at_stdout"; $as_echo "
19348digraph \"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=:
19401at_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
19408read at_status <"$at_status_file"
19409#AT_STOP_90
19410#AT_START_91
19411at_fn_group_banner 91 'output.at:508' \
19412  "Graph with a reduction rule both enabled and disabled" "" 3
19413at_xfail=no
19414(
19415  $as_echo "91. $at_setup_line: testing $at_desc ..."
19416  $at_traceon
19417
19418
19419cat >input.y <<'_ATEOF'
19420%%
19421exp: ifexp | opexp | imm;
19422ifexp: "if" exp "then" exp elseexp;
19423elseexp: "else" exp | ;
19424opexp: exp '+' exp;
19425imm: '0';
19426_ATEOF
19427
19428if 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"
19436at_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>&-
19440at_status=$? at_failed=false
19441$at_check_filter
19442echo stderr:; cat "$at_stderr"
19443echo stdout:; cat "$at_stdout"
19444at_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"
19450at_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>&-
19453at_status=$? at_failed=false
19454$at_check_filter
19455echo stderr:; cat "$at_stderr"
19456echo stdout:; cat "$at_stdout"
19457at_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"
19466at_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>&-
19471at_status=$? at_failed=false
19472$at_check_filter
19473at_fn_diff_devnull "$at_stderr" || at_failed=:
19474$at_diff expout "$at_stdout" || at_failed=:
19475at_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"
19484at_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>&-
19489at_status=$? at_failed=false
19490$at_check_filter
19491at_fn_diff_devnull "$at_stderr" || at_failed=:
19492$at_diff expout "$at_stdout" || at_failed=:
19493at_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
19499fi
19500{ set +x
19501$as_echo "$at_srcdir/output.at:508: bison -rall --graph input.y"
19502at_fn_check_prepare_trace "output.at:508"
19503( $at_check_trace; bison -rall --graph input.y
19504) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19505at_status=$? at_failed=false
19506$at_check_filter
19507echo stderr:; cat "$at_stderr"
19508at_fn_diff_devnull "$at_stdout" || at_failed=:
19509at_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"
19516at_fn_check_prepare_trace "output.at:508"
19517( $at_check_trace; grep -v // input.dot
19518) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19519at_status=$? at_failed=false
19520$at_check_filter
19521at_fn_diff_devnull "$at_stderr" || at_failed=:
19522echo >>"$at_stdout"; $as_echo "
19523digraph \"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=:
19610at_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
19617read at_status <"$at_status_file"
19618#AT_STOP_91
19619#AT_START_92
19620at_fn_group_banner 92 'skeletons.at:24' \
19621  "Relative skeleton file names" "                   " 4
19622at_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"
19630at_fn_check_prepare_trace "skeletons.at:26"
19631( $at_check_trace; mkdir tmp
19632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19633at_status=$? at_failed=false
19634$at_check_filter
19635at_fn_diff_devnull "$at_stderr" || at_failed=:
19636at_fn_diff_devnull "$at_stdout" || at_failed=:
19637at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:26"
19638$at_failed && at_fn_log_failure
19639$at_traceon; }
19640
19641
19642cat >tmp/skel.c <<'_ATEOF'
19643m4_divert_push(0)dnl
19644@output(b4_parser_file_name@)dnl
19645b4_percent_define_get([[test]])
19646m4_divert_pop(0)
19647_ATEOF
19648
19649
19650cat >skel.c <<'_ATEOF'
19651m4_divert_push(0)dnl
19652@output(b4_parser_file_name@)dnl
19653b4_percent_define_get([[test]]) -- Local
19654m4_divert_pop(0)
19655_ATEOF
19656
19657
19658cat >tmp/input-gram.y <<'_ATEOF'
19659%skeleton "./skel.c"
19660%define test "Hello World"
19661%%
19662start: ;
19663_ATEOF
19664
19665
19666cat >input-gram.y <<'_ATEOF'
19667%skeleton "./skel.c"
19668%define test "Hello World"
19669%%
19670start: ;
19671_ATEOF
19672
19673
19674cat >tmp/input-cmd-line.y <<'_ATEOF'
19675%define test "Hello World"
19676%%
19677start: ;
19678_ATEOF
19679
19680
19681if 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"
19689at_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>&-
19693at_status=$? at_failed=false
19694$at_check_filter
19695echo stderr:; cat "$at_stderr"
19696echo stdout:; cat "$at_stdout"
19697at_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"
19703at_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>&-
19706at_status=$? at_failed=false
19707$at_check_filter
19708echo stderr:; cat "$at_stderr"
19709echo stdout:; cat "$at_stdout"
19710at_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"
19719at_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>&-
19724at_status=$? at_failed=false
19725$at_check_filter
19726at_fn_diff_devnull "$at_stderr" || at_failed=:
19727$at_diff expout "$at_stdout" || at_failed=:
19728at_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"
19737at_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>&-
19742at_status=$? at_failed=false
19743$at_check_filter
19744at_fn_diff_devnull "$at_stderr" || at_failed=:
19745$at_diff expout "$at_stdout" || at_failed=:
19746at_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
19752fi
19753{ set +x
19754$as_echo "$at_srcdir/skeletons.at:62: bison tmp/input-gram.y"
19755at_fn_check_prepare_trace "skeletons.at:62"
19756( $at_check_trace; bison tmp/input-gram.y
19757) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19758at_status=$? at_failed=false
19759$at_check_filter
19760at_fn_diff_devnull "$at_stderr" || at_failed=:
19761at_fn_diff_devnull "$at_stdout" || at_failed=:
19762at_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"
19769at_fn_check_prepare_trace "skeletons.at:63"
19770( $at_check_trace; cat input-gram.tab.c
19771) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19772at_status=$? at_failed=false
19773$at_check_filter
19774at_fn_diff_devnull "$at_stderr" || at_failed=:
19775echo >>"$at_stdout"; $as_echo "Hello World
19776" | \
19777  $at_diff - "$at_stdout" || at_failed=:
19778at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
19779$at_failed && at_fn_log_failure
19780$at_traceon; }
19781
19782
19783if 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"
19791at_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>&-
19795at_status=$? at_failed=false
19796$at_check_filter
19797echo stderr:; cat "$at_stderr"
19798echo stdout:; cat "$at_stdout"
19799at_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"
19805at_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>&-
19808at_status=$? at_failed=false
19809$at_check_filter
19810echo stderr:; cat "$at_stderr"
19811echo stdout:; cat "$at_stdout"
19812at_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"
19821at_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>&-
19826at_status=$? at_failed=false
19827$at_check_filter
19828at_fn_diff_devnull "$at_stderr" || at_failed=:
19829$at_diff expout "$at_stdout" || at_failed=:
19830at_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"
19839at_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>&-
19844at_status=$? at_failed=false
19845$at_check_filter
19846at_fn_diff_devnull "$at_stderr" || at_failed=:
19847$at_diff expout "$at_stdout" || at_failed=:
19848at_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
19854fi
19855{ set +x
19856$as_echo "$at_srcdir/skeletons.at:67: bison input-gram.y"
19857at_fn_check_prepare_trace "skeletons.at:67"
19858( $at_check_trace; bison input-gram.y
19859) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19860at_status=$? at_failed=false
19861$at_check_filter
19862at_fn_diff_devnull "$at_stderr" || at_failed=:
19863at_fn_diff_devnull "$at_stdout" || at_failed=:
19864at_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"
19871at_fn_check_prepare_trace "skeletons.at:68"
19872( $at_check_trace; cat input-gram.tab.c
19873) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19874at_status=$? at_failed=false
19875$at_check_filter
19876at_fn_diff_devnull "$at_stderr" || at_failed=:
19877echo >>"$at_stdout"; $as_echo "Hello World -- Local
19878" | \
19879  $at_diff - "$at_stdout" || at_failed=:
19880at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
19881$at_failed && at_fn_log_failure
19882$at_traceon; }
19883
19884
19885if 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"
19893at_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>&-
19897at_status=$? at_failed=false
19898$at_check_filter
19899echo stderr:; cat "$at_stderr"
19900echo stdout:; cat "$at_stdout"
19901at_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"
19907at_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>&-
19910at_status=$? at_failed=false
19911$at_check_filter
19912echo stderr:; cat "$at_stderr"
19913echo stdout:; cat "$at_stdout"
19914at_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"
19923at_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>&-
19928at_status=$? at_failed=false
19929$at_check_filter
19930at_fn_diff_devnull "$at_stderr" || at_failed=:
19931$at_diff expout "$at_stdout" || at_failed=:
19932at_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"
19941at_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>&-
19946at_status=$? at_failed=false
19947$at_check_filter
19948at_fn_diff_devnull "$at_stderr" || at_failed=:
19949$at_diff expout "$at_stdout" || at_failed=:
19950at_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
19956fi
19957{ set +x
19958$as_echo "$at_srcdir/skeletons.at:72: bison --skeleton=tmp/skel.c tmp/input-cmd-line.y"
19959at_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>&-
19962at_status=$? at_failed=false
19963$at_check_filter
19964at_fn_diff_devnull "$at_stderr" || at_failed=:
19965at_fn_diff_devnull "$at_stdout" || at_failed=:
19966at_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"
19973at_fn_check_prepare_trace "skeletons.at:73"
19974( $at_check_trace; cat input-cmd-line.tab.c
19975) >>"$at_stdout" 2>>"$at_stderr" 5>&-
19976at_status=$? at_failed=false
19977$at_check_filter
19978at_fn_diff_devnull "$at_stderr" || at_failed=:
19979echo >>"$at_stdout"; $as_echo "Hello World
19980" | \
19981  $at_diff - "$at_stdout" || at_failed=:
19982at_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
19990read at_status <"$at_status_file"
19991#AT_STOP_92
19992#AT_START_93
19993at_fn_group_banner 93 'skeletons.at:84' \
19994  "Installed skeleton file names" "                  " 4
19995at_xfail=no
19996(
19997  $as_echo "93. $at_setup_line: testing $at_desc ..."
19998  $at_traceon
19999
20000
20001
20002
20003
20004cat >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
20024start: ;
20025
20026%%
20027
20028#include <stdio.h>
20029/* A C error reporting function.  */
20030static
20031void yyerror ( const char *msg)
20032{
20033  fprintf (stderr, "%s\n", msg);
20034}
20035int
20036yylex (void)
20037{
20038  return 'a';
20039}
20040
20041int
20042main (void)
20043{
20044  return yyparse ();
20045}
20046_ATEOF
20047
20048
20049
20050cat >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
20071start: ;
20072
20073%%
20074
20075#include <stdio.h>
20076/* A C error reporting function.  */
20077static
20078void yyerror ( const char *msg)
20079{
20080  fprintf (stderr, "%s\n", msg);
20081}
20082int
20083yylex (void)
20084{
20085  return 'a';
20086}
20087
20088int
20089main (void)
20090{
20091  return yyparse ();
20092}
20093_ATEOF
20094
20095
20096
20097if 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"
20105at_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>&-
20109at_status=$? at_failed=false
20110$at_check_filter
20111echo stderr:; cat "$at_stderr"
20112echo stdout:; cat "$at_stdout"
20113at_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"
20119at_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>&-
20122at_status=$? at_failed=false
20123$at_check_filter
20124echo stderr:; cat "$at_stderr"
20125echo stdout:; cat "$at_stdout"
20126at_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"
20135at_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>&-
20140at_status=$? at_failed=false
20141$at_check_filter
20142at_fn_diff_devnull "$at_stderr" || at_failed=:
20143$at_diff expout "$at_stdout" || at_failed=:
20144at_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"
20153at_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>&-
20158at_status=$? at_failed=false
20159$at_check_filter
20160at_fn_diff_devnull "$at_stderr" || at_failed=:
20161$at_diff expout "$at_stdout" || at_failed=:
20162at_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
20168fi
20169{ set +x
20170$as_echo "$at_srcdir/skeletons.at:124: bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
20171at_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>&-
20174at_status=$? at_failed=false
20175$at_check_filter
20176at_fn_diff_devnull "$at_stderr" || at_failed=:
20177at_fn_diff_devnull "$at_stdout" || at_failed=:
20178at_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"
20185at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:125"
20186( $at_check_trace; $BISON_C_WORKS
20187) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20188at_status=$? at_failed=false
20189$at_check_filter
20190echo stderr:; cat "$at_stderr"
20191echo stdout:; cat "$at_stdout"
20192at_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"
20198at_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>&-
20201at_status=$? at_failed=false
20202$at_check_filter
20203echo stderr:; cat "$at_stderr"
20204echo stdout:; cat "$at_stdout"
20205at_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"
20211at_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>&-
20214at_status=$? at_failed=false
20215$at_check_filter
20216echo stderr:; tee stderr <"$at_stderr"
20217at_fn_diff_devnull "$at_stdout" || at_failed=:
20218at_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"
20224at_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>&-
20227at_status=$? at_failed=false
20228$at_check_filter
20229echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
20230" | \
20231  $at_diff - "$at_stderr" || at_failed=:
20232at_fn_diff_devnull "$at_stdout" || at_failed=:
20233at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
20234$at_failed && at_fn_log_failure
20235$at_traceon; }
20236
20237
20238
20239if 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"
20247at_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>&-
20251at_status=$? at_failed=false
20252$at_check_filter
20253echo stderr:; cat "$at_stderr"
20254echo stdout:; cat "$at_stdout"
20255at_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"
20261at_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>&-
20264at_status=$? at_failed=false
20265$at_check_filter
20266echo stderr:; cat "$at_stderr"
20267echo stdout:; cat "$at_stdout"
20268at_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"
20277at_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>&-
20282at_status=$? at_failed=false
20283$at_check_filter
20284at_fn_diff_devnull "$at_stderr" || at_failed=:
20285$at_diff expout "$at_stdout" || at_failed=:
20286at_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"
20295at_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>&-
20300at_status=$? at_failed=false
20301$at_check_filter
20302at_fn_diff_devnull "$at_stderr" || at_failed=:
20303$at_diff expout "$at_stdout" || at_failed=:
20304at_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
20310fi
20311{ set +x
20312$as_echo "$at_srcdir/skeletons.at:130: bison -o input-gram.c input-gram.y"
20313at_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>&-
20316at_status=$? at_failed=false
20317$at_check_filter
20318at_fn_diff_devnull "$at_stderr" || at_failed=:
20319at_fn_diff_devnull "$at_stdout" || at_failed=:
20320at_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"
20327at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:131"
20328( $at_check_trace; $BISON_C_WORKS
20329) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20330at_status=$? at_failed=false
20331$at_check_filter
20332echo stderr:; cat "$at_stderr"
20333echo stdout:; cat "$at_stdout"
20334at_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"
20340at_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>&-
20343at_status=$? at_failed=false
20344$at_check_filter
20345echo stderr:; cat "$at_stderr"
20346echo stdout:; cat "$at_stdout"
20347at_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"
20353at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:132"
20354( $at_check_trace;  $PREPARSER ./input-gram
20355) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20356at_status=$? at_failed=false
20357$at_check_filter
20358echo stderr:; tee stderr <"$at_stderr"
20359at_fn_diff_devnull "$at_stdout" || at_failed=:
20360at_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"
20366at_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>&-
20369at_status=$? at_failed=false
20370$at_check_filter
20371echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
20372" | \
20373  $at_diff - "$at_stderr" || at_failed=:
20374at_fn_diff_devnull "$at_stdout" || at_failed=:
20375at_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
20387read at_status <"$at_status_file"
20388#AT_STOP_93
20389#AT_START_94
20390at_fn_group_banner 94 'skeletons.at:146' \
20391  "%define Boolean variables: invalid skeleton defaults" "" 4
20392at_xfail=no
20393(
20394  $as_echo "94. $at_setup_line: testing $at_desc ..."
20395  $at_traceon
20396
20397
20398cat >skel.c <<'_ATEOF'
20399b4_percent_define_default([[foo]], [[bogus value]])
20400b4_percent_define_flag_if([[foo]])
20401_ATEOF
20402
20403
20404cat >input.y <<'_ATEOF'
20405%skeleton "./skel.c"
20406%%
20407start: ;
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"
20414at_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>&-
20417at_status=$? at_failed=false
20418$at_check_filter
20419echo >>"$at_stderr"; $as_echo "<skeleton default value>: error: invalid value for %define Boolean variable 'foo'
20420" | \
20421  $at_diff - "$at_stderr" || at_failed=:
20422at_fn_diff_devnull "$at_stdout" || at_failed=:
20423at_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
20432read at_status <"$at_status_file"
20433#AT_STOP_94
20434#AT_START_95
20435at_fn_group_banner 95 'skeletons.at:170' \
20436  "Complaining during macro argument expansion" "    " 4
20437at_xfail=no
20438(
20439  $as_echo "95. $at_setup_line: testing $at_desc ..."
20440  $at_traceon
20441
20442
20443cat >skel1.c <<'_ATEOF'
20444m4_define([foow], [b4_warn([[foow fubar]])])
20445m4_define([foowat], [b4_warn_at([[foow.y:2.3]],
20446                                    [[foow.y:5.4]], [[foowat fubar]])])
20447m4_define([fooc], [b4_complain([[fooc fubar]])])
20448m4_define([foocat], [b4_complain_at([[fooc.y:1.1]],
20449                                        [[fooc.y:10.6]], [[foocat fubar]])])
20450m4_define([foof], [b4_fatal([[foof fubar]])])
20451m4_if(foow, [1], [yes])
20452m4_if(foowat, [1], [yes])
20453m4_if(fooc, [1], [yes])
20454m4_if(foocat, [1], [yes])
20455m4_if(foof, [1], [yes])
20456_ATEOF
20457
20458
20459cat >input1.y <<'_ATEOF'
20460%skeleton "./skel1.c"
20461%%
20462start: ;
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"
20469at_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>&-
20472at_status=$? at_failed=false
20473$at_check_filter
20474echo >>"$at_stderr"; $as_echo "input1.y: warning: foow fubar
20475foow.y:2.3-5.3: warning: foowat fubar
20476input1.y: error: fooc fubar
20477fooc.y:1.1-10.5: error: foocat fubar
20478input1.y: fatal error: foof fubar
20479" | \
20480  $at_diff - "$at_stderr" || at_failed=:
20481at_fn_diff_devnull "$at_stdout" || at_failed=:
20482at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:193"
20483$at_failed && at_fn_log_failure
20484$at_traceon; }
20485
20486
20487
20488cat >skel2.c <<'_ATEOF'
20489m4_define([foofat], [b4_fatal_at([[foof.y:12.11]],
20490                                       [[foof.y:100.123]], [[foofat fubar]])])
20491m4_if(foofat, [1], [yes])
20492_ATEOF
20493
20494
20495cat >input2.y <<'_ATEOF'
20496%skeleton "./skel2.c"
20497%%
20498start: ;
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"
20505at_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>&-
20508at_status=$? at_failed=false
20509$at_check_filter
20510echo >>"$at_stderr"; $as_echo "foof.y:12.11-100.122: fatal error: foofat fubar
20511" | \
20512  $at_diff - "$at_stderr" || at_failed=:
20513at_fn_diff_devnull "$at_stdout" || at_failed=:
20514at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:213"
20515$at_failed && at_fn_log_failure
20516$at_traceon; }
20517
20518
20519
20520cat >skel3.c <<'_ATEOF'
20521b4_complain_at(b4_percent_define_get_loc([[bogus]]), [[bad value]])
20522_ATEOF
20523
20524
20525cat >input3.y <<'_ATEOF'
20526%skeleton "./skel3.c"
20527%%
20528start: ;
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"
20535at_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>&-
20538at_status=$? at_failed=false
20539$at_check_filter
20540echo >>"$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=:
20543at_fn_diff_devnull "$at_stdout" || at_failed=:
20544at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:227"
20545$at_failed && at_fn_log_failure
20546$at_traceon; }
20547
20548
20549
20550cat >skel4.c <<'_ATEOF'
20551b4_warn_at(b4_percent_define_get_syncline([[bogus]]), [[bad value]])
20552_ATEOF
20553
20554
20555cat >input4.y <<'_ATEOF'
20556%skeleton "./skel4.c"
20557%%
20558start: ;
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"
20565at_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>&-
20568at_status=$? at_failed=false
20569$at_check_filter
20570echo >>"$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=:
20573at_fn_diff_devnull "$at_stdout" || at_failed=:
20574at_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
20583read at_status <"$at_status_file"
20584#AT_STOP_95
20585#AT_START_96
20586at_fn_group_banner 96 'skeletons.at:252' \
20587  "Fatal errors make M4 exit immediately" "          " 4
20588at_xfail=no
20589(
20590  $as_echo "96. $at_setup_line: testing $at_desc ..."
20591  $at_traceon
20592
20593
20594cat >skel1.c <<'_ATEOF'
20595b4_complain([[non-fatal error]])
20596b4_fatal([[M4 should exit immediately here]])
20597m4_fatal([this should never be evaluated])
20598_ATEOF
20599
20600
20601cat >input1.y <<'_ATEOF'
20602%skeleton "./skel1.c"
20603%%
20604start: ;
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"
20611at_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>&-
20614at_status=$? at_failed=false
20615$at_check_filter
20616echo >>"$at_stderr"; $as_echo "input1.y: error: non-fatal error
20617input1.y: fatal error: M4 should exit immediately here
20618" | \
20619  $at_diff - "$at_stderr" || at_failed=:
20620at_fn_diff_devnull "$at_stdout" || at_failed=:
20621at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:266"
20622$at_failed && at_fn_log_failure
20623$at_traceon; }
20624
20625
20626
20627cat >skel2.c <<'_ATEOF'
20628b4_warn([[morning]])
20629b4_fatal_at([[foo.y:1.5]], [[foo.y:1.7]], [[M4 should exit immediately here]])
20630m4_fatal([this should never be evaluated])
20631_ATEOF
20632
20633
20634cat >input2.y <<'_ATEOF'
20635%skeleton "./skel2.c"
20636%%
20637start: ;
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"
20644at_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>&-
20647at_status=$? at_failed=false
20648$at_check_filter
20649echo >>"$at_stderr"; $as_echo "input2.y: warning: morning
20650foo.y:1.5-6: fatal error: M4 should exit immediately here
20651" | \
20652  $at_diff - "$at_stderr" || at_failed=:
20653at_fn_diff_devnull "$at_stdout" || at_failed=:
20654at_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
20663read at_status <"$at_status_file"
20664#AT_STOP_96
20665#AT_START_97
20666at_fn_group_banner 97 'skeletons.at:306' \
20667  "Fatal errors but M4 continues producing output" " " 4
20668at_xfail=no
20669(
20670  $as_echo "97. $at_setup_line: testing $at_desc ..."
20671  $at_traceon
20672
20673
20674cat >gen-skel.pl <<'_ATEOF'
20675use warnings;
20676use strict;
20677my $M4 = "m4";
20678my $DNL = "d"."nl";
20679print "${M4}_divert_push(0)$DNL\n";
20680print '@output(@,@)', "\n";
20681(print "garbage"x10, "\n") for (1..1000);
20682print "${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"
20687at_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>&-
20690at_status=$? at_failed=false
20691$at_check_filter
20692at_fn_diff_devnull "$at_stderr" || at_failed=:
20693at_fn_diff_devnull "$at_stdout" || at_failed=:
20694at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:318"
20695$at_failed && at_fn_log_failure
20696$at_traceon; }
20697
20698
20699cat >input.y <<'_ATEOF'
20700%skeleton "./skel.c"
20701%%
20702start: ;
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"
20709at_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>&-
20712at_status=$? at_failed=false
20713$at_check_filter
20714echo >>"$at_stderr"; $as_echo "input.y: fatal error: too many arguments for @output directive in skeleton
20715" | \
20716  $at_diff - "$at_stderr" || at_failed=:
20717at_fn_diff_devnull "$at_stdout" || at_failed=:
20718at_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
20727read at_status <"$at_status_file"
20728#AT_STOP_97
20729#AT_START_98
20730at_fn_group_banner 98 'sets.at:66' \
20731  "Nullable" "                                       " 5
20732at_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
20746cat >input.y <<'_ATEOF'
20747%%
20748e: 'e' | /* Nothing */;
20749_ATEOF
20750
20751
20752if 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"
20760at_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>&-
20764at_status=$? at_failed=false
20765$at_check_filter
20766echo stderr:; cat "$at_stderr"
20767echo stdout:; cat "$at_stdout"
20768at_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"
20774at_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>&-
20777at_status=$? at_failed=false
20778$at_check_filter
20779echo stderr:; cat "$at_stderr"
20780echo stdout:; cat "$at_stdout"
20781at_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"
20790at_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>&-
20795at_status=$? at_failed=false
20796$at_check_filter
20797at_fn_diff_devnull "$at_stderr" || at_failed=:
20798$at_diff expout "$at_stdout" || at_failed=:
20799at_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"
20808at_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>&-
20813at_status=$? at_failed=false
20814$at_check_filter
20815at_fn_diff_devnull "$at_stderr" || at_failed=:
20816$at_diff expout "$at_stdout" || at_failed=:
20817at_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
20823fi
20824{ set +x
20825$as_echo "$at_srcdir/sets.at:81: bison --trace=sets input.y"
20826at_fn_check_prepare_trace "sets.at:81"
20827( $at_check_trace; bison --trace=sets input.y
20828) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20829at_status=$? at_failed=false
20830$at_check_filter
20831echo stderr:; tee stderr <"$at_stderr"
20832at_fn_diff_devnull "$at_stdout" || at_failed=:
20833at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
20834$at_failed && at_fn_log_failure
20835$at_traceon; }
20836
20837
20838cat >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"
20868at_fn_check_prepare_trace "sets.at:82"
20869( $at_check_trace; sed -f extract.sed stderr
20870) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20871at_status=$? at_failed=false
20872$at_check_filter
20873at_fn_diff_devnull "$at_stderr" || at_failed=:
20874echo stdout:; tee stdout <"$at_stdout"
20875at_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"
20881at_fn_check_prepare_trace "sets.at:82"
20882( $at_check_trace; mv stdout sets
20883) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20884at_status=$? at_failed=false
20885$at_check_filter
20886at_fn_diff_devnull "$at_stderr" || at_failed=:
20887at_fn_diff_devnull "$at_stdout" || at_failed=:
20888at_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"
20895at_fn_check_prepare_trace "sets.at:83"
20896( $at_check_trace; cat sets
20897) >>"$at_stdout" 2>>"$at_stderr" 5>&-
20898at_status=$? at_failed=false
20899$at_check_filter
20900at_fn_diff_devnull "$at_stderr" || at_failed=:
20901echo >>"$at_stdout"; $as_echo "DERIVES
20902	\$accept derives
20903		  0  e \$end
20904	e derives
20905		  1  'e'
20906		  2  /* empty */
20907NULLABLE
20908	\$accept: no
20909	e: yes
20910FIRSTS
20911	\$accept firsts
20912		\$accept
20913		e
20914	e firsts
20915		e
20916FDERIVES
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=:
20926at_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
20934read at_status <"$at_status_file"
20935#AT_STOP_98
20936#AT_START_99
20937at_fn_group_banner 99 'sets.at:151' \
20938  "Broken Closure" "                                 " 5
20939at_xfail=no
20940(
20941  $as_echo "99. $at_setup_line: testing $at_desc ..."
20942  $at_traceon
20943
20944
20945cat >input.y <<'_ATEOF'
20946%%
20947a: b;
20948b: c;
20949c: d;
20950d: e;
20951e: f;
20952f: g;
20953g: h;
20954h: 'h';
20955_ATEOF
20956
20957
20958if 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"
20966at_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>&-
20970at_status=$? at_failed=false
20971$at_check_filter
20972echo stderr:; cat "$at_stderr"
20973echo stdout:; cat "$at_stdout"
20974at_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"
20980at_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>&-
20983at_status=$? at_failed=false
20984$at_check_filter
20985echo stderr:; cat "$at_stderr"
20986echo stdout:; cat "$at_stdout"
20987at_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"
20996at_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>&-
21001at_status=$? at_failed=false
21002$at_check_filter
21003at_fn_diff_devnull "$at_stderr" || at_failed=:
21004$at_diff expout "$at_stdout" || at_failed=:
21005at_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"
21014at_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>&-
21019at_status=$? at_failed=false
21020$at_check_filter
21021at_fn_diff_devnull "$at_stderr" || at_failed=:
21022$at_diff expout "$at_stdout" || at_failed=:
21023at_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
21029fi
21030{ set +x
21031$as_echo "$at_srcdir/sets.at:165: bison --trace=sets input.y"
21032at_fn_check_prepare_trace "sets.at:165"
21033( $at_check_trace; bison --trace=sets input.y
21034) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21035at_status=$? at_failed=false
21036$at_check_filter
21037echo stderr:; tee stderr <"$at_stderr"
21038at_fn_diff_devnull "$at_stdout" || at_failed=:
21039at_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"
21047at_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>&-
21050at_status=$? at_failed=false
21051$at_check_filter
21052at_fn_diff_devnull "$at_stderr" || at_failed=:
21053echo >>"$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  \`---------'
21067RTC: Firsts Output END
21068" | \
21069  $at_diff - "$at_stdout" || at_failed=:
21070at_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
21078read at_status <"$at_status_file"
21079#AT_STOP_99
21080#AT_START_100
21081at_fn_group_banner 100 'sets.at:193' \
21082  "Firsts" "                                         " 5
21083at_xfail=no
21084(
21085  $as_echo "100. $at_setup_line: testing $at_desc ..."
21086  $at_traceon
21087
21088
21089cat >input.y <<'_ATEOF'
21090%nonassoc '<' '>'
21091%left '+' '-'
21092%right '^' '='
21093%%
21094exp:
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
21106if 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"
21114at_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>&-
21118at_status=$? at_failed=false
21119$at_check_filter
21120echo stderr:; cat "$at_stderr"
21121echo stdout:; cat "$at_stdout"
21122at_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"
21128at_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>&-
21131at_status=$? at_failed=false
21132$at_check_filter
21133echo stderr:; cat "$at_stderr"
21134echo stdout:; cat "$at_stdout"
21135at_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"
21144at_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>&-
21149at_status=$? at_failed=false
21150$at_check_filter
21151at_fn_diff_devnull "$at_stderr" || at_failed=:
21152$at_diff expout "$at_stdout" || at_failed=:
21153at_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"
21162at_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>&-
21167at_status=$? at_failed=false
21168$at_check_filter
21169at_fn_diff_devnull "$at_stderr" || at_failed=:
21170$at_diff expout "$at_stdout" || at_failed=:
21171at_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
21177fi
21178{ set +x
21179$as_echo "$at_srcdir/sets.at:211: bison --trace=sets input.y"
21180at_fn_check_prepare_trace "sets.at:211"
21181( $at_check_trace; bison --trace=sets input.y
21182) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21183at_status=$? at_failed=false
21184$at_check_filter
21185echo stderr:; tee stderr <"$at_stderr"
21186at_fn_diff_devnull "$at_stdout" || at_failed=:
21187at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
21188$at_failed && at_fn_log_failure
21189$at_traceon; }
21190
21191
21192cat >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"
21222at_fn_check_prepare_trace "sets.at:212"
21223( $at_check_trace; sed -f extract.sed stderr
21224) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21225at_status=$? at_failed=false
21226$at_check_filter
21227at_fn_diff_devnull "$at_stderr" || at_failed=:
21228echo stdout:; tee stdout <"$at_stdout"
21229at_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"
21235at_fn_check_prepare_trace "sets.at:212"
21236( $at_check_trace; mv stdout sets
21237) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21238at_status=$? at_failed=false
21239$at_check_filter
21240at_fn_diff_devnull "$at_stderr" || at_failed=:
21241at_fn_diff_devnull "$at_stdout" || at_failed=:
21242at_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"
21249at_fn_check_prepare_trace "sets.at:213"
21250( $at_check_trace; cat sets
21251) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21252at_status=$? at_failed=false
21253$at_check_filter
21254at_fn_diff_devnull "$at_stderr" || at_failed=:
21255echo >>"$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\"
21266NULLABLE
21267	\$accept: no
21268	exp: no
21269FIRSTS
21270	\$accept firsts
21271		\$accept
21272		exp
21273	exp firsts
21274		exp
21275FDERIVES
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=:
21295at_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
21303read at_status <"$at_status_file"
21304#AT_STOP_100
21305#AT_START_101
21306at_fn_group_banner 101 'sets.at:269' \
21307  "Accept" "                                         " 5
21308at_xfail=no
21309(
21310  $as_echo "101. $at_setup_line: testing $at_desc ..."
21311  $at_traceon
21312
21313
21314cat >input.y <<'_ATEOF'
21315%token END 0
21316%%
21317input:
21318  'a'
21319| '(' input ')'
21320| '(' error END
21321;
21322_ATEOF
21323
21324
21325if 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"
21333at_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>&-
21337at_status=$? at_failed=false
21338$at_check_filter
21339echo stderr:; cat "$at_stderr"
21340echo stdout:; cat "$at_stdout"
21341at_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"
21347at_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>&-
21350at_status=$? at_failed=false
21351$at_check_filter
21352echo stderr:; cat "$at_stderr"
21353echo stdout:; cat "$at_stdout"
21354at_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"
21363at_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>&-
21368at_status=$? at_failed=false
21369$at_check_filter
21370at_fn_diff_devnull "$at_stderr" || at_failed=:
21371$at_diff expout "$at_stdout" || at_failed=:
21372at_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"
21381at_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>&-
21386at_status=$? at_failed=false
21387$at_check_filter
21388at_fn_diff_devnull "$at_stderr" || at_failed=:
21389$at_diff expout "$at_stdout" || at_failed=:
21390at_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
21396fi
21397{ set +x
21398$as_echo "$at_srcdir/sets.at:281: bison -v -o input.c input.y"
21399at_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>&-
21402at_status=$? at_failed=false
21403$at_check_filter
21404at_fn_diff_devnull "$at_stderr" || at_failed=:
21405at_fn_diff_devnull "$at_stdout" || at_failed=:
21406at_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"
21415at_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>&-
21418at_status=$? at_failed=false
21419$at_check_filter
21420at_fn_diff_devnull "$at_stderr" || at_failed=:
21421echo stdout:; tee stdout <"$at_stdout"
21422at_fn_check_status 0 $at_status "$at_srcdir/sets.at:284"
21423$at_failed && at_fn_log_failure
21424$at_traceon; }
21425
21426mv 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"
21441at_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>&-
21454at_status=$? at_failed=false
21455$at_check_filter
21456at_fn_diff_devnull "$at_stderr" || at_failed=:
21457$at_diff expout "$at_stdout" || at_failed=:
21458at_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
21466read at_status <"$at_status_file"
21467#AT_STOP_101
21468#AT_START_102
21469at_fn_group_banner 102 'reduce.at:25' \
21470  "Useless Terminals" "                              " 6
21471at_xfail=no
21472(
21473  $as_echo "102. $at_setup_line: testing $at_desc ..."
21474  $at_traceon
21475
21476
21477cat >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%%
21493exp: useful;
21494_ATEOF
21495
21496
21497if 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"
21505at_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>&-
21509at_status=$? at_failed=false
21510$at_check_filter
21511echo stderr:; cat "$at_stderr"
21512echo stdout:; cat "$at_stdout"
21513at_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"
21519at_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>&-
21522at_status=$? at_failed=false
21523$at_check_filter
21524echo stderr:; cat "$at_stderr"
21525echo stdout:; cat "$at_stdout"
21526at_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"
21535at_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>&-
21540at_status=$? at_failed=false
21541$at_check_filter
21542at_fn_diff_devnull "$at_stderr" || at_failed=:
21543$at_diff expout "$at_stdout" || at_failed=:
21544at_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"
21553at_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>&-
21558at_status=$? at_failed=false
21559$at_check_filter
21560at_fn_diff_devnull "$at_stderr" || at_failed=:
21561$at_diff expout "$at_stdout" || at_failed=:
21562at_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
21568fi
21569{ set +x
21570$as_echo "$at_srcdir/reduce.at:46: bison input.y"
21571at_fn_check_prepare_trace "reduce.at:46"
21572( $at_check_trace; bison input.y
21573) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21574at_status=$? at_failed=false
21575$at_check_filter
21576at_fn_diff_devnull "$at_stderr" || at_failed=:
21577at_fn_diff_devnull "$at_stdout" || at_failed=:
21578at_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"
21586at_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>&-
21589at_status=$? at_failed=false
21590$at_check_filter
21591at_fn_diff_devnull "$at_stderr" || at_failed=:
21592echo >>"$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=:
21604at_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
21612read at_status <"$at_status_file"
21613#AT_STOP_102
21614#AT_START_103
21615at_fn_group_banner 103 'reduce.at:69' \
21616  "Useless Nonterminals" "                           " 6
21617at_xfail=no
21618(
21619  $as_echo "103. $at_setup_line: testing $at_desc ..."
21620  $at_traceon
21621
21622
21623cat >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%%
21639exp: useful;
21640_ATEOF
21641
21642
21643if 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"
21651at_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>&-
21655at_status=$? at_failed=false
21656$at_check_filter
21657echo stderr:; cat "$at_stderr"
21658echo stdout:; cat "$at_stdout"
21659at_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"
21665at_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>&-
21668at_status=$? at_failed=false
21669$at_check_filter
21670echo stderr:; cat "$at_stderr"
21671echo stdout:; cat "$at_stdout"
21672at_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"
21681at_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>&-
21686at_status=$? at_failed=false
21687$at_check_filter
21688at_fn_diff_devnull "$at_stderr" || at_failed=:
21689$at_diff expout "$at_stdout" || at_failed=:
21690at_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"
21699at_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>&-
21704at_status=$? at_failed=false
21705$at_check_filter
21706at_fn_diff_devnull "$at_stderr" || at_failed=:
21707$at_diff expout "$at_stdout" || at_failed=:
21708at_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
21714fi
21715{ set +x
21716$as_echo "$at_srcdir/reduce.at:90: bison input.y"
21717at_fn_check_prepare_trace "reduce.at:90"
21718( $at_check_trace; bison input.y
21719) >>"$at_stdout" 2>>"$at_stderr" 5>&-
21720at_status=$? at_failed=false
21721$at_check_filter
21722echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
21723input.y:4.8-15: warning: nonterminal useless in grammar: useless1
21724input.y:5.8-15: warning: nonterminal useless in grammar: useless2
21725input.y:6.8-15: warning: nonterminal useless in grammar: useless3
21726input.y:7.8-15: warning: nonterminal useless in grammar: useless4
21727input.y:8.8-15: warning: nonterminal useless in grammar: useless5
21728input.y:9.8-15: warning: nonterminal useless in grammar: useless6
21729input.y:10.8-15: warning: nonterminal useless in grammar: useless7
21730input.y:11.8-15: warning: nonterminal useless in grammar: useless8
21731input.y:12.8-15: warning: nonterminal useless in grammar: useless9
21732" | \
21733  $at_diff - "$at_stderr" || at_failed=:
21734at_fn_diff_devnull "$at_stdout" || at_failed=:
21735at_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.
21742if 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"
21751at_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>&-
21754at_status=$? at_failed=false
21755$at_check_filter
21756echo stderr:; tee stderr <"$at_stderr"
21757$at_diff expout "$at_stdout" || at_failed=:
21758at_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'
21766input.y: warning: 9 nonterminals useless in grammar
21767input.y:4.8-15: warning: nonterminal useless in grammar: useless1
21768input.y:5.8-15: warning: nonterminal useless in grammar: useless2
21769input.y:6.8-15: warning: nonterminal useless in grammar: useless3
21770input.y:7.8-15: warning: nonterminal useless in grammar: useless4
21771input.y:8.8-15: warning: nonterminal useless in grammar: useless5
21772input.y:9.8-15: warning: nonterminal useless in grammar: useless6
21773input.y:10.8-15: warning: nonterminal useless in grammar: useless7
21774input.y:11.8-15: warning: nonterminal useless in grammar: useless8
21775input.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"
21805at_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>&-
21809at_status=$? at_failed=false
21810$at_check_filter
21811$at_diff experr "$at_stderr" || at_failed=:
21812at_fn_diff_devnull "$at_stdout" || at_failed=:
21813at_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"
21822at_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>&-
21825at_status=$? at_failed=false
21826$at_check_filter
21827$at_diff experr "$at_stderr" || at_failed=:
21828$at_diff expout "$at_stdout" || at_failed=:
21829at_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"
21839at_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>&-
21842at_status=$? at_failed=false
21843$at_check_filter
21844at_fn_diff_devnull "$at_stderr" || at_failed=:
21845$at_diff expout "$at_stdout" || at_failed=:
21846at_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"
21852at_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>&-
21855at_status=$? at_failed=false
21856$at_check_filter
21857at_fn_diff_devnull "$at_stderr" || at_failed=:
21858$at_diff expout "$at_stdout" || at_failed=:
21859at_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
21865fi
21866
21867{ set +x
21868$as_echo "$at_srcdir/reduce.at:103: sed -n '/^Grammar/q;/^\$/!p' input.output"
21869at_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>&-
21872at_status=$? at_failed=false
21873$at_check_filter
21874at_fn_diff_devnull "$at_stderr" || at_failed=:
21875echo >>"$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=:
21887at_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
21895read at_status <"$at_status_file"
21896#AT_STOP_103
21897#AT_START_104
21898at_fn_group_banner 104 'reduce.at:124' \
21899  "Useless Rules" "                                  " 6
21900at_xfail=no
21901(
21902  $as_echo "104. $at_setup_line: testing $at_desc ..."
21903  $at_traceon
21904
21905
21906
21907
21908cat >input.y <<'_ATEOF'
21909%verbose
21910%output "input.c"
21911%token useful
21912%%
21913exp: useful;
21914useless1: '1';
21915useless2: '2';
21916useless3: '3';
21917useless4: '4';
21918useless5: '5';
21919useless6: '6';
21920useless7: '7';
21921useless8: '8';
21922useless9: '9';
21923_ATEOF
21924
21925
21926if 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"
21934at_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>&-
21938at_status=$? at_failed=false
21939$at_check_filter
21940echo stderr:; cat "$at_stderr"
21941echo stdout:; cat "$at_stdout"
21942at_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"
21948at_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>&-
21951at_status=$? at_failed=false
21952$at_check_filter
21953echo stderr:; cat "$at_stderr"
21954echo stdout:; cat "$at_stdout"
21955at_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"
21964at_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>&-
21969at_status=$? at_failed=false
21970$at_check_filter
21971at_fn_diff_devnull "$at_stderr" || at_failed=:
21972$at_diff expout "$at_stdout" || at_failed=:
21973at_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"
21982at_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>&-
21987at_status=$? at_failed=false
21988$at_check_filter
21989at_fn_diff_devnull "$at_stderr" || at_failed=:
21990$at_diff expout "$at_stdout" || at_failed=:
21991at_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
21997fi
21998{ set +x
21999$as_echo "$at_srcdir/reduce.at:145: bison -fcaret input.y"
22000at_fn_check_prepare_trace "reduce.at:145"
22001( $at_check_trace; bison -fcaret input.y
22002) >>"$at_stdout" 2>>"$at_stderr" 5>&-
22003at_status=$? at_failed=false
22004$at_check_filter
22005echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
22006input.y: warning: 9 rules useless in grammar
22007input.y:6.1-8: warning: nonterminal useless in grammar: useless1
22008 useless1: '1';
22009 ^^^^^^^^
22010input.y:7.1-8: warning: nonterminal useless in grammar: useless2
22011 useless2: '2';
22012 ^^^^^^^^
22013input.y:8.1-8: warning: nonterminal useless in grammar: useless3
22014 useless3: '3';
22015 ^^^^^^^^
22016input.y:9.1-8: warning: nonterminal useless in grammar: useless4
22017 useless4: '4';
22018 ^^^^^^^^
22019input.y:10.1-8: warning: nonterminal useless in grammar: useless5
22020 useless5: '5';
22021 ^^^^^^^^
22022input.y:11.1-8: warning: nonterminal useless in grammar: useless6
22023 useless6: '6';
22024 ^^^^^^^^
22025input.y:12.1-8: warning: nonterminal useless in grammar: useless7
22026 useless7: '7';
22027 ^^^^^^^^
22028input.y:13.1-8: warning: nonterminal useless in grammar: useless8
22029 useless8: '8';
22030 ^^^^^^^^
22031input.y:14.1-8: warning: nonterminal useless in grammar: useless9
22032 useless9: '9';
22033 ^^^^^^^^
22034input.y:6.11-13: warning: rule useless in grammar
22035 useless1: '1';
22036           ^^^
22037input.y:7.11-13: warning: rule useless in grammar
22038 useless2: '2';
22039           ^^^
22040input.y:8.11-13: warning: rule useless in grammar
22041 useless3: '3';
22042           ^^^
22043input.y:9.11-13: warning: rule useless in grammar
22044 useless4: '4';
22045           ^^^
22046input.y:10.11-13: warning: rule useless in grammar
22047 useless5: '5';
22048           ^^^
22049input.y:11.11-13: warning: rule useless in grammar
22050 useless6: '6';
22051           ^^^
22052input.y:12.11-13: warning: rule useless in grammar
22053 useless7: '7';
22054           ^^^
22055input.y:13.11-13: warning: rule useless in grammar
22056 useless8: '8';
22057           ^^^
22058input.y:14.11-13: warning: rule useless in grammar
22059 useless9: '9';
22060           ^^^
22061" | \
22062  $at_diff - "$at_stderr" || at_failed=:
22063at_fn_diff_devnull "$at_stdout" || at_failed=:
22064at_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.
22071if 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"
22080at_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>&-
22083at_status=$? at_failed=false
22084$at_check_filter
22085echo stderr:; tee stderr <"$at_stderr"
22086$at_diff expout "$at_stdout" || at_failed=:
22087at_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'
22095input.y: warning: 9 nonterminals useless in grammar
22096input.y: warning: 9 rules useless in grammar
22097input.y:6.1-8: warning: nonterminal useless in grammar: useless1
22098 useless1: '1';
22099 ^^^^^^^^
22100input.y:7.1-8: warning: nonterminal useless in grammar: useless2
22101 useless2: '2';
22102 ^^^^^^^^
22103input.y:8.1-8: warning: nonterminal useless in grammar: useless3
22104 useless3: '3';
22105 ^^^^^^^^
22106input.y:9.1-8: warning: nonterminal useless in grammar: useless4
22107 useless4: '4';
22108 ^^^^^^^^
22109input.y:10.1-8: warning: nonterminal useless in grammar: useless5
22110 useless5: '5';
22111 ^^^^^^^^
22112input.y:11.1-8: warning: nonterminal useless in grammar: useless6
22113 useless6: '6';
22114 ^^^^^^^^
22115input.y:12.1-8: warning: nonterminal useless in grammar: useless7
22116 useless7: '7';
22117 ^^^^^^^^
22118input.y:13.1-8: warning: nonterminal useless in grammar: useless8
22119 useless8: '8';
22120 ^^^^^^^^
22121input.y:14.1-8: warning: nonterminal useless in grammar: useless9
22122 useless9: '9';
22123 ^^^^^^^^
22124input.y:6.11-13: warning: rule useless in grammar
22125 useless1: '1';
22126           ^^^
22127input.y:7.11-13: warning: rule useless in grammar
22128 useless2: '2';
22129           ^^^
22130input.y:8.11-13: warning: rule useless in grammar
22131 useless3: '3';
22132           ^^^
22133input.y:9.11-13: warning: rule useless in grammar
22134 useless4: '4';
22135           ^^^
22136input.y:10.11-13: warning: rule useless in grammar
22137 useless5: '5';
22138           ^^^
22139input.y:11.11-13: warning: rule useless in grammar
22140 useless6: '6';
22141           ^^^
22142input.y:12.11-13: warning: rule useless in grammar
22143 useless7: '7';
22144           ^^^
22145input.y:13.11-13: warning: rule useless in grammar
22146 useless8: '8';
22147           ^^^
22148input.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"
22180at_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>&-
22184at_status=$? at_failed=false
22185$at_check_filter
22186$at_diff experr "$at_stderr" || at_failed=:
22187at_fn_diff_devnull "$at_stdout" || at_failed=:
22188at_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"
22197at_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>&-
22200at_status=$? at_failed=false
22201$at_check_filter
22202$at_diff experr "$at_stderr" || at_failed=:
22203$at_diff expout "$at_stdout" || at_failed=:
22204at_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"
22214at_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>&-
22217at_status=$? at_failed=false
22218$at_check_filter
22219at_fn_diff_devnull "$at_stderr" || at_failed=:
22220$at_diff expout "$at_stdout" || at_failed=:
22221at_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"
22227at_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>&-
22230at_status=$? at_failed=false
22231$at_check_filter
22232at_fn_diff_devnull "$at_stderr" || at_failed=:
22233$at_diff expout "$at_stdout" || at_failed=:
22234at_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
22240fi
22241
22242if 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"
22250at_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>&-
22254at_status=$? at_failed=false
22255$at_check_filter
22256echo stderr:; cat "$at_stderr"
22257echo stdout:; cat "$at_stdout"
22258at_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"
22264at_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>&-
22267at_status=$? at_failed=false
22268$at_check_filter
22269echo stderr:; cat "$at_stderr"
22270echo stdout:; cat "$at_stdout"
22271at_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"
22280at_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>&-
22285at_status=$? at_failed=false
22286$at_check_filter
22287at_fn_diff_devnull "$at_stderr" || at_failed=:
22288$at_diff expout "$at_stdout" || at_failed=:
22289at_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"
22298at_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>&-
22303at_status=$? at_failed=false
22304$at_check_filter
22305at_fn_diff_devnull "$at_stderr" || at_failed=:
22306$at_diff expout "$at_stdout" || at_failed=:
22307at_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
22313fi
22314{ set +x
22315$as_echo "$at_srcdir/reduce.at:204: bison input.y"
22316at_fn_check_prepare_trace "reduce.at:204"
22317( $at_check_trace; bison input.y
22318) >>"$at_stdout" 2>>"$at_stderr" 5>&-
22319at_status=$? at_failed=false
22320$at_check_filter
22321echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
22322input.y: warning: 9 rules useless in grammar
22323input.y:6.1-8: warning: nonterminal useless in grammar: useless1
22324input.y:7.1-8: warning: nonterminal useless in grammar: useless2
22325input.y:8.1-8: warning: nonterminal useless in grammar: useless3
22326input.y:9.1-8: warning: nonterminal useless in grammar: useless4
22327input.y:10.1-8: warning: nonterminal useless in grammar: useless5
22328input.y:11.1-8: warning: nonterminal useless in grammar: useless6
22329input.y:12.1-8: warning: nonterminal useless in grammar: useless7
22330input.y:13.1-8: warning: nonterminal useless in grammar: useless8
22331input.y:14.1-8: warning: nonterminal useless in grammar: useless9
22332input.y:6.11-13: warning: rule useless in grammar: useless1: '1'
22333input.y:7.11-13: warning: rule useless in grammar: useless2: '2'
22334input.y:8.11-13: warning: rule useless in grammar: useless3: '3'
22335input.y:9.11-13: warning: rule useless in grammar: useless4: '4'
22336input.y:10.11-13: warning: rule useless in grammar: useless5: '5'
22337input.y:11.11-13: warning: rule useless in grammar: useless6: '6'
22338input.y:12.11-13: warning: rule useless in grammar: useless7: '7'
22339input.y:13.11-13: warning: rule useless in grammar: useless8: '8'
22340input.y:14.11-13: warning: rule useless in grammar: useless9: '9'
22341" | \
22342  $at_diff - "$at_stderr" || at_failed=:
22343at_fn_diff_devnull "$at_stdout" || at_failed=:
22344at_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.
22351if 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"
22360at_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>&-
22363at_status=$? at_failed=false
22364$at_check_filter
22365echo stderr:; tee stderr <"$at_stderr"
22366$at_diff expout "$at_stdout" || at_failed=:
22367at_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'
22375input.y: warning: 9 nonterminals useless in grammar
22376input.y: warning: 9 rules useless in grammar
22377input.y:6.1-8: warning: nonterminal useless in grammar: useless1
22378input.y:7.1-8: warning: nonterminal useless in grammar: useless2
22379input.y:8.1-8: warning: nonterminal useless in grammar: useless3
22380input.y:9.1-8: warning: nonterminal useless in grammar: useless4
22381input.y:10.1-8: warning: nonterminal useless in grammar: useless5
22382input.y:11.1-8: warning: nonterminal useless in grammar: useless6
22383input.y:12.1-8: warning: nonterminal useless in grammar: useless7
22384input.y:13.1-8: warning: nonterminal useless in grammar: useless8
22385input.y:14.1-8: warning: nonterminal useless in grammar: useless9
22386input.y:6.11-13: warning: rule useless in grammar: useless1: '1'
22387input.y:7.11-13: warning: rule useless in grammar: useless2: '2'
22388input.y:8.11-13: warning: rule useless in grammar: useless3: '3'
22389input.y:9.11-13: warning: rule useless in grammar: useless4: '4'
22390input.y:10.11-13: warning: rule useless in grammar: useless5: '5'
22391input.y:11.11-13: warning: rule useless in grammar: useless6: '6'
22392input.y:12.11-13: warning: rule useless in grammar: useless7: '7'
22393input.y:13.11-13: warning: rule useless in grammar: useless8: '8'
22394input.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"
22424at_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>&-
22428at_status=$? at_failed=false
22429$at_check_filter
22430$at_diff experr "$at_stderr" || at_failed=:
22431at_fn_diff_devnull "$at_stdout" || at_failed=:
22432at_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"
22441at_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>&-
22444at_status=$? at_failed=false
22445$at_check_filter
22446$at_diff experr "$at_stderr" || at_failed=:
22447$at_diff expout "$at_stdout" || at_failed=:
22448at_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"
22458at_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>&-
22461at_status=$? at_failed=false
22462$at_check_filter
22463at_fn_diff_devnull "$at_stderr" || at_failed=:
22464$at_diff expout "$at_stdout" || at_failed=:
22465at_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"
22471at_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>&-
22474at_status=$? at_failed=false
22475$at_check_filter
22476at_fn_diff_devnull "$at_stderr" || at_failed=:
22477$at_diff expout "$at_stdout" || at_failed=:
22478at_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
22484fi
22485
22486{ set +x
22487$as_echo "$at_srcdir/reduce.at:227: sed -n '/^Grammar/q;/^\$/!p' input.output"
22488at_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>&-
22491at_status=$? at_failed=false
22492$at_check_filter
22493at_fn_diff_devnull "$at_stderr" || at_failed=:
22494echo >>"$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
22504Terminals unused in grammar
22505   '1'
22506   '2'
22507   '3'
22508   '4'
22509   '5'
22510   '6'
22511   '7'
22512   '8'
22513   '9'
22514Rules 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=:
22526at_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
22534read at_status <"$at_status_file"
22535#AT_STOP_104
22536#AT_START_105
22537at_fn_group_banner 105 'reduce.at:271' \
22538  "Reduced Automaton" "                              " 6
22539at_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# ------------------------
22549cat >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
22559exp: useful            { /* A useful action. */ }
22560   | non_productive    { /* A non productive action. */ }
22561   ;
22562
22563not_reachable: useful  { /* A not reachable action. */ }
22564             ;
22565
22566non_productive: non_productive useless_token
22567                       { /* Another non productive action. */ }
22568              ;
22569%%
22570_ATEOF
22571
22572
22573if 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"
22581at_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>&-
22585at_status=$? at_failed=false
22586$at_check_filter
22587echo stderr:; cat "$at_stderr"
22588echo stdout:; cat "$at_stdout"
22589at_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"
22595at_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>&-
22598at_status=$? at_failed=false
22599$at_check_filter
22600echo stderr:; cat "$at_stderr"
22601echo stdout:; cat "$at_stdout"
22602at_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"
22611at_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>&-
22616at_status=$? at_failed=false
22617$at_check_filter
22618at_fn_diff_devnull "$at_stderr" || at_failed=:
22619$at_diff expout "$at_stdout" || at_failed=:
22620at_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"
22629at_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>&-
22634at_status=$? at_failed=false
22635$at_check_filter
22636at_fn_diff_devnull "$at_stderr" || at_failed=:
22637$at_diff expout "$at_stdout" || at_failed=:
22638at_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
22644fi
22645{ set +x
22646$as_echo "$at_srcdir/reduce.at:300: bison -fcaret not-reduced.y"
22647at_fn_check_prepare_trace "reduce.at:300"
22648( $at_check_trace; bison -fcaret not-reduced.y
22649) >>"$at_stdout" 2>>"$at_stderr" 5>&-
22650at_status=$? at_failed=false
22651$at_check_filter
22652echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar
22653not-reduced.y: warning: 3 rules useless in grammar
22654not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
22655 not_reachable: useful  { /* A not reachable action. */ }
22656 ^^^^^^^^^^^^^
22657not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
22658    | non_productive    { /* A non productive action. */ }
22659      ^^^^^^^^^^^^^^
22660not-reduced.y:11.6-57: warning: rule useless in grammar
22661    | non_productive    { /* A non productive action. */ }
22662      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22663not-reduced.y:14.16-56: warning: rule useless in grammar
22664 not_reachable: useful  { /* A not reachable action. */ }
22665                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22666not-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=:
22671at_fn_diff_devnull "$at_stdout" || at_failed=:
22672at_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.
22679if 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"
22688at_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>&-
22691at_status=$? at_failed=false
22692$at_check_filter
22693echo stderr:; tee stderr <"$at_stderr"
22694$at_diff expout "$at_stdout" || at_failed=:
22695at_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'
22703not-reduced.y: warning: 2 nonterminals useless in grammar
22704not-reduced.y: warning: 3 rules useless in grammar
22705not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
22706 not_reachable: useful  { /* A not reachable action. */ }
22707 ^^^^^^^^^^^^^
22708not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
22709    | non_productive    { /* A non productive action. */ }
22710      ^^^^^^^^^^^^^^
22711not-reduced.y:11.6-57: warning: rule useless in grammar
22712    | non_productive    { /* A non productive action. */ }
22713      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22714not-reduced.y:14.16-56: warning: rule useless in grammar
22715 not_reachable: useful  { /* A not reachable action. */ }
22716                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22717not-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"
22749at_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>&-
22753at_status=$? at_failed=false
22754$at_check_filter
22755$at_diff experr "$at_stderr" || at_failed=:
22756at_fn_diff_devnull "$at_stdout" || at_failed=:
22757at_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"
22766at_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>&-
22769at_status=$? at_failed=false
22770$at_check_filter
22771$at_diff experr "$at_stderr" || at_failed=:
22772$at_diff expout "$at_stdout" || at_failed=:
22773at_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"
22783at_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>&-
22786at_status=$? at_failed=false
22787$at_check_filter
22788at_fn_diff_devnull "$at_stderr" || at_failed=:
22789$at_diff expout "$at_stdout" || at_failed=:
22790at_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"
22796at_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>&-
22799at_status=$? at_failed=false
22800$at_check_filter
22801at_fn_diff_devnull "$at_stderr" || at_failed=:
22802$at_diff expout "$at_stdout" || at_failed=:
22803at_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
22809fi
22810
22811if 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"
22819at_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>&-
22823at_status=$? at_failed=false
22824$at_check_filter
22825echo stderr:; cat "$at_stderr"
22826echo stdout:; cat "$at_stdout"
22827at_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"
22833at_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>&-
22836at_status=$? at_failed=false
22837$at_check_filter
22838echo stderr:; cat "$at_stderr"
22839echo stdout:; cat "$at_stdout"
22840at_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"
22849at_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>&-
22854at_status=$? at_failed=false
22855$at_check_filter
22856at_fn_diff_devnull "$at_stderr" || at_failed=:
22857$at_diff expout "$at_stdout" || at_failed=:
22858at_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"
22867at_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>&-
22872at_status=$? at_failed=false
22873$at_check_filter
22874at_fn_diff_devnull "$at_stderr" || at_failed=:
22875$at_diff expout "$at_stdout" || at_failed=:
22876at_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
22882fi
22883{ set +x
22884$as_echo "$at_srcdir/reduce.at:320: bison not-reduced.y"
22885at_fn_check_prepare_trace "reduce.at:320"
22886( $at_check_trace; bison not-reduced.y
22887) >>"$at_stdout" 2>>"$at_stderr" 5>&-
22888at_status=$? at_failed=false
22889$at_check_filter
22890echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar
22891not-reduced.y: warning: 3 rules useless in grammar
22892not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
22893not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
22894not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
22895not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful
22896not-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=:
22899at_fn_diff_devnull "$at_stdout" || at_failed=:
22900at_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.
22907if 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"
22916at_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>&-
22919at_status=$? at_failed=false
22920$at_check_filter
22921echo stderr:; tee stderr <"$at_stderr"
22922$at_diff expout "$at_stdout" || at_failed=:
22923at_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'
22931not-reduced.y: warning: 2 nonterminals useless in grammar
22932not-reduced.y: warning: 3 rules useless in grammar
22933not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
22934not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
22935not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
22936not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful
22937not-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"
22967at_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>&-
22971at_status=$? at_failed=false
22972$at_check_filter
22973$at_diff experr "$at_stderr" || at_failed=:
22974at_fn_diff_devnull "$at_stdout" || at_failed=:
22975at_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"
22984at_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>&-
22987at_status=$? at_failed=false
22988$at_check_filter
22989$at_diff experr "$at_stderr" || at_failed=:
22990$at_diff expout "$at_stdout" || at_failed=:
22991at_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"
23001at_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>&-
23004at_status=$? at_failed=false
23005$at_check_filter
23006at_fn_diff_devnull "$at_stderr" || at_failed=:
23007$at_diff expout "$at_stdout" || at_failed=:
23008at_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"
23014at_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>&-
23017at_status=$? at_failed=false
23018$at_check_filter
23019at_fn_diff_devnull "$at_stderr" || at_failed=:
23020$at_diff expout "$at_stdout" || at_failed=:
23021at_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
23027fi
23028
23029{ set +x
23030$as_echo "$at_srcdir/reduce.at:330: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
23031at_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>&-
23034at_status=$? at_failed=false
23035$at_check_filter
23036at_fn_diff_devnull "$at_stderr" || at_failed=:
23037echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
23038   not_reachable
23039   non_productive
23040Terminals unused in grammar
23041   useless_token
23042Rules 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=:
23048at_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# --------------------
23055cat >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
23065exp: 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
23079if 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"
23087at_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>&-
23091at_status=$? at_failed=false
23092$at_check_filter
23093echo stderr:; cat "$at_stderr"
23094echo stdout:; cat "$at_stdout"
23095at_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"
23101at_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>&-
23104at_status=$? at_failed=false
23105$at_check_filter
23106echo stderr:; cat "$at_stderr"
23107echo stdout:; cat "$at_stdout"
23108at_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"
23117at_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>&-
23122at_status=$? at_failed=false
23123$at_check_filter
23124at_fn_diff_devnull "$at_stderr" || at_failed=:
23125$at_diff expout "$at_stdout" || at_failed=:
23126at_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"
23135at_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>&-
23140at_status=$? at_failed=false
23141$at_check_filter
23142at_fn_diff_devnull "$at_stderr" || at_failed=:
23143$at_diff expout "$at_stdout" || at_failed=:
23144at_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
23150fi
23151{ set +x
23152$as_echo "$at_srcdir/reduce.at:367: bison reduced.y"
23153at_fn_check_prepare_trace "reduce.at:367"
23154( $at_check_trace; bison reduced.y
23155) >>"$at_stdout" 2>>"$at_stderr" 5>&-
23156at_status=$? at_failed=false
23157$at_check_filter
23158at_fn_diff_devnull "$at_stderr" || at_failed=:
23159at_fn_diff_devnull "$at_stdout" || at_failed=:
23160at_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.
23167cp reduced.c expout
23168{ set +x
23169$as_echo "$at_srcdir/reduce.at:371: sed 's/not-reduced/reduced/g' not-reduced.c"
23170at_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>&-
23173at_status=$? at_failed=false
23174$at_check_filter
23175at_fn_diff_devnull "$at_stderr" || at_failed=:
23176$at_diff expout "$at_stdout" || at_failed=:
23177at_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
23185read at_status <"$at_status_file"
23186#AT_STOP_105
23187#AT_START_106
23188at_fn_group_banner 106 'reduce.at:381' \
23189  "Underivable Rules" "                              " 6
23190at_xfail=no
23191(
23192  $as_echo "106. $at_setup_line: testing $at_desc ..."
23193  $at_traceon
23194
23195
23196
23197
23198cat >input.y <<'_ATEOF'
23199%verbose
23200%output "input.c"
23201%token useful
23202%%
23203exp: useful | underivable;
23204underivable: indirection;
23205indirection: underivable;
23206_ATEOF
23207
23208
23209if 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"
23217at_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>&-
23221at_status=$? at_failed=false
23222$at_check_filter
23223echo stderr:; cat "$at_stderr"
23224echo stdout:; cat "$at_stdout"
23225at_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"
23231at_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>&-
23234at_status=$? at_failed=false
23235$at_check_filter
23236echo stderr:; cat "$at_stderr"
23237echo stdout:; cat "$at_stdout"
23238at_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"
23247at_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>&-
23252at_status=$? at_failed=false
23253$at_check_filter
23254at_fn_diff_devnull "$at_stderr" || at_failed=:
23255$at_diff expout "$at_stdout" || at_failed=:
23256at_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"
23265at_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>&-
23270at_status=$? at_failed=false
23271$at_check_filter
23272at_fn_diff_devnull "$at_stderr" || at_failed=:
23273$at_diff expout "$at_stdout" || at_failed=:
23274at_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
23280fi
23281{ set +x
23282$as_echo "$at_srcdir/reduce.at:395: bison input.y"
23283at_fn_check_prepare_trace "reduce.at:395"
23284( $at_check_trace; bison input.y
23285) >>"$at_stdout" 2>>"$at_stderr" 5>&-
23286at_status=$? at_failed=false
23287$at_check_filter
23288echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
23289input.y: warning: 3 rules useless in grammar
23290input.y:5.15-25: warning: nonterminal useless in grammar: underivable
23291input.y:6.14-24: warning: nonterminal useless in grammar: indirection
23292input.y:5.15-25: warning: rule useless in grammar: exp: underivable
23293input.y:6.14-24: warning: rule useless in grammar: underivable: indirection
23294input.y:7.14-24: warning: rule useless in grammar: indirection: underivable
23295" | \
23296  $at_diff - "$at_stderr" || at_failed=:
23297at_fn_diff_devnull "$at_stdout" || at_failed=:
23298at_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.
23305if 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"
23314at_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>&-
23317at_status=$? at_failed=false
23318$at_check_filter
23319echo stderr:; tee stderr <"$at_stderr"
23320$at_diff expout "$at_stdout" || at_failed=:
23321at_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'
23329input.y: warning: 2 nonterminals useless in grammar
23330input.y: warning: 3 rules useless in grammar
23331input.y:5.15-25: warning: nonterminal useless in grammar: underivable
23332input.y:6.14-24: warning: nonterminal useless in grammar: indirection
23333input.y:5.15-25: warning: rule useless in grammar: exp: underivable
23334input.y:6.14-24: warning: rule useless in grammar: underivable: indirection
23335input.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"
23365at_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>&-
23369at_status=$? at_failed=false
23370$at_check_filter
23371$at_diff experr "$at_stderr" || at_failed=:
23372at_fn_diff_devnull "$at_stdout" || at_failed=:
23373at_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"
23382at_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>&-
23385at_status=$? at_failed=false
23386$at_check_filter
23387$at_diff experr "$at_stderr" || at_failed=:
23388$at_diff expout "$at_stdout" || at_failed=:
23389at_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"
23399at_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>&-
23402at_status=$? at_failed=false
23403$at_check_filter
23404at_fn_diff_devnull "$at_stderr" || at_failed=:
23405$at_diff expout "$at_stdout" || at_failed=:
23406at_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"
23412at_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>&-
23415at_status=$? at_failed=false
23416$at_check_filter
23417at_fn_diff_devnull "$at_stderr" || at_failed=:
23418$at_diff expout "$at_stdout" || at_failed=:
23419at_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
23425fi
23426
23427{ set +x
23428$as_echo "$at_srcdir/reduce.at:405: sed -n '/^Grammar/q;/^\$/!p' input.output"
23429at_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>&-
23432at_status=$? at_failed=false
23433$at_check_filter
23434at_fn_diff_devnull "$at_stderr" || at_failed=:
23435echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
23436   underivable
23437   indirection
23438Rules useless in grammar
23439    2 exp: underivable
23440    3 underivable: indirection
23441    4 indirection: underivable
23442" | \
23443  $at_diff - "$at_stdout" || at_failed=:
23444at_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
23452read at_status <"$at_status_file"
23453#AT_STOP_106
23454#AT_START_107
23455at_fn_group_banner 107 'reduce.at:423' \
23456  "Empty Language" "                                 " 6
23457at_xfail=no
23458(
23459  $as_echo "107. $at_setup_line: testing $at_desc ..."
23460  $at_traceon
23461
23462
23463cat >input.y <<'_ATEOF'
23464%output "input.c"
23465%%
23466exp: 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"
23473at_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>&-
23476at_status=$? at_failed=false
23477$at_check_filter
23478echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
23479input.y: warning: 2 rules useless in grammar
23480input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
23481" | \
23482  $at_diff - "$at_stderr" || at_failed=:
23483at_fn_diff_devnull "$at_stdout" || at_failed=:
23484at_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
23493read at_status <"$at_status_file"
23494#AT_STOP_107
23495#AT_START_108
23496at_fn_group_banner 108 'reduce.at:474' \
23497  "no %define lr.type: Single State Split" "         " 6
23498at_xfail=no
23499(
23500  $as_echo "108. $at_setup_line: testing $at_desc ..."
23501  $at_traceon
23502
23503
23504cat >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
23527S: '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.  */
23546A: '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.  */
23554c: 'a' 'b' /* rule 6 */
23555 | A       /* rule 7 */
23556 ;
23557
23558
23559%%
23560#include <stdio.h>
23561/* A C error reporting function.  */
23562static
23563void yyerror ( const char *msg)
23564{
23565  fprintf (stderr, "%s\n", msg);
23566}
23567static int
23568yylex (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
23577int
23578main (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
23592if 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"
23600at_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>&-
23604at_status=$? at_failed=false
23605$at_check_filter
23606echo stderr:; cat "$at_stderr"
23607echo stdout:; cat "$at_stdout"
23608at_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"
23614at_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>&-
23617at_status=$? at_failed=false
23618$at_check_filter
23619echo stderr:; cat "$at_stderr"
23620echo stdout:; cat "$at_stdout"
23621at_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"
23630at_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>&-
23635at_status=$? at_failed=false
23636$at_check_filter
23637at_fn_diff_devnull "$at_stderr" || at_failed=:
23638$at_diff expout "$at_stdout" || at_failed=:
23639at_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"
23648at_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>&-
23653at_status=$? at_failed=false
23654$at_check_filter
23655at_fn_diff_devnull "$at_stderr" || at_failed=:
23656$at_diff expout "$at_stdout" || at_failed=:
23657at_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
23663fi
23664{ set +x
23665$as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
23666at_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>&-
23669at_status=$? at_failed=false
23670$at_check_filter
23671at_fn_diff_devnull "$at_stderr" || at_failed=:
23672at_fn_diff_devnull "$at_stdout" || at_failed=:
23673at_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"
23681at_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>&-
23684at_status=$? at_failed=false
23685$at_check_filter
23686at_fn_diff_devnull "$at_stderr" || at_failed=:
23687echo >>"$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
23701State 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
23712State 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
23723State 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
23737State 4
23738
23739    0 \$accept: S . \$end
23740
23741    \$end  shift, and go to state 11
23742
23743
23744State 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
23754State 6
23755
23756    1 S: 'a' A . 'a'
23757
23758    'a'  shift, and go to state 13
23759
23760
23761State 7
23762
23763    2 S: 'b' A . 'b'
23764
23765    'b'  shift, and go to state 14
23766
23767
23768State 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
23780State 9
23781
23782    7 c: A .
23783
23784    \$default  reduce using rule 7 (c)
23785
23786
23787State 10
23788
23789    3 S: 'c' c .
23790
23791    \$default  reduce using rule 3 (S)
23792
23793
23794State 11
23795
23796    0 \$accept: S \$end .
23797
23798    \$default  accept
23799
23800
23801State 12
23802
23803    4 A: 'a' 'a' .
23804
23805    \$default  reduce using rule 4 (A)
23806
23807
23808State 13
23809
23810    1 S: 'a' A 'a' .
23811
23812    \$default  reduce using rule 1 (S)
23813
23814
23815State 14
23816
23817    2 S: 'b' A 'b' .
23818
23819    \$default  reduce using rule 2 (S)
23820
23821
23822State 15
23823
23824    6 c: 'a' 'b' .
23825
23826    \$default  reduce using rule 6 (c)
23827" | \
23828  $at_diff - "$at_stdout" || at_failed=:
23829at_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"
23845at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
23846( $at_check_trace; $BISON_C_WORKS
23847) >>"$at_stdout" 2>>"$at_stderr" 5>&-
23848at_status=$? at_failed=false
23849$at_check_filter
23850echo stderr:; cat "$at_stderr"
23851echo stdout:; cat "$at_stdout"
23852at_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"
23858at_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>&-
23861at_status=$? at_failed=false
23862$at_check_filter
23863echo stderr:; cat "$at_stderr"
23864echo stdout:; cat "$at_stdout"
23865at_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"
23872at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
23873( $at_check_trace;  $PREPARSER ./input
23874) >>"$at_stdout" 2>>"$at_stderr" 5>&-
23875at_status=$? at_failed=false
23876$at_check_filter
23877echo stderr:; tee stderr <"$at_stderr"
23878at_fn_diff_devnull "$at_stdout" || at_failed=:
23879at_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"
23885at_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>&-
23888at_status=$? at_failed=false
23889$at_check_filter
23890echo >>"$at_stderr"; $as_echo "syntax error
23891" | \
23892  $at_diff - "$at_stderr" || at_failed=:
23893at_fn_diff_devnull "$at_stdout" || at_failed=:
23894at_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
23904read at_status <"$at_status_file"
23905#AT_STOP_108
23906#AT_START_109
23907at_fn_group_banner 109 'reduce.at:474' \
23908  "%define lr.type lalr: Single State Split" "       " 6
23909at_xfail=no
23910(
23911  $as_echo "109. $at_setup_line: testing $at_desc ..."
23912  $at_traceon
23913
23914
23915cat >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
23939S: '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.  */
23958A: '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.  */
23966c: 'a' 'b' /* rule 6 */
23967 | A       /* rule 7 */
23968 ;
23969
23970
23971%%
23972#include <stdio.h>
23973/* A C error reporting function.  */
23974static
23975void yyerror ( const char *msg)
23976{
23977  fprintf (stderr, "%s\n", msg);
23978}
23979static int
23980yylex (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
23989int
23990main (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
24004if 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"
24012at_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>&-
24016at_status=$? at_failed=false
24017$at_check_filter
24018echo stderr:; cat "$at_stderr"
24019echo stdout:; cat "$at_stdout"
24020at_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"
24026at_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>&-
24029at_status=$? at_failed=false
24030$at_check_filter
24031echo stderr:; cat "$at_stderr"
24032echo stdout:; cat "$at_stdout"
24033at_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"
24042at_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>&-
24047at_status=$? at_failed=false
24048$at_check_filter
24049at_fn_diff_devnull "$at_stderr" || at_failed=:
24050$at_diff expout "$at_stdout" || at_failed=:
24051at_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"
24060at_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>&-
24065at_status=$? at_failed=false
24066$at_check_filter
24067at_fn_diff_devnull "$at_stderr" || at_failed=:
24068$at_diff expout "$at_stdout" || at_failed=:
24069at_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
24075fi
24076{ set +x
24077$as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
24078at_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>&-
24081at_status=$? at_failed=false
24082$at_check_filter
24083at_fn_diff_devnull "$at_stderr" || at_failed=:
24084at_fn_diff_devnull "$at_stdout" || at_failed=:
24085at_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"
24093at_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>&-
24096at_status=$? at_failed=false
24097$at_check_filter
24098at_fn_diff_devnull "$at_stderr" || at_failed=:
24099echo >>"$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
24113State 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
24124State 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
24135State 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
24149State 4
24150
24151    0 \$accept: S . \$end
24152
24153    \$end  shift, and go to state 11
24154
24155
24156State 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
24166State 6
24167
24168    1 S: 'a' A . 'a'
24169
24170    'a'  shift, and go to state 13
24171
24172
24173State 7
24174
24175    2 S: 'b' A . 'b'
24176
24177    'b'  shift, and go to state 14
24178
24179
24180State 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
24192State 9
24193
24194    7 c: A .
24195
24196    \$default  reduce using rule 7 (c)
24197
24198
24199State 10
24200
24201    3 S: 'c' c .
24202
24203    \$default  reduce using rule 3 (S)
24204
24205
24206State 11
24207
24208    0 \$accept: S \$end .
24209
24210    \$default  accept
24211
24212
24213State 12
24214
24215    4 A: 'a' 'a' .
24216
24217    \$default  reduce using rule 4 (A)
24218
24219
24220State 13
24221
24222    1 S: 'a' A 'a' .
24223
24224    \$default  reduce using rule 1 (S)
24225
24226
24227State 14
24228
24229    2 S: 'b' A 'b' .
24230
24231    \$default  reduce using rule 2 (S)
24232
24233
24234State 15
24235
24236    6 c: 'a' 'b' .
24237
24238    \$default  reduce using rule 6 (c)
24239" | \
24240  $at_diff - "$at_stdout" || at_failed=:
24241at_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"
24257at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
24258( $at_check_trace; $BISON_C_WORKS
24259) >>"$at_stdout" 2>>"$at_stderr" 5>&-
24260at_status=$? at_failed=false
24261$at_check_filter
24262echo stderr:; cat "$at_stderr"
24263echo stdout:; cat "$at_stdout"
24264at_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"
24270at_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>&-
24273at_status=$? at_failed=false
24274$at_check_filter
24275echo stderr:; cat "$at_stderr"
24276echo stdout:; cat "$at_stdout"
24277at_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"
24284at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
24285( $at_check_trace;  $PREPARSER ./input
24286) >>"$at_stdout" 2>>"$at_stderr" 5>&-
24287at_status=$? at_failed=false
24288$at_check_filter
24289echo stderr:; tee stderr <"$at_stderr"
24290at_fn_diff_devnull "$at_stdout" || at_failed=:
24291at_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"
24297at_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>&-
24300at_status=$? at_failed=false
24301$at_check_filter
24302echo >>"$at_stderr"; $as_echo "syntax error
24303" | \
24304  $at_diff - "$at_stderr" || at_failed=:
24305at_fn_diff_devnull "$at_stdout" || at_failed=:
24306at_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
24316read at_status <"$at_status_file"
24317#AT_STOP_109
24318#AT_START_110
24319at_fn_group_banner 110 'reduce.at:474' \
24320  "%define lr.type ielr: Single State Split" "       " 6
24321at_xfail=no
24322(
24323  $as_echo "110. $at_setup_line: testing $at_desc ..."
24324  $at_traceon
24325
24326
24327cat >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
24351S: '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.  */
24370A: '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.  */
24378c: 'a' 'b' /* rule 6 */
24379 | A       /* rule 7 */
24380 ;
24381
24382
24383%%
24384#include <stdio.h>
24385/* A C error reporting function.  */
24386static
24387void yyerror ( const char *msg)
24388{
24389  fprintf (stderr, "%s\n", msg);
24390}
24391static int
24392yylex (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
24401int
24402main (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
24416if 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"
24424at_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>&-
24428at_status=$? at_failed=false
24429$at_check_filter
24430echo stderr:; cat "$at_stderr"
24431echo stdout:; cat "$at_stdout"
24432at_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"
24438at_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>&-
24441at_status=$? at_failed=false
24442$at_check_filter
24443echo stderr:; cat "$at_stderr"
24444echo stdout:; cat "$at_stdout"
24445at_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"
24454at_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>&-
24459at_status=$? at_failed=false
24460$at_check_filter
24461at_fn_diff_devnull "$at_stderr" || at_failed=:
24462$at_diff expout "$at_stdout" || at_failed=:
24463at_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"
24472at_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>&-
24477at_status=$? at_failed=false
24478$at_check_filter
24479at_fn_diff_devnull "$at_stderr" || at_failed=:
24480$at_diff expout "$at_stdout" || at_failed=:
24481at_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
24487fi
24488{ set +x
24489$as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
24490at_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>&-
24493at_status=$? at_failed=false
24494$at_check_filter
24495at_fn_diff_devnull "$at_stderr" || at_failed=:
24496at_fn_diff_devnull "$at_stdout" || at_failed=:
24497at_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"
24505at_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>&-
24508at_status=$? at_failed=false
24509$at_check_filter
24510at_fn_diff_devnull "$at_stderr" || at_failed=:
24511echo >>"$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
24525State 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
24536State 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
24547State 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
24561State 4
24562
24563    0 \$accept: S . \$end
24564
24565    \$end  shift, and go to state 11
24566
24567
24568State 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
24578State 6
24579
24580    1 S: 'a' A . 'a'
24581
24582    'a'  shift, and go to state 13
24583
24584
24585State 7
24586
24587    2 S: 'b' A . 'b'
24588
24589    'b'  shift, and go to state 14
24590
24591
24592State 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
24604State 9
24605
24606    7 c: A .
24607
24608    \$default  reduce using rule 7 (c)
24609
24610
24611State 10
24612
24613    3 S: 'c' c .
24614
24615    \$default  reduce using rule 3 (S)
24616
24617
24618State 11
24619
24620    0 \$accept: S \$end .
24621
24622    \$default  accept
24623
24624
24625State 12
24626
24627    4 A: 'a' 'a' .
24628
24629    \$default  reduce using rule 4 (A)
24630
24631
24632State 13
24633
24634    1 S: 'a' A 'a' .
24635
24636    \$default  reduce using rule 1 (S)
24637
24638
24639State 14
24640
24641    2 S: 'b' A 'b' .
24642
24643    \$default  reduce using rule 2 (S)
24644
24645
24646State 15
24647
24648    6 c: 'a' 'b' .
24649
24650    \$default  reduce using rule 6 (c)
24651
24652
24653State 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=:
24663at_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"
24679at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
24680( $at_check_trace; $BISON_C_WORKS
24681) >>"$at_stdout" 2>>"$at_stderr" 5>&-
24682at_status=$? at_failed=false
24683$at_check_filter
24684echo stderr:; cat "$at_stderr"
24685echo stdout:; cat "$at_stdout"
24686at_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"
24692at_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>&-
24695at_status=$? at_failed=false
24696$at_check_filter
24697echo stderr:; cat "$at_stderr"
24698echo stdout:; cat "$at_stdout"
24699at_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"
24706at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
24707( $at_check_trace;  $PREPARSER ./input
24708) >>"$at_stdout" 2>>"$at_stderr" 5>&-
24709at_status=$? at_failed=false
24710$at_check_filter
24711echo stderr:; tee stderr <"$at_stderr"
24712at_fn_diff_devnull "$at_stdout" || at_failed=:
24713at_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"
24719at_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>&-
24722at_status=$? at_failed=false
24723$at_check_filter
24724at_fn_diff_devnull "$at_stderr" || at_failed=:
24725at_fn_diff_devnull "$at_stdout" || at_failed=:
24726at_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
24736read at_status <"$at_status_file"
24737#AT_STOP_110
24738#AT_START_111
24739at_fn_group_banner 111 'reduce.at:474' \
24740  "%define lr.type canonical-lr: Single State Split" "" 6
24741at_xfail=no
24742(
24743  $as_echo "111. $at_setup_line: testing $at_desc ..."
24744  $at_traceon
24745
24746
24747cat >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
24771S: '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.  */
24790A: '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.  */
24798c: 'a' 'b' /* rule 6 */
24799 | A       /* rule 7 */
24800 ;
24801
24802
24803%%
24804#include <stdio.h>
24805/* A C error reporting function.  */
24806static
24807void yyerror ( const char *msg)
24808{
24809  fprintf (stderr, "%s\n", msg);
24810}
24811static int
24812yylex (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
24821int
24822main (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
24836if 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"
24844at_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>&-
24848at_status=$? at_failed=false
24849$at_check_filter
24850echo stderr:; cat "$at_stderr"
24851echo stdout:; cat "$at_stdout"
24852at_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"
24858at_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>&-
24861at_status=$? at_failed=false
24862$at_check_filter
24863echo stderr:; cat "$at_stderr"
24864echo stdout:; cat "$at_stdout"
24865at_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"
24874at_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>&-
24879at_status=$? at_failed=false
24880$at_check_filter
24881at_fn_diff_devnull "$at_stderr" || at_failed=:
24882$at_diff expout "$at_stdout" || at_failed=:
24883at_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"
24892at_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>&-
24897at_status=$? at_failed=false
24898$at_check_filter
24899at_fn_diff_devnull "$at_stderr" || at_failed=:
24900$at_diff expout "$at_stdout" || at_failed=:
24901at_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
24907fi
24908{ set +x
24909$as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
24910at_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>&-
24913at_status=$? at_failed=false
24914$at_check_filter
24915at_fn_diff_devnull "$at_stderr" || at_failed=:
24916at_fn_diff_devnull "$at_stdout" || at_failed=:
24917at_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"
24925at_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>&-
24928at_status=$? at_failed=false
24929$at_check_filter
24930at_fn_diff_devnull "$at_stderr" || at_failed=:
24931echo >>"$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
24945State 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
24956State 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
24967State 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
24981State 4
24982
24983    0 \$accept: S . \$end
24984
24985    \$end  shift, and go to state 11
24986
24987
24988State 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
24998State 6
24999
25000    1 S: 'a' A . 'a'
25001
25002    'a'  shift, and go to state 13
25003
25004
25005State 7
25006
25007    2 S: 'b' A . 'b'
25008
25009    'b'  shift, and go to state 14
25010
25011
25012State 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
25024State 9
25025
25026    7 c: A .  [\$end]
25027
25028    \$end  reduce using rule 7 (c)
25029
25030
25031State 10
25032
25033    3 S: 'c' c .  [\$end]
25034
25035    \$end  reduce using rule 3 (S)
25036
25037
25038State 11
25039
25040    0 \$accept: S \$end .
25041
25042    \$default  accept
25043
25044
25045State 12
25046
25047    4 A: 'a' 'a' .  ['a']
25048
25049    'a'  reduce using rule 4 (A)
25050
25051
25052State 13
25053
25054    1 S: 'a' A 'a' .  [\$end]
25055
25056    \$end  reduce using rule 1 (S)
25057
25058
25059State 14
25060
25061    2 S: 'b' A 'b' .  [\$end]
25062
25063    \$end  reduce using rule 2 (S)
25064
25065
25066State 15
25067
25068    6 c: 'a' 'b' .  [\$end]
25069
25070    \$end  reduce using rule 6 (c)
25071
25072
25073State 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
25083State 17
25084
25085    4 A: 'a' 'a' .  [\$end]
25086
25087    \$end  reduce using rule 4 (A)
25088
25089
25090State 18
25091
25092    4 A: 'a' 'a' .  ['b']
25093
25094    'b'  reduce using rule 4 (A)
25095" | \
25096  $at_diff - "$at_stdout" || at_failed=:
25097at_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.
25110if test 32767 -lt `wc -l < input.c`; then
25111  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
25112  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
25113fi
25114{ set +x
25115$as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS"
25116at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
25117( $at_check_trace; $BISON_C_WORKS
25118) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25119at_status=$? at_failed=false
25120$at_check_filter
25121echo stderr:; cat "$at_stderr"
25122echo stdout:; cat "$at_stdout"
25123at_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"
25129at_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>&-
25132at_status=$? at_failed=false
25133$at_check_filter
25134echo stderr:; cat "$at_stderr"
25135echo stdout:; cat "$at_stdout"
25136at_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"
25143at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
25144( $at_check_trace;  $PREPARSER ./input
25145) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25146at_status=$? at_failed=false
25147$at_check_filter
25148echo stderr:; tee stderr <"$at_stderr"
25149at_fn_diff_devnull "$at_stdout" || at_failed=:
25150at_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"
25156at_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>&-
25159at_status=$? at_failed=false
25160$at_check_filter
25161at_fn_diff_devnull "$at_stderr" || at_failed=:
25162at_fn_diff_devnull "$at_stdout" || at_failed=:
25163at_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
25173read at_status <"$at_status_file"
25174#AT_STOP_111
25175#AT_START_112
25176at_fn_group_banner 112 'reduce.at:707' \
25177  "no %define lr.type: Lane Split" "                 " 6
25178at_xfail=no
25179(
25180  $as_echo "112. $at_setup_line: testing $at_desc ..."
25181  $at_traceon
25182
25183
25184cat >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.  */
25208S: 'a' A 'a' /* rule 1 */
25209 | 'b' A 'b' /* rule 2 */
25210 | 'c' c     /* rule 3 */
25211 ;
25212
25213A: 'a' 'a' 'a' /* rule 4 */
25214 | 'a' 'a'     /* rule 5 */
25215 ;
25216
25217c: 'a' 'a' 'b' /* rule 6 */
25218 | A           /* rule 7 */
25219 ;
25220
25221
25222%%
25223#include <stdio.h>
25224/* A C error reporting function.  */
25225static
25226void yyerror ( const char *msg)
25227{
25228  fprintf (stderr, "%s\n", msg);
25229}
25230static int
25231yylex (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
25240int
25241main (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
25255if 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"
25263at_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>&-
25267at_status=$? at_failed=false
25268$at_check_filter
25269echo stderr:; cat "$at_stderr"
25270echo stdout:; cat "$at_stdout"
25271at_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"
25277at_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>&-
25280at_status=$? at_failed=false
25281$at_check_filter
25282echo stderr:; cat "$at_stderr"
25283echo stdout:; cat "$at_stdout"
25284at_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"
25293at_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>&-
25298at_status=$? at_failed=false
25299$at_check_filter
25300at_fn_diff_devnull "$at_stderr" || at_failed=:
25301$at_diff expout "$at_stdout" || at_failed=:
25302at_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"
25311at_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>&-
25316at_status=$? at_failed=false
25317$at_check_filter
25318at_fn_diff_devnull "$at_stderr" || at_failed=:
25319$at_diff expout "$at_stdout" || at_failed=:
25320at_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
25326fi
25327{ set +x
25328$as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
25329at_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>&-
25332at_status=$? at_failed=false
25333$at_check_filter
25334at_fn_diff_devnull "$at_stderr" || at_failed=:
25335at_fn_diff_devnull "$at_stdout" || at_failed=:
25336at_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"
25344at_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>&-
25347at_status=$? at_failed=false
25348$at_check_filter
25349at_fn_diff_devnull "$at_stderr" || at_failed=:
25350echo >>"$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
25364State 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
25375State 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
25386State 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
25400State 4
25401
25402    0 \$accept: S . \$end
25403
25404    \$end  shift, and go to state 11
25405
25406
25407State 5
25408
25409    4 A: 'a' . 'a' 'a'
25410    5  | 'a' . 'a'
25411
25412    'a'  shift, and go to state 12
25413
25414
25415State 6
25416
25417    1 S: 'a' A . 'a'
25418
25419    'a'  shift, and go to state 13
25420
25421
25422State 7
25423
25424    2 S: 'b' A . 'b'
25425
25426    'b'  shift, and go to state 14
25427
25428
25429State 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
25438State 9
25439
25440    7 c: A .
25441
25442    \$default  reduce using rule 7 (c)
25443
25444
25445State 10
25446
25447    3 S: 'c' c .
25448
25449    \$default  reduce using rule 3 (S)
25450
25451
25452State 11
25453
25454    0 \$accept: S \$end .
25455
25456    \$default  accept
25457
25458
25459State 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
25469State 13
25470
25471    1 S: 'a' A 'a' .
25472
25473    \$default  reduce using rule 1 (S)
25474
25475
25476State 14
25477
25478    2 S: 'b' A 'b' .
25479
25480    \$default  reduce using rule 2 (S)
25481
25482
25483State 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
25495State 16
25496
25497    4 A: 'a' 'a' 'a' .
25498
25499    \$default  reduce using rule 4 (A)
25500
25501
25502State 17
25503
25504    6 c: 'a' 'a' 'b' .
25505
25506    \$default  reduce using rule 6 (c)
25507" | \
25508  $at_diff - "$at_stdout" || at_failed=:
25509at_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"
25525at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
25526( $at_check_trace; $BISON_C_WORKS
25527) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25528at_status=$? at_failed=false
25529$at_check_filter
25530echo stderr:; cat "$at_stderr"
25531echo stdout:; cat "$at_stdout"
25532at_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"
25538at_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>&-
25541at_status=$? at_failed=false
25542$at_check_filter
25543echo stderr:; cat "$at_stderr"
25544echo stdout:; cat "$at_stdout"
25545at_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"
25552at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
25553( $at_check_trace;  $PREPARSER ./input
25554) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25555at_status=$? at_failed=false
25556$at_check_filter
25557echo stderr:; tee stderr <"$at_stderr"
25558at_fn_diff_devnull "$at_stdout" || at_failed=:
25559at_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"
25565at_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>&-
25568at_status=$? at_failed=false
25569$at_check_filter
25570echo >>"$at_stderr"; $as_echo "syntax error
25571" | \
25572  $at_diff - "$at_stderr" || at_failed=:
25573at_fn_diff_devnull "$at_stdout" || at_failed=:
25574at_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
25584read at_status <"$at_status_file"
25585#AT_STOP_112
25586#AT_START_113
25587at_fn_group_banner 113 'reduce.at:707' \
25588  "%define lr.type lalr: Lane Split" "               " 6
25589at_xfail=no
25590(
25591  $as_echo "113. $at_setup_line: testing $at_desc ..."
25592  $at_traceon
25593
25594
25595cat >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.  */
25620S: 'a' A 'a' /* rule 1 */
25621 | 'b' A 'b' /* rule 2 */
25622 | 'c' c     /* rule 3 */
25623 ;
25624
25625A: 'a' 'a' 'a' /* rule 4 */
25626 | 'a' 'a'     /* rule 5 */
25627 ;
25628
25629c: 'a' 'a' 'b' /* rule 6 */
25630 | A           /* rule 7 */
25631 ;
25632
25633
25634%%
25635#include <stdio.h>
25636/* A C error reporting function.  */
25637static
25638void yyerror ( const char *msg)
25639{
25640  fprintf (stderr, "%s\n", msg);
25641}
25642static int
25643yylex (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
25652int
25653main (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
25667if 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"
25675at_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>&-
25679at_status=$? at_failed=false
25680$at_check_filter
25681echo stderr:; cat "$at_stderr"
25682echo stdout:; cat "$at_stdout"
25683at_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"
25689at_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>&-
25692at_status=$? at_failed=false
25693$at_check_filter
25694echo stderr:; cat "$at_stderr"
25695echo stdout:; cat "$at_stdout"
25696at_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"
25705at_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>&-
25710at_status=$? at_failed=false
25711$at_check_filter
25712at_fn_diff_devnull "$at_stderr" || at_failed=:
25713$at_diff expout "$at_stdout" || at_failed=:
25714at_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"
25723at_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>&-
25728at_status=$? at_failed=false
25729$at_check_filter
25730at_fn_diff_devnull "$at_stderr" || at_failed=:
25731$at_diff expout "$at_stdout" || at_failed=:
25732at_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
25738fi
25739{ set +x
25740$as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
25741at_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>&-
25744at_status=$? at_failed=false
25745$at_check_filter
25746at_fn_diff_devnull "$at_stderr" || at_failed=:
25747at_fn_diff_devnull "$at_stdout" || at_failed=:
25748at_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"
25756at_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>&-
25759at_status=$? at_failed=false
25760$at_check_filter
25761at_fn_diff_devnull "$at_stderr" || at_failed=:
25762echo >>"$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
25776State 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
25787State 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
25798State 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
25812State 4
25813
25814    0 \$accept: S . \$end
25815
25816    \$end  shift, and go to state 11
25817
25818
25819State 5
25820
25821    4 A: 'a' . 'a' 'a'
25822    5  | 'a' . 'a'
25823
25824    'a'  shift, and go to state 12
25825
25826
25827State 6
25828
25829    1 S: 'a' A . 'a'
25830
25831    'a'  shift, and go to state 13
25832
25833
25834State 7
25835
25836    2 S: 'b' A . 'b'
25837
25838    'b'  shift, and go to state 14
25839
25840
25841State 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
25850State 9
25851
25852    7 c: A .
25853
25854    \$default  reduce using rule 7 (c)
25855
25856
25857State 10
25858
25859    3 S: 'c' c .
25860
25861    \$default  reduce using rule 3 (S)
25862
25863
25864State 11
25865
25866    0 \$accept: S \$end .
25867
25868    \$default  accept
25869
25870
25871State 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
25881State 13
25882
25883    1 S: 'a' A 'a' .
25884
25885    \$default  reduce using rule 1 (S)
25886
25887
25888State 14
25889
25890    2 S: 'b' A 'b' .
25891
25892    \$default  reduce using rule 2 (S)
25893
25894
25895State 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
25907State 16
25908
25909    4 A: 'a' 'a' 'a' .
25910
25911    \$default  reduce using rule 4 (A)
25912
25913
25914State 17
25915
25916    6 c: 'a' 'a' 'b' .
25917
25918    \$default  reduce using rule 6 (c)
25919" | \
25920  $at_diff - "$at_stdout" || at_failed=:
25921at_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"
25937at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
25938( $at_check_trace; $BISON_C_WORKS
25939) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25940at_status=$? at_failed=false
25941$at_check_filter
25942echo stderr:; cat "$at_stderr"
25943echo stdout:; cat "$at_stdout"
25944at_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"
25950at_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>&-
25953at_status=$? at_failed=false
25954$at_check_filter
25955echo stderr:; cat "$at_stderr"
25956echo stdout:; cat "$at_stdout"
25957at_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"
25964at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
25965( $at_check_trace;  $PREPARSER ./input
25966) >>"$at_stdout" 2>>"$at_stderr" 5>&-
25967at_status=$? at_failed=false
25968$at_check_filter
25969echo stderr:; tee stderr <"$at_stderr"
25970at_fn_diff_devnull "$at_stdout" || at_failed=:
25971at_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"
25977at_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>&-
25980at_status=$? at_failed=false
25981$at_check_filter
25982echo >>"$at_stderr"; $as_echo "syntax error
25983" | \
25984  $at_diff - "$at_stderr" || at_failed=:
25985at_fn_diff_devnull "$at_stdout" || at_failed=:
25986at_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
25996read at_status <"$at_status_file"
25997#AT_STOP_113
25998#AT_START_114
25999at_fn_group_banner 114 'reduce.at:707' \
26000  "%define lr.type ielr: Lane Split" "               " 6
26001at_xfail=no
26002(
26003  $as_echo "114. $at_setup_line: testing $at_desc ..."
26004  $at_traceon
26005
26006
26007cat >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.  */
26032S: 'a' A 'a' /* rule 1 */
26033 | 'b' A 'b' /* rule 2 */
26034 | 'c' c     /* rule 3 */
26035 ;
26036
26037A: 'a' 'a' 'a' /* rule 4 */
26038 | 'a' 'a'     /* rule 5 */
26039 ;
26040
26041c: 'a' 'a' 'b' /* rule 6 */
26042 | A           /* rule 7 */
26043 ;
26044
26045
26046%%
26047#include <stdio.h>
26048/* A C error reporting function.  */
26049static
26050void yyerror ( const char *msg)
26051{
26052  fprintf (stderr, "%s\n", msg);
26053}
26054static int
26055yylex (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
26064int
26065main (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
26079if 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"
26087at_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>&-
26091at_status=$? at_failed=false
26092$at_check_filter
26093echo stderr:; cat "$at_stderr"
26094echo stdout:; cat "$at_stdout"
26095at_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"
26101at_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>&-
26104at_status=$? at_failed=false
26105$at_check_filter
26106echo stderr:; cat "$at_stderr"
26107echo stdout:; cat "$at_stdout"
26108at_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"
26117at_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>&-
26122at_status=$? at_failed=false
26123$at_check_filter
26124at_fn_diff_devnull "$at_stderr" || at_failed=:
26125$at_diff expout "$at_stdout" || at_failed=:
26126at_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"
26135at_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>&-
26140at_status=$? at_failed=false
26141$at_check_filter
26142at_fn_diff_devnull "$at_stderr" || at_failed=:
26143$at_diff expout "$at_stdout" || at_failed=:
26144at_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
26150fi
26151{ set +x
26152$as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
26153at_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>&-
26156at_status=$? at_failed=false
26157$at_check_filter
26158at_fn_diff_devnull "$at_stderr" || at_failed=:
26159at_fn_diff_devnull "$at_stdout" || at_failed=:
26160at_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"
26168at_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>&-
26171at_status=$? at_failed=false
26172$at_check_filter
26173at_fn_diff_devnull "$at_stderr" || at_failed=:
26174echo >>"$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
26188State 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
26199State 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
26210State 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
26224State 4
26225
26226    0 \$accept: S . \$end
26227
26228    \$end  shift, and go to state 11
26229
26230
26231State 5
26232
26233    4 A: 'a' . 'a' 'a'
26234    5  | 'a' . 'a'
26235
26236    'a'  shift, and go to state 12
26237
26238
26239State 6
26240
26241    1 S: 'a' A . 'a'
26242
26243    'a'  shift, and go to state 13
26244
26245
26246State 7
26247
26248    2 S: 'b' A . 'b'
26249
26250    'b'  shift, and go to state 14
26251
26252
26253State 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
26262State 9
26263
26264    7 c: A .
26265
26266    \$default  reduce using rule 7 (c)
26267
26268
26269State 10
26270
26271    3 S: 'c' c .
26272
26273    \$default  reduce using rule 3 (S)
26274
26275
26276State 11
26277
26278    0 \$accept: S \$end .
26279
26280    \$default  accept
26281
26282
26283State 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
26293State 13
26294
26295    1 S: 'a' A 'a' .
26296
26297    \$default  reduce using rule 1 (S)
26298
26299
26300State 14
26301
26302    2 S: 'b' A 'b' .
26303
26304    \$default  reduce using rule 2 (S)
26305
26306
26307State 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
26319State 16
26320
26321    4 A: 'a' 'a' 'a' .
26322
26323    \$default  reduce using rule 4 (A)
26324
26325
26326State 17
26327
26328    6 c: 'a' 'a' 'b' .
26329
26330    \$default  reduce using rule 6 (c)
26331
26332
26333State 18
26334
26335    4 A: 'a' . 'a' 'a'
26336    5  | 'a' . 'a'
26337
26338    'a'  shift, and go to state 19
26339
26340
26341State 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=:
26351at_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"
26367at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
26368( $at_check_trace; $BISON_C_WORKS
26369) >>"$at_stdout" 2>>"$at_stderr" 5>&-
26370at_status=$? at_failed=false
26371$at_check_filter
26372echo stderr:; cat "$at_stderr"
26373echo stdout:; cat "$at_stdout"
26374at_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"
26380at_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>&-
26383at_status=$? at_failed=false
26384$at_check_filter
26385echo stderr:; cat "$at_stderr"
26386echo stdout:; cat "$at_stdout"
26387at_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"
26394at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
26395( $at_check_trace;  $PREPARSER ./input
26396) >>"$at_stdout" 2>>"$at_stderr" 5>&-
26397at_status=$? at_failed=false
26398$at_check_filter
26399echo stderr:; tee stderr <"$at_stderr"
26400at_fn_diff_devnull "$at_stdout" || at_failed=:
26401at_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"
26407at_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>&-
26410at_status=$? at_failed=false
26411$at_check_filter
26412at_fn_diff_devnull "$at_stderr" || at_failed=:
26413at_fn_diff_devnull "$at_stdout" || at_failed=:
26414at_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
26424read at_status <"$at_status_file"
26425#AT_STOP_114
26426#AT_START_115
26427at_fn_group_banner 115 'reduce.at:707' \
26428  "%define lr.type canonical-lr: Lane Split" "       " 6
26429at_xfail=no
26430(
26431  $as_echo "115. $at_setup_line: testing $at_desc ..."
26432  $at_traceon
26433
26434
26435cat >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.  */
26460S: 'a' A 'a' /* rule 1 */
26461 | 'b' A 'b' /* rule 2 */
26462 | 'c' c     /* rule 3 */
26463 ;
26464
26465A: 'a' 'a' 'a' /* rule 4 */
26466 | 'a' 'a'     /* rule 5 */
26467 ;
26468
26469c: 'a' 'a' 'b' /* rule 6 */
26470 | A           /* rule 7 */
26471 ;
26472
26473
26474%%
26475#include <stdio.h>
26476/* A C error reporting function.  */
26477static
26478void yyerror ( const char *msg)
26479{
26480  fprintf (stderr, "%s\n", msg);
26481}
26482static int
26483yylex (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
26492int
26493main (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
26507if 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"
26515at_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>&-
26519at_status=$? at_failed=false
26520$at_check_filter
26521echo stderr:; cat "$at_stderr"
26522echo stdout:; cat "$at_stdout"
26523at_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"
26529at_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>&-
26532at_status=$? at_failed=false
26533$at_check_filter
26534echo stderr:; cat "$at_stderr"
26535echo stdout:; cat "$at_stdout"
26536at_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"
26545at_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>&-
26550at_status=$? at_failed=false
26551$at_check_filter
26552at_fn_diff_devnull "$at_stderr" || at_failed=:
26553$at_diff expout "$at_stdout" || at_failed=:
26554at_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"
26563at_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>&-
26568at_status=$? at_failed=false
26569$at_check_filter
26570at_fn_diff_devnull "$at_stderr" || at_failed=:
26571$at_diff expout "$at_stdout" || at_failed=:
26572at_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
26578fi
26579{ set +x
26580$as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
26581at_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>&-
26584at_status=$? at_failed=false
26585$at_check_filter
26586at_fn_diff_devnull "$at_stderr" || at_failed=:
26587at_fn_diff_devnull "$at_stdout" || at_failed=:
26588at_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"
26596at_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>&-
26599at_status=$? at_failed=false
26600$at_check_filter
26601at_fn_diff_devnull "$at_stderr" || at_failed=:
26602echo >>"$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
26616State 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
26627State 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
26638State 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
26652State 4
26653
26654    0 \$accept: S . \$end
26655
26656    \$end  shift, and go to state 11
26657
26658
26659State 5
26660
26661    4 A: 'a' . 'a' 'a'
26662    5  | 'a' . 'a'
26663
26664    'a'  shift, and go to state 12
26665
26666
26667State 6
26668
26669    1 S: 'a' A . 'a'
26670
26671    'a'  shift, and go to state 13
26672
26673
26674State 7
26675
26676    2 S: 'b' A . 'b'
26677
26678    'b'  shift, and go to state 14
26679
26680
26681State 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
26690State 9
26691
26692    7 c: A .  [\$end]
26693
26694    \$end  reduce using rule 7 (c)
26695
26696
26697State 10
26698
26699    3 S: 'c' c .  [\$end]
26700
26701    \$end  reduce using rule 3 (S)
26702
26703
26704State 11
26705
26706    0 \$accept: S \$end .
26707
26708    \$default  accept
26709
26710
26711State 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
26721State 13
26722
26723    1 S: 'a' A 'a' .  [\$end]
26724
26725    \$end  reduce using rule 1 (S)
26726
26727
26728State 14
26729
26730    2 S: 'b' A 'b' .  [\$end]
26731
26732    \$end  reduce using rule 2 (S)
26733
26734
26735State 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
26747State 16
26748
26749    4 A: 'a' 'a' 'a' .  ['a']
26750
26751    'a'  reduce using rule 4 (A)
26752
26753
26754State 17
26755
26756    6 c: 'a' 'a' 'b' .  [\$end]
26757
26758    \$end  reduce using rule 6 (c)
26759
26760
26761State 18
26762
26763    4 A: 'a' . 'a' 'a'
26764    5  | 'a' . 'a'
26765
26766    'a'  shift, and go to state 20
26767
26768
26769State 19
26770
26771    4 A: 'a' 'a' 'a' .  [\$end]
26772
26773    \$end  reduce using rule 4 (A)
26774
26775
26776State 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
26786State 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=:
26793at_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.
26806if test 32767 -lt `wc -l < input.c`; then
26807  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
26808  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
26809fi
26810{ set +x
26811$as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS"
26812at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
26813( $at_check_trace; $BISON_C_WORKS
26814) >>"$at_stdout" 2>>"$at_stderr" 5>&-
26815at_status=$? at_failed=false
26816$at_check_filter
26817echo stderr:; cat "$at_stderr"
26818echo stdout:; cat "$at_stdout"
26819at_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"
26825at_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>&-
26828at_status=$? at_failed=false
26829$at_check_filter
26830echo stderr:; cat "$at_stderr"
26831echo stdout:; cat "$at_stdout"
26832at_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"
26839at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
26840( $at_check_trace;  $PREPARSER ./input
26841) >>"$at_stdout" 2>>"$at_stderr" 5>&-
26842at_status=$? at_failed=false
26843$at_check_filter
26844echo stderr:; tee stderr <"$at_stderr"
26845at_fn_diff_devnull "$at_stdout" || at_failed=:
26846at_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"
26852at_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>&-
26855at_status=$? at_failed=false
26856$at_check_filter
26857at_fn_diff_devnull "$at_stderr" || at_failed=:
26858at_fn_diff_devnull "$at_stdout" || at_failed=:
26859at_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
26869read at_status <"$at_status_file"
26870#AT_STOP_115
26871#AT_START_116
26872at_fn_group_banner 116 'reduce.at:951' \
26873  "no %define lr.type: Complex Lane Split" "         " 6
26874at_xfail=no
26875(
26876  $as_echo "116. $at_setup_line: testing $at_desc ..."
26877  $at_traceon
26878
26879
26880cat >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.  */
26907S: 'a' A 'a'
26908 | 'b' A 'b'
26909 | 'c' c
26910 ;
26911A: 'a' 'a' B
26912 ;
26913B: 'a'
26914 | %prec 'a'
26915 ;
26916c: 'a' 'a' 'b'
26917 | A
26918 ;
26919
26920
26921%%
26922#include <stdio.h>
26923/* A C error reporting function.  */
26924static
26925void yyerror ( const char *msg)
26926{
26927  fprintf (stderr, "%s\n", msg);
26928}
26929static int
26930yylex (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
26939int
26940main (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
26954if 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"
26962at_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>&-
26966at_status=$? at_failed=false
26967$at_check_filter
26968echo stderr:; cat "$at_stderr"
26969echo stdout:; cat "$at_stdout"
26970at_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"
26976at_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>&-
26979at_status=$? at_failed=false
26980$at_check_filter
26981echo stderr:; cat "$at_stderr"
26982echo stdout:; cat "$at_stdout"
26983at_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"
26992at_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>&-
26997at_status=$? at_failed=false
26998$at_check_filter
26999at_fn_diff_devnull "$at_stderr" || at_failed=:
27000$at_diff expout "$at_stdout" || at_failed=:
27001at_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"
27010at_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>&-
27015at_status=$? at_failed=false
27016$at_check_filter
27017at_fn_diff_devnull "$at_stderr" || at_failed=:
27018$at_diff expout "$at_stdout" || at_failed=:
27019at_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
27025fi
27026{ set +x
27027$as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
27028at_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>&-
27031at_status=$? at_failed=false
27032$at_check_filter
27033at_fn_diff_devnull "$at_stderr" || at_failed=:
27034at_fn_diff_devnull "$at_stdout" || at_failed=:
27035at_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"
27043at_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>&-
27046at_status=$? at_failed=false
27047$at_check_filter
27048at_fn_diff_devnull "$at_stderr" || at_failed=:
27049echo >>"$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
27063State 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
27073State 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
27083State 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
27096State 4
27097
27098    0 \$accept: S . \$end
27099
27100    \$end  shift, and go to state 11
27101
27102
27103State 5
27104
27105    4 A: 'a' . 'a' B
27106
27107    'a'  shift, and go to state 12
27108
27109
27110State 6
27111
27112    1 S: 'a' A . 'a'
27113
27114    'a'  shift, and go to state 13
27115
27116
27117State 7
27118
27119    2 S: 'b' A . 'b'
27120
27121    'b'  shift, and go to state 14
27122
27123
27124State 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
27132State 9
27133
27134    8 c: A .
27135
27136    \$default  reduce using rule 8 (c)
27137
27138
27139State 10
27140
27141    3 S: 'c' c .
27142
27143    \$default  reduce using rule 3 (S)
27144
27145
27146State 11
27147
27148    0 \$accept: S \$end .
27149
27150    \$default  accept
27151
27152
27153State 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
27166State 13
27167
27168    1 S: 'a' A 'a' .
27169
27170    \$default  reduce using rule 1 (S)
27171
27172
27173State 14
27174
27175    2 S: 'b' A 'b' .
27176
27177    \$default  reduce using rule 2 (S)
27178
27179
27180State 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
27195State 16
27196
27197    5 B: 'a' .
27198
27199    \$default  reduce using rule 5 (B)
27200
27201
27202State 17
27203
27204    4 A: 'a' 'a' B .
27205
27206    \$default  reduce using rule 4 (A)
27207
27208
27209State 18
27210
27211    7 c: 'a' 'a' 'b' .
27212
27213    \$default  reduce using rule 7 (c)
27214" | \
27215  $at_diff - "$at_stdout" || at_failed=:
27216at_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"
27232at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
27233( $at_check_trace; $BISON_C_WORKS
27234) >>"$at_stdout" 2>>"$at_stderr" 5>&-
27235at_status=$? at_failed=false
27236$at_check_filter
27237echo stderr:; cat "$at_stderr"
27238echo stdout:; cat "$at_stdout"
27239at_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"
27245at_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>&-
27248at_status=$? at_failed=false
27249$at_check_filter
27250echo stderr:; cat "$at_stderr"
27251echo stdout:; cat "$at_stdout"
27252at_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"
27259at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
27260( $at_check_trace;  $PREPARSER ./input
27261) >>"$at_stdout" 2>>"$at_stderr" 5>&-
27262at_status=$? at_failed=false
27263$at_check_filter
27264echo stderr:; tee stderr <"$at_stderr"
27265at_fn_diff_devnull "$at_stdout" || at_failed=:
27266at_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"
27272at_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>&-
27275at_status=$? at_failed=false
27276$at_check_filter
27277echo >>"$at_stderr"; $as_echo "syntax error
27278" | \
27279  $at_diff - "$at_stderr" || at_failed=:
27280at_fn_diff_devnull "$at_stdout" || at_failed=:
27281at_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
27291read at_status <"$at_status_file"
27292#AT_STOP_116
27293#AT_START_117
27294at_fn_group_banner 117 'reduce.at:951' \
27295  "%define lr.type lalr: Complex Lane Split" "       " 6
27296at_xfail=no
27297(
27298  $as_echo "117. $at_setup_line: testing $at_desc ..."
27299  $at_traceon
27300
27301
27302cat >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.  */
27330S: 'a' A 'a'
27331 | 'b' A 'b'
27332 | 'c' c
27333 ;
27334A: 'a' 'a' B
27335 ;
27336B: 'a'
27337 | %prec 'a'
27338 ;
27339c: 'a' 'a' 'b'
27340 | A
27341 ;
27342
27343
27344%%
27345#include <stdio.h>
27346/* A C error reporting function.  */
27347static
27348void yyerror ( const char *msg)
27349{
27350  fprintf (stderr, "%s\n", msg);
27351}
27352static int
27353yylex (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
27362int
27363main (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
27377if 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"
27385at_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>&-
27389at_status=$? at_failed=false
27390$at_check_filter
27391echo stderr:; cat "$at_stderr"
27392echo stdout:; cat "$at_stdout"
27393at_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"
27399at_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>&-
27402at_status=$? at_failed=false
27403$at_check_filter
27404echo stderr:; cat "$at_stderr"
27405echo stdout:; cat "$at_stdout"
27406at_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"
27415at_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>&-
27420at_status=$? at_failed=false
27421$at_check_filter
27422at_fn_diff_devnull "$at_stderr" || at_failed=:
27423$at_diff expout "$at_stdout" || at_failed=:
27424at_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"
27433at_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>&-
27438at_status=$? at_failed=false
27439$at_check_filter
27440at_fn_diff_devnull "$at_stderr" || at_failed=:
27441$at_diff expout "$at_stdout" || at_failed=:
27442at_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
27448fi
27449{ set +x
27450$as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
27451at_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>&-
27454at_status=$? at_failed=false
27455$at_check_filter
27456at_fn_diff_devnull "$at_stderr" || at_failed=:
27457at_fn_diff_devnull "$at_stdout" || at_failed=:
27458at_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"
27466at_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>&-
27469at_status=$? at_failed=false
27470$at_check_filter
27471at_fn_diff_devnull "$at_stderr" || at_failed=:
27472echo >>"$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
27486State 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
27496State 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
27506State 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
27519State 4
27520
27521    0 \$accept: S . \$end
27522
27523    \$end  shift, and go to state 11
27524
27525
27526State 5
27527
27528    4 A: 'a' . 'a' B
27529
27530    'a'  shift, and go to state 12
27531
27532
27533State 6
27534
27535    1 S: 'a' A . 'a'
27536
27537    'a'  shift, and go to state 13
27538
27539
27540State 7
27541
27542    2 S: 'b' A . 'b'
27543
27544    'b'  shift, and go to state 14
27545
27546
27547State 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
27555State 9
27556
27557    8 c: A .
27558
27559    \$default  reduce using rule 8 (c)
27560
27561
27562State 10
27563
27564    3 S: 'c' c .
27565
27566    \$default  reduce using rule 3 (S)
27567
27568
27569State 11
27570
27571    0 \$accept: S \$end .
27572
27573    \$default  accept
27574
27575
27576State 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
27589State 13
27590
27591    1 S: 'a' A 'a' .
27592
27593    \$default  reduce using rule 1 (S)
27594
27595
27596State 14
27597
27598    2 S: 'b' A 'b' .
27599
27600    \$default  reduce using rule 2 (S)
27601
27602
27603State 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
27618State 16
27619
27620    5 B: 'a' .
27621
27622    \$default  reduce using rule 5 (B)
27623
27624
27625State 17
27626
27627    4 A: 'a' 'a' B .
27628
27629    \$default  reduce using rule 4 (A)
27630
27631
27632State 18
27633
27634    7 c: 'a' 'a' 'b' .
27635
27636    \$default  reduce using rule 7 (c)
27637" | \
27638  $at_diff - "$at_stdout" || at_failed=:
27639at_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"
27655at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
27656( $at_check_trace; $BISON_C_WORKS
27657) >>"$at_stdout" 2>>"$at_stderr" 5>&-
27658at_status=$? at_failed=false
27659$at_check_filter
27660echo stderr:; cat "$at_stderr"
27661echo stdout:; cat "$at_stdout"
27662at_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"
27668at_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>&-
27671at_status=$? at_failed=false
27672$at_check_filter
27673echo stderr:; cat "$at_stderr"
27674echo stdout:; cat "$at_stdout"
27675at_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"
27682at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
27683( $at_check_trace;  $PREPARSER ./input
27684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
27685at_status=$? at_failed=false
27686$at_check_filter
27687echo stderr:; tee stderr <"$at_stderr"
27688at_fn_diff_devnull "$at_stdout" || at_failed=:
27689at_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"
27695at_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>&-
27698at_status=$? at_failed=false
27699$at_check_filter
27700echo >>"$at_stderr"; $as_echo "syntax error
27701" | \
27702  $at_diff - "$at_stderr" || at_failed=:
27703at_fn_diff_devnull "$at_stdout" || at_failed=:
27704at_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
27714read at_status <"$at_status_file"
27715#AT_STOP_117
27716#AT_START_118
27717at_fn_group_banner 118 'reduce.at:951' \
27718  "%define lr.type ielr: Complex Lane Split" "       " 6
27719at_xfail=no
27720(
27721  $as_echo "118. $at_setup_line: testing $at_desc ..."
27722  $at_traceon
27723
27724
27725cat >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.  */
27753S: 'a' A 'a'
27754 | 'b' A 'b'
27755 | 'c' c
27756 ;
27757A: 'a' 'a' B
27758 ;
27759B: 'a'
27760 | %prec 'a'
27761 ;
27762c: 'a' 'a' 'b'
27763 | A
27764 ;
27765
27766
27767%%
27768#include <stdio.h>
27769/* A C error reporting function.  */
27770static
27771void yyerror ( const char *msg)
27772{
27773  fprintf (stderr, "%s\n", msg);
27774}
27775static int
27776yylex (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
27785int
27786main (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
27800if 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"
27808at_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>&-
27812at_status=$? at_failed=false
27813$at_check_filter
27814echo stderr:; cat "$at_stderr"
27815echo stdout:; cat "$at_stdout"
27816at_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"
27822at_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>&-
27825at_status=$? at_failed=false
27826$at_check_filter
27827echo stderr:; cat "$at_stderr"
27828echo stdout:; cat "$at_stdout"
27829at_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"
27838at_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>&-
27843at_status=$? at_failed=false
27844$at_check_filter
27845at_fn_diff_devnull "$at_stderr" || at_failed=:
27846$at_diff expout "$at_stdout" || at_failed=:
27847at_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"
27856at_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>&-
27861at_status=$? at_failed=false
27862$at_check_filter
27863at_fn_diff_devnull "$at_stderr" || at_failed=:
27864$at_diff expout "$at_stdout" || at_failed=:
27865at_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
27871fi
27872{ set +x
27873$as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
27874at_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>&-
27877at_status=$? at_failed=false
27878$at_check_filter
27879at_fn_diff_devnull "$at_stderr" || at_failed=:
27880at_fn_diff_devnull "$at_stdout" || at_failed=:
27881at_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"
27889at_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>&-
27892at_status=$? at_failed=false
27893$at_check_filter
27894at_fn_diff_devnull "$at_stderr" || at_failed=:
27895echo >>"$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
27909State 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
27919State 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
27929State 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
27942State 4
27943
27944    0 \$accept: S . \$end
27945
27946    \$end  shift, and go to state 11
27947
27948
27949State 5
27950
27951    4 A: 'a' . 'a' B
27952
27953    'a'  shift, and go to state 12
27954
27955
27956State 6
27957
27958    1 S: 'a' A . 'a'
27959
27960    'a'  shift, and go to state 13
27961
27962
27963State 7
27964
27965    2 S: 'b' A . 'b'
27966
27967    'b'  shift, and go to state 14
27968
27969
27970State 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
27978State 9
27979
27980    8 c: A .
27981
27982    \$default  reduce using rule 8 (c)
27983
27984
27985State 10
27986
27987    3 S: 'c' c .
27988
27989    \$default  reduce using rule 3 (S)
27990
27991
27992State 11
27993
27994    0 \$accept: S \$end .
27995
27996    \$default  accept
27997
27998
27999State 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
28012State 13
28013
28014    1 S: 'a' A 'a' .
28015
28016    \$default  reduce using rule 1 (S)
28017
28018
28019State 14
28020
28021    2 S: 'b' A 'b' .
28022
28023    \$default  reduce using rule 2 (S)
28024
28025
28026State 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
28041State 16
28042
28043    5 B: 'a' .
28044
28045    \$default  reduce using rule 5 (B)
28046
28047
28048State 17
28049
28050    4 A: 'a' 'a' B .
28051
28052    \$default  reduce using rule 4 (A)
28053
28054
28055State 18
28056
28057    7 c: 'a' 'a' 'b' .
28058
28059    \$default  reduce using rule 7 (c)
28060
28061
28062State 19
28063
28064    4 A: 'a' . 'a' B
28065
28066    'a'  shift, and go to state 20
28067
28068
28069State 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=:
28082at_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"
28098at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
28099( $at_check_trace; $BISON_C_WORKS
28100) >>"$at_stdout" 2>>"$at_stderr" 5>&-
28101at_status=$? at_failed=false
28102$at_check_filter
28103echo stderr:; cat "$at_stderr"
28104echo stdout:; cat "$at_stdout"
28105at_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"
28111at_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>&-
28114at_status=$? at_failed=false
28115$at_check_filter
28116echo stderr:; cat "$at_stderr"
28117echo stdout:; cat "$at_stdout"
28118at_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"
28125at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
28126( $at_check_trace;  $PREPARSER ./input
28127) >>"$at_stdout" 2>>"$at_stderr" 5>&-
28128at_status=$? at_failed=false
28129$at_check_filter
28130echo stderr:; tee stderr <"$at_stderr"
28131at_fn_diff_devnull "$at_stdout" || at_failed=:
28132at_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"
28138at_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>&-
28141at_status=$? at_failed=false
28142$at_check_filter
28143at_fn_diff_devnull "$at_stderr" || at_failed=:
28144at_fn_diff_devnull "$at_stdout" || at_failed=:
28145at_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
28155read at_status <"$at_status_file"
28156#AT_STOP_118
28157#AT_START_119
28158at_fn_group_banner 119 'reduce.at:951' \
28159  "%define lr.type canonical-lr: Complex Lane Split" "" 6
28160at_xfail=no
28161(
28162  $as_echo "119. $at_setup_line: testing $at_desc ..."
28163  $at_traceon
28164
28165
28166cat >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.  */
28194S: 'a' A 'a'
28195 | 'b' A 'b'
28196 | 'c' c
28197 ;
28198A: 'a' 'a' B
28199 ;
28200B: 'a'
28201 | %prec 'a'
28202 ;
28203c: 'a' 'a' 'b'
28204 | A
28205 ;
28206
28207
28208%%
28209#include <stdio.h>
28210/* A C error reporting function.  */
28211static
28212void yyerror ( const char *msg)
28213{
28214  fprintf (stderr, "%s\n", msg);
28215}
28216static int
28217yylex (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
28226int
28227main (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
28241if 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"
28249at_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>&-
28253at_status=$? at_failed=false
28254$at_check_filter
28255echo stderr:; cat "$at_stderr"
28256echo stdout:; cat "$at_stdout"
28257at_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"
28263at_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>&-
28266at_status=$? at_failed=false
28267$at_check_filter
28268echo stderr:; cat "$at_stderr"
28269echo stdout:; cat "$at_stdout"
28270at_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"
28279at_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>&-
28284at_status=$? at_failed=false
28285$at_check_filter
28286at_fn_diff_devnull "$at_stderr" || at_failed=:
28287$at_diff expout "$at_stdout" || at_failed=:
28288at_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"
28297at_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>&-
28302at_status=$? at_failed=false
28303$at_check_filter
28304at_fn_diff_devnull "$at_stderr" || at_failed=:
28305$at_diff expout "$at_stdout" || at_failed=:
28306at_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
28312fi
28313{ set +x
28314$as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
28315at_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>&-
28318at_status=$? at_failed=false
28319$at_check_filter
28320at_fn_diff_devnull "$at_stderr" || at_failed=:
28321at_fn_diff_devnull "$at_stdout" || at_failed=:
28322at_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"
28330at_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>&-
28333at_status=$? at_failed=false
28334$at_check_filter
28335at_fn_diff_devnull "$at_stderr" || at_failed=:
28336echo >>"$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
28350State 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
28360State 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
28370State 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
28383State 4
28384
28385    0 \$accept: S . \$end
28386
28387    \$end  shift, and go to state 11
28388
28389
28390State 5
28391
28392    4 A: 'a' . 'a' B
28393
28394    'a'  shift, and go to state 12
28395
28396
28397State 6
28398
28399    1 S: 'a' A . 'a'
28400
28401    'a'  shift, and go to state 13
28402
28403
28404State 7
28405
28406    2 S: 'b' A . 'b'
28407
28408    'b'  shift, and go to state 14
28409
28410
28411State 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
28419State 9
28420
28421    8 c: A .  [\$end]
28422
28423    \$end  reduce using rule 8 (c)
28424
28425
28426State 10
28427
28428    3 S: 'c' c .  [\$end]
28429
28430    \$end  reduce using rule 3 (S)
28431
28432
28433State 11
28434
28435    0 \$accept: S \$end .
28436
28437    \$default  accept
28438
28439
28440State 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
28453State 13
28454
28455    1 S: 'a' A 'a' .  [\$end]
28456
28457    \$end  reduce using rule 1 (S)
28458
28459
28460State 14
28461
28462    2 S: 'b' A 'b' .  [\$end]
28463
28464    \$end  reduce using rule 2 (S)
28465
28466
28467State 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
28482State 16
28483
28484    5 B: 'a' .  ['a']
28485
28486    'a'  reduce using rule 5 (B)
28487
28488
28489State 17
28490
28491    4 A: 'a' 'a' B .  ['a']
28492
28493    'a'  reduce using rule 4 (A)
28494
28495
28496State 18
28497
28498    7 c: 'a' 'a' 'b' .  [\$end]
28499
28500    \$end  reduce using rule 7 (c)
28501
28502
28503State 19
28504
28505    4 A: 'a' . 'a' B
28506
28507    'a'  shift, and go to state 22
28508
28509
28510State 20
28511
28512    5 B: 'a' .  [\$end]
28513
28514    \$end  reduce using rule 5 (B)
28515
28516
28517State 21
28518
28519    4 A: 'a' 'a' B .  [\$end]
28520
28521    \$end  reduce using rule 4 (A)
28522
28523
28524State 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
28537State 23
28538
28539    5 B: 'a' .  ['b']
28540
28541    'b'  reduce using rule 5 (B)
28542
28543
28544State 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=:
28551at_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.
28564if test 32767 -lt `wc -l < input.c`; then
28565  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
28566  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
28567fi
28568{ set +x
28569$as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS"
28570at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
28571( $at_check_trace; $BISON_C_WORKS
28572) >>"$at_stdout" 2>>"$at_stderr" 5>&-
28573at_status=$? at_failed=false
28574$at_check_filter
28575echo stderr:; cat "$at_stderr"
28576echo stdout:; cat "$at_stdout"
28577at_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"
28583at_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>&-
28586at_status=$? at_failed=false
28587$at_check_filter
28588echo stderr:; cat "$at_stderr"
28589echo stdout:; cat "$at_stdout"
28590at_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"
28597at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
28598( $at_check_trace;  $PREPARSER ./input
28599) >>"$at_stdout" 2>>"$at_stderr" 5>&-
28600at_status=$? at_failed=false
28601$at_check_filter
28602echo stderr:; tee stderr <"$at_stderr"
28603at_fn_diff_devnull "$at_stdout" || at_failed=:
28604at_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"
28610at_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>&-
28613at_status=$? at_failed=false
28614$at_check_filter
28615at_fn_diff_devnull "$at_stderr" || at_failed=:
28616at_fn_diff_devnull "$at_stdout" || at_failed=:
28617at_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
28627read at_status <"$at_status_file"
28628#AT_STOP_119
28629#AT_START_120
28630at_fn_group_banner 120 'reduce.at:1220' \
28631  "no %define lr.type: Split During Added Lookahead Propagation" "" 6
28632at_xfail=no
28633(
28634  $as_echo "120. $at_setup_line: testing $at_desc ..."
28635  $at_traceon
28636
28637
28638cat >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.  */
28691S: '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 ;
28699A: 'd' 'e' ;
28700B: 'd' 'e' ;
28701
28702
28703%%
28704#include <stdio.h>
28705/* A C error reporting function.  */
28706static
28707void yyerror ( const char *msg)
28708{
28709  fprintf (stderr, "%s\n", msg);
28710}
28711static int
28712yylex (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
28721int
28722main (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
28736if 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"
28744at_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>&-
28748at_status=$? at_failed=false
28749$at_check_filter
28750echo stderr:; cat "$at_stderr"
28751echo stdout:; cat "$at_stdout"
28752at_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"
28758at_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>&-
28761at_status=$? at_failed=false
28762$at_check_filter
28763echo stderr:; cat "$at_stderr"
28764echo stdout:; cat "$at_stdout"
28765at_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"
28774at_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>&-
28779at_status=$? at_failed=false
28780$at_check_filter
28781at_fn_diff_devnull "$at_stderr" || at_failed=:
28782$at_diff expout "$at_stdout" || at_failed=:
28783at_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"
28792at_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>&-
28797at_status=$? at_failed=false
28798$at_check_filter
28799at_fn_diff_devnull "$at_stderr" || at_failed=:
28800$at_diff expout "$at_stdout" || at_failed=:
28801at_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
28807fi
28808{ set +x
28809$as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
28810at_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>&-
28813at_status=$? at_failed=false
28814$at_check_filter
28815echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
28816" | \
28817  $at_diff - "$at_stderr" || at_failed=:
28818at_fn_diff_devnull "$at_stdout" || at_failed=:
28819at_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"
28827at_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>&-
28830at_status=$? at_failed=false
28831$at_check_filter
28832at_fn_diff_devnull "$at_stderr" || at_failed=:
28833echo >>"$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
28851State 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
28864State 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
28878State 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
28886State 4
28887
28888    0 \$accept: S . \$end
28889
28890    \$end  shift, and go to state 12
28891
28892
28893State 5
28894
28895    8 A: 'd' . 'e'
28896    9 B: 'd' . 'e'
28897
28898    'e'  shift, and go to state 13
28899
28900
28901State 6
28902
28903    1 S: 'a' A . 'f'
28904
28905    'f'  shift, and go to state 14
28906
28907
28908State 7
28909
28910    2 S: 'a' B .
28911
28912    \$default  reduce using rule 2 (S)
28913
28914
28915State 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
28926State 9
28927
28928    3 S: 'b' A . 'f'
28929
28930    'f'  shift, and go to state 15
28931
28932
28933State 10
28934
28935    4 S: 'b' B . 'g'
28936
28937    'g'  shift, and go to state 16
28938
28939
28940State 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
28953State 12
28954
28955    0 \$accept: S \$end .
28956
28957    \$default  accept
28958
28959
28960State 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
28971State 14
28972
28973    1 S: 'a' A 'f' .
28974
28975    \$default  reduce using rule 1 (S)
28976
28977
28978State 15
28979
28980    3 S: 'b' A 'f' .
28981
28982    \$default  reduce using rule 3 (S)
28983
28984
28985State 16
28986
28987    4 S: 'b' B 'g' .
28988
28989    \$default  reduce using rule 4 (S)
28990
28991
28992State 17
28993
28994    6 S: 'c' 'c' A . 'g'
28995
28996    'g'  shift, and go to state 19
28997
28998
28999State 18
29000
29001    7 S: 'c' 'c' B .
29002
29003    \$default  reduce using rule 7 (S)
29004
29005
29006State 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=:
29013at_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"
29029at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
29030( $at_check_trace; $BISON_C_WORKS
29031) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29032at_status=$? at_failed=false
29033$at_check_filter
29034echo stderr:; cat "$at_stderr"
29035echo stdout:; cat "$at_stdout"
29036at_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"
29042at_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>&-
29045at_status=$? at_failed=false
29046$at_check_filter
29047echo stderr:; cat "$at_stderr"
29048echo stdout:; cat "$at_stdout"
29049at_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"
29056at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
29057( $at_check_trace;  $PREPARSER ./input
29058) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29059at_status=$? at_failed=false
29060$at_check_filter
29061echo stderr:; tee stderr <"$at_stderr"
29062at_fn_diff_devnull "$at_stdout" || at_failed=:
29063at_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"
29069at_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>&-
29072at_status=$? at_failed=false
29073$at_check_filter
29074echo >>"$at_stderr"; $as_echo "syntax error
29075" | \
29076  $at_diff - "$at_stderr" || at_failed=:
29077at_fn_diff_devnull "$at_stdout" || at_failed=:
29078at_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
29088read at_status <"$at_status_file"
29089#AT_STOP_120
29090#AT_START_121
29091at_fn_group_banner 121 'reduce.at:1220' \
29092  "%define lr.type lalr: Split During Added Lookahead Propagation" "" 6
29093at_xfail=no
29094(
29095  $as_echo "121. $at_setup_line: testing $at_desc ..."
29096  $at_traceon
29097
29098
29099cat >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.  */
29153S: '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 ;
29161A: 'd' 'e' ;
29162B: 'd' 'e' ;
29163
29164
29165%%
29166#include <stdio.h>
29167/* A C error reporting function.  */
29168static
29169void yyerror ( const char *msg)
29170{
29171  fprintf (stderr, "%s\n", msg);
29172}
29173static int
29174yylex (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
29183int
29184main (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
29198if 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"
29206at_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>&-
29210at_status=$? at_failed=false
29211$at_check_filter
29212echo stderr:; cat "$at_stderr"
29213echo stdout:; cat "$at_stdout"
29214at_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"
29220at_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>&-
29223at_status=$? at_failed=false
29224$at_check_filter
29225echo stderr:; cat "$at_stderr"
29226echo stdout:; cat "$at_stdout"
29227at_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"
29236at_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>&-
29241at_status=$? at_failed=false
29242$at_check_filter
29243at_fn_diff_devnull "$at_stderr" || at_failed=:
29244$at_diff expout "$at_stdout" || at_failed=:
29245at_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"
29254at_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>&-
29259at_status=$? at_failed=false
29260$at_check_filter
29261at_fn_diff_devnull "$at_stderr" || at_failed=:
29262$at_diff expout "$at_stdout" || at_failed=:
29263at_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
29269fi
29270{ set +x
29271$as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
29272at_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>&-
29275at_status=$? at_failed=false
29276$at_check_filter
29277echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
29278" | \
29279  $at_diff - "$at_stderr" || at_failed=:
29280at_fn_diff_devnull "$at_stdout" || at_failed=:
29281at_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"
29289at_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>&-
29292at_status=$? at_failed=false
29293$at_check_filter
29294at_fn_diff_devnull "$at_stderr" || at_failed=:
29295echo >>"$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
29313State 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
29326State 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
29340State 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
29348State 4
29349
29350    0 \$accept: S . \$end
29351
29352    \$end  shift, and go to state 12
29353
29354
29355State 5
29356
29357    8 A: 'd' . 'e'
29358    9 B: 'd' . 'e'
29359
29360    'e'  shift, and go to state 13
29361
29362
29363State 6
29364
29365    1 S: 'a' A . 'f'
29366
29367    'f'  shift, and go to state 14
29368
29369
29370State 7
29371
29372    2 S: 'a' B .
29373
29374    \$default  reduce using rule 2 (S)
29375
29376
29377State 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
29388State 9
29389
29390    3 S: 'b' A . 'f'
29391
29392    'f'  shift, and go to state 15
29393
29394
29395State 10
29396
29397    4 S: 'b' B . 'g'
29398
29399    'g'  shift, and go to state 16
29400
29401
29402State 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
29415State 12
29416
29417    0 \$accept: S \$end .
29418
29419    \$default  accept
29420
29421
29422State 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
29433State 14
29434
29435    1 S: 'a' A 'f' .
29436
29437    \$default  reduce using rule 1 (S)
29438
29439
29440State 15
29441
29442    3 S: 'b' A 'f' .
29443
29444    \$default  reduce using rule 3 (S)
29445
29446
29447State 16
29448
29449    4 S: 'b' B 'g' .
29450
29451    \$default  reduce using rule 4 (S)
29452
29453
29454State 17
29455
29456    6 S: 'c' 'c' A . 'g'
29457
29458    'g'  shift, and go to state 19
29459
29460
29461State 18
29462
29463    7 S: 'c' 'c' B .
29464
29465    \$default  reduce using rule 7 (S)
29466
29467
29468State 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=:
29475at_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"
29491at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
29492( $at_check_trace; $BISON_C_WORKS
29493) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29494at_status=$? at_failed=false
29495$at_check_filter
29496echo stderr:; cat "$at_stderr"
29497echo stdout:; cat "$at_stdout"
29498at_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"
29504at_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>&-
29507at_status=$? at_failed=false
29508$at_check_filter
29509echo stderr:; cat "$at_stderr"
29510echo stdout:; cat "$at_stdout"
29511at_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"
29518at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
29519( $at_check_trace;  $PREPARSER ./input
29520) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29521at_status=$? at_failed=false
29522$at_check_filter
29523echo stderr:; tee stderr <"$at_stderr"
29524at_fn_diff_devnull "$at_stdout" || at_failed=:
29525at_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"
29531at_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>&-
29534at_status=$? at_failed=false
29535$at_check_filter
29536echo >>"$at_stderr"; $as_echo "syntax error
29537" | \
29538  $at_diff - "$at_stderr" || at_failed=:
29539at_fn_diff_devnull "$at_stdout" || at_failed=:
29540at_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
29550read at_status <"$at_status_file"
29551#AT_STOP_121
29552#AT_START_122
29553at_fn_group_banner 122 'reduce.at:1220' \
29554  "%define lr.type ielr: Split During Added Lookahead Propagation" "" 6
29555at_xfail=no
29556(
29557  $as_echo "122. $at_setup_line: testing $at_desc ..."
29558  $at_traceon
29559
29560
29561cat >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.  */
29615S: '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 ;
29623A: 'd' 'e' ;
29624B: 'd' 'e' ;
29625
29626
29627%%
29628#include <stdio.h>
29629/* A C error reporting function.  */
29630static
29631void yyerror ( const char *msg)
29632{
29633  fprintf (stderr, "%s\n", msg);
29634}
29635static int
29636yylex (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
29645int
29646main (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
29660if 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"
29668at_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>&-
29672at_status=$? at_failed=false
29673$at_check_filter
29674echo stderr:; cat "$at_stderr"
29675echo stdout:; cat "$at_stdout"
29676at_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"
29682at_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>&-
29685at_status=$? at_failed=false
29686$at_check_filter
29687echo stderr:; cat "$at_stderr"
29688echo stdout:; cat "$at_stdout"
29689at_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"
29698at_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>&-
29703at_status=$? at_failed=false
29704$at_check_filter
29705at_fn_diff_devnull "$at_stderr" || at_failed=:
29706$at_diff expout "$at_stdout" || at_failed=:
29707at_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"
29716at_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>&-
29721at_status=$? at_failed=false
29722$at_check_filter
29723at_fn_diff_devnull "$at_stderr" || at_failed=:
29724$at_diff expout "$at_stdout" || at_failed=:
29725at_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
29731fi
29732{ set +x
29733$as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
29734at_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>&-
29737at_status=$? at_failed=false
29738$at_check_filter
29739at_fn_diff_devnull "$at_stderr" || at_failed=:
29740at_fn_diff_devnull "$at_stdout" || at_failed=:
29741at_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"
29749at_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>&-
29752at_status=$? at_failed=false
29753$at_check_filter
29754at_fn_diff_devnull "$at_stderr" || at_failed=:
29755echo >>"$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
29773State 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
29786State 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
29800State 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
29808State 4
29809
29810    0 \$accept: S . \$end
29811
29812    \$end  shift, and go to state 12
29813
29814
29815State 5
29816
29817    8 A: 'd' . 'e'
29818    9 B: 'd' . 'e'
29819
29820    'e'  shift, and go to state 20
29821
29822
29823State 6
29824
29825    1 S: 'a' A . 'f'
29826
29827    'f'  shift, and go to state 14
29828
29829
29830State 7
29831
29832    2 S: 'a' B .
29833
29834    \$default  reduce using rule 2 (S)
29835
29836
29837State 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
29848State 9
29849
29850    3 S: 'b' A . 'f'
29851
29852    'f'  shift, and go to state 15
29853
29854
29855State 10
29856
29857    4 S: 'b' B . 'g'
29858
29859    'g'  shift, and go to state 16
29860
29861
29862State 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
29875State 12
29876
29877    0 \$accept: S \$end .
29878
29879    \$default  accept
29880
29881
29882State 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
29891State 14
29892
29893    1 S: 'a' A 'f' .
29894
29895    \$default  reduce using rule 1 (S)
29896
29897
29898State 15
29899
29900    3 S: 'b' A 'f' .
29901
29902    \$default  reduce using rule 3 (S)
29903
29904
29905State 16
29906
29907    4 S: 'b' B 'g' .
29908
29909    \$default  reduce using rule 4 (S)
29910
29911
29912State 17
29913
29914    6 S: 'c' 'c' A . 'g'
29915
29916    'g'  shift, and go to state 19
29917
29918
29919State 18
29920
29921    7 S: 'c' 'c' B .
29922
29923    \$default  reduce using rule 7 (S)
29924
29925
29926State 19
29927
29928    6 S: 'c' 'c' A 'g' .
29929
29930    \$default  reduce using rule 6 (S)
29931
29932
29933State 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=:
29942at_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"
29958at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
29959( $at_check_trace; $BISON_C_WORKS
29960) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29961at_status=$? at_failed=false
29962$at_check_filter
29963echo stderr:; cat "$at_stderr"
29964echo stdout:; cat "$at_stdout"
29965at_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"
29971at_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>&-
29974at_status=$? at_failed=false
29975$at_check_filter
29976echo stderr:; cat "$at_stderr"
29977echo stdout:; cat "$at_stdout"
29978at_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"
29985at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
29986( $at_check_trace;  $PREPARSER ./input
29987) >>"$at_stdout" 2>>"$at_stderr" 5>&-
29988at_status=$? at_failed=false
29989$at_check_filter
29990echo stderr:; tee stderr <"$at_stderr"
29991at_fn_diff_devnull "$at_stdout" || at_failed=:
29992at_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"
29998at_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>&-
30001at_status=$? at_failed=false
30002$at_check_filter
30003at_fn_diff_devnull "$at_stderr" || at_failed=:
30004at_fn_diff_devnull "$at_stdout" || at_failed=:
30005at_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
30015read at_status <"$at_status_file"
30016#AT_STOP_122
30017#AT_START_123
30018at_fn_group_banner 123 'reduce.at:1220' \
30019  "%define lr.type canonical-lr: Split During Added Lookahead Propagation" "" 6
30020at_xfail=no
30021(
30022  $as_echo "123. $at_setup_line: testing $at_desc ..."
30023  $at_traceon
30024
30025
30026cat >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.  */
30080S: '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 ;
30088A: 'd' 'e' ;
30089B: 'd' 'e' ;
30090
30091
30092%%
30093#include <stdio.h>
30094/* A C error reporting function.  */
30095static
30096void yyerror ( const char *msg)
30097{
30098  fprintf (stderr, "%s\n", msg);
30099}
30100static int
30101yylex (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
30110int
30111main (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
30125if 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"
30133at_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>&-
30137at_status=$? at_failed=false
30138$at_check_filter
30139echo stderr:; cat "$at_stderr"
30140echo stdout:; cat "$at_stdout"
30141at_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"
30147at_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>&-
30150at_status=$? at_failed=false
30151$at_check_filter
30152echo stderr:; cat "$at_stderr"
30153echo stdout:; cat "$at_stdout"
30154at_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"
30163at_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>&-
30168at_status=$? at_failed=false
30169$at_check_filter
30170at_fn_diff_devnull "$at_stderr" || at_failed=:
30171$at_diff expout "$at_stdout" || at_failed=:
30172at_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"
30181at_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>&-
30186at_status=$? at_failed=false
30187$at_check_filter
30188at_fn_diff_devnull "$at_stderr" || at_failed=:
30189$at_diff expout "$at_stdout" || at_failed=:
30190at_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
30196fi
30197{ set +x
30198$as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
30199at_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>&-
30202at_status=$? at_failed=false
30203$at_check_filter
30204at_fn_diff_devnull "$at_stderr" || at_failed=:
30205at_fn_diff_devnull "$at_stdout" || at_failed=:
30206at_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"
30214at_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>&-
30217at_status=$? at_failed=false
30218$at_check_filter
30219at_fn_diff_devnull "$at_stderr" || at_failed=:
30220echo >>"$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
30238State 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
30251State 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
30265State 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
30273State 4
30274
30275    0 \$accept: S . \$end
30276
30277    \$end  shift, and go to state 12
30278
30279
30280State 5
30281
30282    8 A: 'd' . 'e'
30283    9 B: 'd' . 'e'
30284
30285    'e'  shift, and go to state 13
30286
30287
30288State 6
30289
30290    1 S: 'a' A . 'f'
30291
30292    'f'  shift, and go to state 14
30293
30294
30295State 7
30296
30297    2 S: 'a' B .  [\$end]
30298
30299    \$end  reduce using rule 2 (S)
30300
30301
30302State 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
30313State 9
30314
30315    3 S: 'b' A . 'f'
30316
30317    'f'  shift, and go to state 15
30318
30319
30320State 10
30321
30322    4 S: 'b' B . 'g'
30323
30324    'g'  shift, and go to state 16
30325
30326
30327State 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
30340State 12
30341
30342    0 \$accept: S \$end .
30343
30344    \$default  accept
30345
30346
30347State 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
30356State 14
30357
30358    1 S: 'a' A 'f' .  [\$end]
30359
30360    \$end  reduce using rule 1 (S)
30361
30362
30363State 15
30364
30365    3 S: 'b' A 'f' .  [\$end]
30366
30367    \$end  reduce using rule 3 (S)
30368
30369
30370State 16
30371
30372    4 S: 'b' B 'g' .  [\$end]
30373
30374    \$end  reduce using rule 4 (S)
30375
30376
30377State 17
30378
30379    6 S: 'c' 'c' A . 'g'
30380
30381    'g'  shift, and go to state 19
30382
30383
30384State 18
30385
30386    7 S: 'c' 'c' B .  [\$end]
30387
30388    \$end  reduce using rule 7 (S)
30389
30390
30391State 19
30392
30393    6 S: 'c' 'c' A 'g' .  [\$end]
30394
30395    \$end  reduce using rule 6 (S)
30396
30397
30398State 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
30407State 21
30408
30409    8 A: 'd' . 'e'
30410    9 B: 'd' . 'e'
30411
30412    'e'  shift, and go to state 22
30413
30414
30415State 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=:
30424at_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.
30437if test 32767 -lt `wc -l < input.c`; then
30438  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
30439  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
30440fi
30441{ set +x
30442$as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS"
30443at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
30444( $at_check_trace; $BISON_C_WORKS
30445) >>"$at_stdout" 2>>"$at_stderr" 5>&-
30446at_status=$? at_failed=false
30447$at_check_filter
30448echo stderr:; cat "$at_stderr"
30449echo stdout:; cat "$at_stdout"
30450at_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"
30456at_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>&-
30459at_status=$? at_failed=false
30460$at_check_filter
30461echo stderr:; cat "$at_stderr"
30462echo stdout:; cat "$at_stdout"
30463at_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"
30470at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
30471( $at_check_trace;  $PREPARSER ./input
30472) >>"$at_stdout" 2>>"$at_stderr" 5>&-
30473at_status=$? at_failed=false
30474$at_check_filter
30475echo stderr:; tee stderr <"$at_stderr"
30476at_fn_diff_devnull "$at_stdout" || at_failed=:
30477at_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"
30483at_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>&-
30486at_status=$? at_failed=false
30487$at_check_filter
30488at_fn_diff_devnull "$at_stderr" || at_failed=:
30489at_fn_diff_devnull "$at_stdout" || at_failed=:
30490at_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
30500read at_status <"$at_status_file"
30501#AT_STOP_123
30502#AT_START_124
30503at_fn_group_banner 124 'reduce.at:1550' \
30504  "no %define lr.default-reductions" "               " 6
30505at_xfail=no
30506(
30507  $as_echo "124. $at_setup_line: testing $at_desc ..."
30508  $at_traceon
30509
30510
30511cat >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.  */
30534start:
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.  */
30542a: '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.  */
30548b: ;
30549c: ;
30550
30551
30552%%
30553#include <stdio.h>
30554/* A C error reporting function.  */
30555static
30556void yyerror ( const char *msg)
30557{
30558  fprintf (stderr, "%s\n", msg);
30559}
30560static int
30561yylex (void)
30562{
30563  static int const input[] = {
30564    'a', 'a', 0
30565  };
30566  static int const *inputp = input;
30567  return *inputp++;
30568}
30569
30570int
30571main (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
30585if 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"
30593at_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>&-
30597at_status=$? at_failed=false
30598$at_check_filter
30599echo stderr:; cat "$at_stderr"
30600echo stdout:; cat "$at_stdout"
30601at_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"
30607at_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>&-
30610at_status=$? at_failed=false
30611$at_check_filter
30612echo stderr:; cat "$at_stderr"
30613echo stdout:; cat "$at_stdout"
30614at_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"
30623at_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>&-
30628at_status=$? at_failed=false
30629$at_check_filter
30630at_fn_diff_devnull "$at_stderr" || at_failed=:
30631$at_diff expout "$at_stdout" || at_failed=:
30632at_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"
30641at_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>&-
30646at_status=$? at_failed=false
30647$at_check_filter
30648at_fn_diff_devnull "$at_stderr" || at_failed=:
30649$at_diff expout "$at_stdout" || at_failed=:
30650at_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
30656fi
30657{ set +x
30658$as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
30659at_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>&-
30662at_status=$? at_failed=false
30663$at_check_filter
30664at_fn_diff_devnull "$at_stderr" || at_failed=:
30665at_fn_diff_devnull "$at_stdout" || at_failed=:
30666at_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"
30674at_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>&-
30677at_status=$? at_failed=false
30678$at_check_filter
30679at_fn_diff_devnull "$at_stderr" || at_failed=:
30680echo >>"$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
30694State 1
30695
30696    4 a: 'a' .
30697
30698    \$default  reduce using rule 4 (a)
30699
30700
30701State 2
30702
30703    0 \$accept: start . \$end
30704
30705    \$end  shift, and go to state 4
30706
30707
30708State 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
30723State 4
30724
30725    0 \$accept: start \$end .
30726
30727    \$default  accept
30728
30729
30730State 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
30740State 6
30741
30742    3 start: a c . 'b'
30743
30744    'b'  shift, and go to state 8
30745
30746
30747State 7
30748
30749    2 start: a b 'a' .
30750
30751    \$default  reduce using rule 2 (start)
30752
30753
30754State 8
30755
30756    3 start: a c 'b' .
30757
30758    \$default  reduce using rule 3 (start)
30759" | \
30760  $at_diff - "$at_stdout" || at_failed=:
30761at_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"
30777at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
30778( $at_check_trace; $BISON_C_WORKS
30779) >>"$at_stdout" 2>>"$at_stderr" 5>&-
30780at_status=$? at_failed=false
30781$at_check_filter
30782echo stderr:; cat "$at_stderr"
30783echo stdout:; cat "$at_stdout"
30784at_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"
30790at_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>&-
30793at_status=$? at_failed=false
30794$at_check_filter
30795echo stderr:; cat "$at_stderr"
30796echo stdout:; cat "$at_stdout"
30797at_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"
30804at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
30805( $at_check_trace;  $PREPARSER ./input
30806) >>"$at_stdout" 2>>"$at_stderr" 5>&-
30807at_status=$? at_failed=false
30808$at_check_filter
30809echo stderr:; tee stderr <"$at_stderr"
30810at_fn_diff_devnull "$at_stdout" || at_failed=:
30811at_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"
30817at_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>&-
30820at_status=$? at_failed=false
30821$at_check_filter
30822at_fn_diff_devnull "$at_stderr" || at_failed=:
30823at_fn_diff_devnull "$at_stdout" || at_failed=:
30824at_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
30834read at_status <"$at_status_file"
30835#AT_STOP_124
30836#AT_START_125
30837at_fn_group_banner 125 'reduce.at:1550' \
30838  "%define lr.default-reductions most" "             " 6
30839at_xfail=no
30840(
30841  $as_echo "125. $at_setup_line: testing $at_desc ..."
30842  $at_traceon
30843
30844
30845cat >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.  */
30868start:
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.  */
30876a: '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.  */
30882b: ;
30883c: ;
30884
30885
30886%%
30887#include <stdio.h>
30888/* A C error reporting function.  */
30889static
30890void yyerror ( const char *msg)
30891{
30892  fprintf (stderr, "%s\n", msg);
30893}
30894static int
30895yylex (void)
30896{
30897  static int const input[] = {
30898    'a', 'a', 0
30899  };
30900  static int const *inputp = input;
30901  return *inputp++;
30902}
30903
30904int
30905main (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
30919if 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"
30927at_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>&-
30931at_status=$? at_failed=false
30932$at_check_filter
30933echo stderr:; cat "$at_stderr"
30934echo stdout:; cat "$at_stdout"
30935at_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"
30941at_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>&-
30944at_status=$? at_failed=false
30945$at_check_filter
30946echo stderr:; cat "$at_stderr"
30947echo stdout:; cat "$at_stdout"
30948at_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"
30957at_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>&-
30962at_status=$? at_failed=false
30963$at_check_filter
30964at_fn_diff_devnull "$at_stderr" || at_failed=:
30965$at_diff expout "$at_stdout" || at_failed=:
30966at_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"
30975at_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>&-
30980at_status=$? at_failed=false
30981$at_check_filter
30982at_fn_diff_devnull "$at_stderr" || at_failed=:
30983$at_diff expout "$at_stdout" || at_failed=:
30984at_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
30990fi
30991{ set +x
30992$as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
30993at_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>&-
30996at_status=$? at_failed=false
30997$at_check_filter
30998at_fn_diff_devnull "$at_stderr" || at_failed=:
30999at_fn_diff_devnull "$at_stdout" || at_failed=:
31000at_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"
31008at_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>&-
31011at_status=$? at_failed=false
31012$at_check_filter
31013at_fn_diff_devnull "$at_stderr" || at_failed=:
31014echo >>"$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
31028State 1
31029
31030    4 a: 'a' .
31031
31032    \$default  reduce using rule 4 (a)
31033
31034
31035State 2
31036
31037    0 \$accept: start . \$end
31038
31039    \$end  shift, and go to state 4
31040
31041
31042State 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
31057State 4
31058
31059    0 \$accept: start \$end .
31060
31061    \$default  accept
31062
31063
31064State 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
31074State 6
31075
31076    3 start: a c . 'b'
31077
31078    'b'  shift, and go to state 8
31079
31080
31081State 7
31082
31083    2 start: a b 'a' .
31084
31085    \$default  reduce using rule 2 (start)
31086
31087
31088State 8
31089
31090    3 start: a c 'b' .
31091
31092    \$default  reduce using rule 3 (start)
31093" | \
31094  $at_diff - "$at_stdout" || at_failed=:
31095at_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"
31111at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
31112( $at_check_trace; $BISON_C_WORKS
31113) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31114at_status=$? at_failed=false
31115$at_check_filter
31116echo stderr:; cat "$at_stderr"
31117echo stdout:; cat "$at_stdout"
31118at_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"
31124at_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>&-
31127at_status=$? at_failed=false
31128$at_check_filter
31129echo stderr:; cat "$at_stderr"
31130echo stdout:; cat "$at_stdout"
31131at_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"
31138at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
31139( $at_check_trace;  $PREPARSER ./input
31140) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31141at_status=$? at_failed=false
31142$at_check_filter
31143echo stderr:; tee stderr <"$at_stderr"
31144at_fn_diff_devnull "$at_stdout" || at_failed=:
31145at_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"
31151at_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>&-
31154at_status=$? at_failed=false
31155$at_check_filter
31156at_fn_diff_devnull "$at_stderr" || at_failed=:
31157at_fn_diff_devnull "$at_stdout" || at_failed=:
31158at_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
31168read at_status <"$at_status_file"
31169#AT_STOP_125
31170#AT_START_126
31171at_fn_group_banner 126 'reduce.at:1550' \
31172  "%define lr.default-reductions consistent" "       " 6
31173at_xfail=no
31174(
31175  $as_echo "126. $at_setup_line: testing $at_desc ..."
31176  $at_traceon
31177
31178
31179cat >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.  */
31202start:
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.  */
31210a: '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.  */
31216b: ;
31217c: ;
31218
31219
31220%%
31221#include <stdio.h>
31222/* A C error reporting function.  */
31223static
31224void yyerror ( const char *msg)
31225{
31226  fprintf (stderr, "%s\n", msg);
31227}
31228static int
31229yylex (void)
31230{
31231  static int const input[] = {
31232    'a', 'a', 0
31233  };
31234  static int const *inputp = input;
31235  return *inputp++;
31236}
31237
31238int
31239main (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
31253if 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"
31261at_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>&-
31265at_status=$? at_failed=false
31266$at_check_filter
31267echo stderr:; cat "$at_stderr"
31268echo stdout:; cat "$at_stdout"
31269at_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"
31275at_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>&-
31278at_status=$? at_failed=false
31279$at_check_filter
31280echo stderr:; cat "$at_stderr"
31281echo stdout:; cat "$at_stdout"
31282at_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"
31291at_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>&-
31296at_status=$? at_failed=false
31297$at_check_filter
31298at_fn_diff_devnull "$at_stderr" || at_failed=:
31299$at_diff expout "$at_stdout" || at_failed=:
31300at_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"
31309at_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>&-
31314at_status=$? at_failed=false
31315$at_check_filter
31316at_fn_diff_devnull "$at_stderr" || at_failed=:
31317$at_diff expout "$at_stdout" || at_failed=:
31318at_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
31324fi
31325{ set +x
31326$as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
31327at_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>&-
31330at_status=$? at_failed=false
31331$at_check_filter
31332at_fn_diff_devnull "$at_stderr" || at_failed=:
31333at_fn_diff_devnull "$at_stdout" || at_failed=:
31334at_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"
31342at_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>&-
31345at_status=$? at_failed=false
31346$at_check_filter
31347at_fn_diff_devnull "$at_stderr" || at_failed=:
31348echo >>"$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
31362State 1
31363
31364    4 a: 'a' .
31365
31366    \$default  reduce using rule 4 (a)
31367
31368
31369State 2
31370
31371    0 \$accept: start . \$end
31372
31373    \$end  shift, and go to state 4
31374
31375
31376State 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
31392State 4
31393
31394    0 \$accept: start \$end .
31395
31396    \$default  accept
31397
31398
31399State 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
31409State 6
31410
31411    3 start: a c . 'b'
31412
31413    'b'  shift, and go to state 8
31414
31415
31416State 7
31417
31418    2 start: a b 'a' .
31419
31420    \$default  reduce using rule 2 (start)
31421
31422
31423State 8
31424
31425    3 start: a c 'b' .
31426
31427    \$default  reduce using rule 3 (start)
31428" | \
31429  $at_diff - "$at_stdout" || at_failed=:
31430at_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"
31446at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
31447( $at_check_trace; $BISON_C_WORKS
31448) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31449at_status=$? at_failed=false
31450$at_check_filter
31451echo stderr:; cat "$at_stderr"
31452echo stdout:; cat "$at_stdout"
31453at_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"
31459at_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>&-
31462at_status=$? at_failed=false
31463$at_check_filter
31464echo stderr:; cat "$at_stderr"
31465echo stdout:; cat "$at_stdout"
31466at_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"
31473at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
31474( $at_check_trace;  $PREPARSER ./input
31475) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31476at_status=$? at_failed=false
31477$at_check_filter
31478echo stderr:; tee stderr <"$at_stderr"
31479at_fn_diff_devnull "$at_stdout" || at_failed=:
31480at_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"
31486at_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>&-
31489at_status=$? at_failed=false
31490$at_check_filter
31491at_fn_diff_devnull "$at_stderr" || at_failed=:
31492at_fn_diff_devnull "$at_stdout" || at_failed=:
31493at_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
31503read at_status <"$at_status_file"
31504#AT_STOP_126
31505#AT_START_127
31506at_fn_group_banner 127 'reduce.at:1550' \
31507  "%define lr.default-reductions accepting" "        " 6
31508at_xfail=no
31509(
31510  $as_echo "127. $at_setup_line: testing $at_desc ..."
31511  $at_traceon
31512
31513
31514cat >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.  */
31537start:
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.  */
31545a: '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.  */
31551b: ;
31552c: ;
31553
31554
31555%%
31556#include <stdio.h>
31557/* A C error reporting function.  */
31558static
31559void yyerror ( const char *msg)
31560{
31561  fprintf (stderr, "%s\n", msg);
31562}
31563static int
31564yylex (void)
31565{
31566  static int const input[] = {
31567    'a', 'a', 0
31568  };
31569  static int const *inputp = input;
31570  return *inputp++;
31571}
31572
31573int
31574main (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
31588if 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"
31596at_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>&-
31600at_status=$? at_failed=false
31601$at_check_filter
31602echo stderr:; cat "$at_stderr"
31603echo stdout:; cat "$at_stdout"
31604at_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"
31610at_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>&-
31613at_status=$? at_failed=false
31614$at_check_filter
31615echo stderr:; cat "$at_stderr"
31616echo stdout:; cat "$at_stdout"
31617at_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"
31626at_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>&-
31631at_status=$? at_failed=false
31632$at_check_filter
31633at_fn_diff_devnull "$at_stderr" || at_failed=:
31634$at_diff expout "$at_stdout" || at_failed=:
31635at_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"
31644at_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>&-
31649at_status=$? at_failed=false
31650$at_check_filter
31651at_fn_diff_devnull "$at_stderr" || at_failed=:
31652$at_diff expout "$at_stdout" || at_failed=:
31653at_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
31659fi
31660{ set +x
31661$as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
31662at_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>&-
31665at_status=$? at_failed=false
31666$at_check_filter
31667at_fn_diff_devnull "$at_stderr" || at_failed=:
31668at_fn_diff_devnull "$at_stdout" || at_failed=:
31669at_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"
31677at_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>&-
31680at_status=$? at_failed=false
31681$at_check_filter
31682at_fn_diff_devnull "$at_stderr" || at_failed=:
31683echo >>"$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
31697State 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
31706State 2
31707
31708    0 \$accept: start . \$end
31709
31710    \$end  shift, and go to state 4
31711
31712
31713State 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
31729State 4
31730
31731    0 \$accept: start \$end .
31732
31733    \$default  accept
31734
31735
31736State 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
31746State 6
31747
31748    3 start: a c . 'b'
31749
31750    'b'  shift, and go to state 8
31751
31752
31753State 7
31754
31755    2 start: a b 'a' .  [\$end]
31756
31757    \$end  reduce using rule 2 (start)
31758
31759
31760State 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=:
31767at_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"
31783at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
31784( $at_check_trace; $BISON_C_WORKS
31785) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31786at_status=$? at_failed=false
31787$at_check_filter
31788echo stderr:; cat "$at_stderr"
31789echo stdout:; cat "$at_stdout"
31790at_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"
31796at_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>&-
31799at_status=$? at_failed=false
31800$at_check_filter
31801echo stderr:; cat "$at_stderr"
31802echo stdout:; cat "$at_stdout"
31803at_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"
31810at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
31811( $at_check_trace;  $PREPARSER ./input
31812) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31813at_status=$? at_failed=false
31814$at_check_filter
31815echo stderr:; tee stderr <"$at_stderr"
31816at_fn_diff_devnull "$at_stdout" || at_failed=:
31817at_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"
31823at_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>&-
31826at_status=$? at_failed=false
31827$at_check_filter
31828at_fn_diff_devnull "$at_stderr" || at_failed=:
31829at_fn_diff_devnull "$at_stdout" || at_failed=:
31830at_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
31840read at_status <"$at_status_file"
31841#AT_STOP_127
31842#AT_START_128
31843at_fn_group_banner 128 'synclines.at:150' \
31844  "Prologue syncline" "                              " 7
31845at_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
31868cat >syncline.c <<'_ATEOF'
31869#error "1"
31870int 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"
31876at_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>&-
31879at_status=$? at_failed=false
31880$at_check_filter
31881echo stderr:; tee stderr <"$at_stderr"
31882at_fn_diff_devnull "$at_stdout" || at_failed=:
31883at_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;
31957EOF
31958"
31959at_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;
31980EOF
31981
31982) >>"$at_stdout" 2>>"$at_stderr" 5>&-
31983at_status=$? at_failed=false
31984$at_check_filter
31985at_fn_diff_devnull "$at_stderr" || at_failed=:
31986echo stdout:; tee stdout <"$at_stdout"
31987at_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"
31994at_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>&-
31997at_status=$? at_failed=false
31998$at_check_filter
31999at_fn_diff_devnull "$at_stderr" || at_failed=:
32000at_fn_diff_devnull "$at_stdout" || at_failed=:
32001at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
32002$at_failed && at_fn_log_failure
32003$at_traceon; }
32004
32005
32006cat >input.y <<'_ATEOF'
32007%{
32008#error "2"
32009void yyerror ( const char *msg);
32010int yylex (void);
32011%}
32012%%
32013exp: '0';
32014%%
32015_ATEOF
32016
32017if 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"
32025at_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>&-
32029at_status=$? at_failed=false
32030$at_check_filter
32031echo stderr:; cat "$at_stderr"
32032echo stdout:; cat "$at_stdout"
32033at_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"
32039at_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>&-
32042at_status=$? at_failed=false
32043$at_check_filter
32044echo stderr:; cat "$at_stderr"
32045echo stdout:; cat "$at_stdout"
32046at_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"
32055at_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>&-
32060at_status=$? at_failed=false
32061$at_check_filter
32062at_fn_diff_devnull "$at_stderr" || at_failed=:
32063$at_diff expout "$at_stdout" || at_failed=:
32064at_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"
32073at_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>&-
32078at_status=$? at_failed=false
32079$at_check_filter
32080at_fn_diff_devnull "$at_stderr" || at_failed=:
32081$at_diff expout "$at_stdout" || at_failed=:
32082at_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
32088fi
32089{ set +x
32090$as_echo "$at_srcdir/synclines.at:150: bison -o input.c input.y"
32091at_fn_check_prepare_trace "synclines.at:150"
32092( $at_check_trace; bison -o input.c input.y
32093) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32094at_status=$? at_failed=false
32095$at_check_filter
32096at_fn_diff_devnull "$at_stderr" || at_failed=:
32097at_fn_diff_devnull "$at_stdout" || at_failed=:
32098at_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"
32105at_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>&-
32108at_status=$? at_failed=false
32109$at_check_filter
32110echo stderr:; tee stderr <"$at_stderr"
32111at_fn_diff_devnull "$at_stdout" || at_failed=:
32112at_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;
32186EOF
32187"
32188at_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;
32209EOF
32210
32211) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32212at_status=$? at_failed=false
32213$at_check_filter
32214at_fn_diff_devnull "$at_stderr" || at_failed=:
32215echo stdout:; tee stdout <"$at_stdout"
32216at_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"
32223at_fn_check_prepare_trace "synclines.at:150"
32224( $at_check_trace; cat stdout
32225) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32226at_status=$? at_failed=false
32227$at_check_filter
32228at_fn_diff_devnull "$at_stderr" || at_failed=:
32229echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
32230" | \
32231  $at_diff - "$at_stdout" || at_failed=:
32232at_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
32240read at_status <"$at_status_file"
32241#AT_STOP_128
32242#AT_START_129
32243at_fn_group_banner 129 'synclines.at:168' \
32244  "%union syncline" "                                " 7
32245at_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
32268cat >syncline.c <<'_ATEOF'
32269#error "1"
32270int 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"
32276at_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>&-
32279at_status=$? at_failed=false
32280$at_check_filter
32281echo stderr:; tee stderr <"$at_stderr"
32282at_fn_diff_devnull "$at_stdout" || at_failed=:
32283at_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;
32357EOF
32358"
32359at_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;
32380EOF
32381
32382) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32383at_status=$? at_failed=false
32384$at_check_filter
32385at_fn_diff_devnull "$at_stderr" || at_failed=:
32386echo stdout:; tee stdout <"$at_stdout"
32387at_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"
32394at_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>&-
32397at_status=$? at_failed=false
32398$at_check_filter
32399at_fn_diff_devnull "$at_stderr" || at_failed=:
32400at_fn_diff_devnull "$at_stdout" || at_failed=:
32401at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
32402$at_failed && at_fn_log_failure
32403$at_traceon; }
32404
32405
32406cat >input.y <<'_ATEOF'
32407%union {
32408#error "2"
32409  char dummy;
32410}
32411%{
32412void yyerror ( const char *msg);
32413int yylex (void);
32414%}
32415%%
32416exp: '0';
32417%%
32418_ATEOF
32419
32420if 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"
32428at_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>&-
32432at_status=$? at_failed=false
32433$at_check_filter
32434echo stderr:; cat "$at_stderr"
32435echo stdout:; cat "$at_stdout"
32436at_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"
32442at_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>&-
32445at_status=$? at_failed=false
32446$at_check_filter
32447echo stderr:; cat "$at_stderr"
32448echo stdout:; cat "$at_stdout"
32449at_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"
32458at_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>&-
32463at_status=$? at_failed=false
32464$at_check_filter
32465at_fn_diff_devnull "$at_stderr" || at_failed=:
32466$at_diff expout "$at_stdout" || at_failed=:
32467at_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"
32476at_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>&-
32481at_status=$? at_failed=false
32482$at_check_filter
32483at_fn_diff_devnull "$at_stderr" || at_failed=:
32484$at_diff expout "$at_stdout" || at_failed=:
32485at_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
32491fi
32492{ set +x
32493$as_echo "$at_srcdir/synclines.at:168: bison -o input.c input.y"
32494at_fn_check_prepare_trace "synclines.at:168"
32495( $at_check_trace; bison -o input.c input.y
32496) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32497at_status=$? at_failed=false
32498$at_check_filter
32499at_fn_diff_devnull "$at_stderr" || at_failed=:
32500at_fn_diff_devnull "$at_stdout" || at_failed=:
32501at_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"
32508at_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>&-
32511at_status=$? at_failed=false
32512$at_check_filter
32513echo stderr:; tee stderr <"$at_stderr"
32514at_fn_diff_devnull "$at_stdout" || at_failed=:
32515at_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;
32589EOF
32590"
32591at_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;
32612EOF
32613
32614) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32615at_status=$? at_failed=false
32616$at_check_filter
32617at_fn_diff_devnull "$at_stderr" || at_failed=:
32618echo stdout:; tee stdout <"$at_stdout"
32619at_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"
32626at_fn_check_prepare_trace "synclines.at:168"
32627( $at_check_trace; cat stdout
32628) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32629at_status=$? at_failed=false
32630$at_check_filter
32631at_fn_diff_devnull "$at_stderr" || at_failed=:
32632echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
32633" | \
32634  $at_diff - "$at_stdout" || at_failed=:
32635at_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
32643read at_status <"$at_status_file"
32644#AT_STOP_129
32645#AT_START_130
32646at_fn_group_banner 130 'synclines.at:189' \
32647  "Postprologue syncline" "                          " 7
32648at_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
32671cat >syncline.c <<'_ATEOF'
32672#error "1"
32673int 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"
32679at_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>&-
32682at_status=$? at_failed=false
32683$at_check_filter
32684echo stderr:; tee stderr <"$at_stderr"
32685at_fn_diff_devnull "$at_stdout" || at_failed=:
32686at_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;
32760EOF
32761"
32762at_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;
32783EOF
32784
32785) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32786at_status=$? at_failed=false
32787$at_check_filter
32788at_fn_diff_devnull "$at_stderr" || at_failed=:
32789echo stdout:; tee stdout <"$at_stdout"
32790at_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"
32797at_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>&-
32800at_status=$? at_failed=false
32801$at_check_filter
32802at_fn_diff_devnull "$at_stderr" || at_failed=:
32803at_fn_diff_devnull "$at_stdout" || at_failed=:
32804at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
32805$at_failed && at_fn_log_failure
32806$at_traceon; }
32807
32808
32809cat >input.y <<'_ATEOF'
32810%{
32811void yyerror ( const char *msg);
32812int yylex (void);
32813%}
32814%union
32815{
32816  int ival;
32817}
32818%{
32819#error "10"
32820%}
32821%%
32822exp: '0';
32823%%
32824_ATEOF
32825
32826if 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"
32834at_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>&-
32838at_status=$? at_failed=false
32839$at_check_filter
32840echo stderr:; cat "$at_stderr"
32841echo stdout:; cat "$at_stdout"
32842at_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"
32848at_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>&-
32851at_status=$? at_failed=false
32852$at_check_filter
32853echo stderr:; cat "$at_stderr"
32854echo stdout:; cat "$at_stdout"
32855at_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"
32864at_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>&-
32869at_status=$? at_failed=false
32870$at_check_filter
32871at_fn_diff_devnull "$at_stderr" || at_failed=:
32872$at_diff expout "$at_stdout" || at_failed=:
32873at_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"
32882at_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>&-
32887at_status=$? at_failed=false
32888$at_check_filter
32889at_fn_diff_devnull "$at_stderr" || at_failed=:
32890$at_diff expout "$at_stdout" || at_failed=:
32891at_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
32897fi
32898{ set +x
32899$as_echo "$at_srcdir/synclines.at:189: bison -o input.c input.y"
32900at_fn_check_prepare_trace "synclines.at:189"
32901( $at_check_trace; bison -o input.c input.y
32902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
32903at_status=$? at_failed=false
32904$at_check_filter
32905at_fn_diff_devnull "$at_stderr" || at_failed=:
32906at_fn_diff_devnull "$at_stdout" || at_failed=:
32907at_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"
32914at_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>&-
32917at_status=$? at_failed=false
32918$at_check_filter
32919echo stderr:; tee stderr <"$at_stderr"
32920at_fn_diff_devnull "$at_stdout" || at_failed=:
32921at_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;
32995EOF
32996"
32997at_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;
33018EOF
33019
33020) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33021at_status=$? at_failed=false
33022$at_check_filter
33023at_fn_diff_devnull "$at_stderr" || at_failed=:
33024echo stdout:; tee stdout <"$at_stdout"
33025at_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"
33032at_fn_check_prepare_trace "synclines.at:189"
33033( $at_check_trace; cat stdout
33034) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33035at_status=$? at_failed=false
33036$at_check_filter
33037at_fn_diff_devnull "$at_stderr" || at_failed=:
33038echo >>"$at_stdout"; $as_echo "input.y:10: #error \"10\"
33039" | \
33040  $at_diff - "$at_stdout" || at_failed=:
33041at_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
33049read at_status <"$at_status_file"
33050#AT_STOP_130
33051#AT_START_131
33052at_fn_group_banner 131 'synclines.at:213' \
33053  "Action syncline" "                                " 7
33054at_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
33077cat >syncline.c <<'_ATEOF'
33078#error "1"
33079int 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"
33085at_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>&-
33088at_status=$? at_failed=false
33089$at_check_filter
33090echo stderr:; tee stderr <"$at_stderr"
33091at_fn_diff_devnull "$at_stdout" || at_failed=:
33092at_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;
33166EOF
33167"
33168at_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;
33189EOF
33190
33191) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33192at_status=$? at_failed=false
33193$at_check_filter
33194at_fn_diff_devnull "$at_stderr" || at_failed=:
33195echo stdout:; tee stdout <"$at_stdout"
33196at_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"
33203at_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>&-
33206at_status=$? at_failed=false
33207$at_check_filter
33208at_fn_diff_devnull "$at_stderr" || at_failed=:
33209at_fn_diff_devnull "$at_stdout" || at_failed=:
33210at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
33211$at_failed && at_fn_log_failure
33212$at_traceon; }
33213
33214
33215cat >input.y <<'_ATEOF'
33216%{
33217void yyerror ( const char *msg);
33218int yylex (void);
33219%}
33220%%
33221exp:
33222{
33223#error "8"
33224};
33225_ATEOF
33226
33227if 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"
33235at_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>&-
33239at_status=$? at_failed=false
33240$at_check_filter
33241echo stderr:; cat "$at_stderr"
33242echo stdout:; cat "$at_stdout"
33243at_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"
33249at_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>&-
33252at_status=$? at_failed=false
33253$at_check_filter
33254echo stderr:; cat "$at_stderr"
33255echo stdout:; cat "$at_stdout"
33256at_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"
33265at_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>&-
33270at_status=$? at_failed=false
33271$at_check_filter
33272at_fn_diff_devnull "$at_stderr" || at_failed=:
33273$at_diff expout "$at_stdout" || at_failed=:
33274at_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"
33283at_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>&-
33288at_status=$? at_failed=false
33289$at_check_filter
33290at_fn_diff_devnull "$at_stderr" || at_failed=:
33291$at_diff expout "$at_stdout" || at_failed=:
33292at_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
33298fi
33299{ set +x
33300$as_echo "$at_srcdir/synclines.at:213: bison -o input.c input.y"
33301at_fn_check_prepare_trace "synclines.at:213"
33302( $at_check_trace; bison -o input.c input.y
33303) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33304at_status=$? at_failed=false
33305$at_check_filter
33306at_fn_diff_devnull "$at_stderr" || at_failed=:
33307at_fn_diff_devnull "$at_stdout" || at_failed=:
33308at_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"
33315at_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>&-
33318at_status=$? at_failed=false
33319$at_check_filter
33320echo stderr:; tee stderr <"$at_stderr"
33321at_fn_diff_devnull "$at_stdout" || at_failed=:
33322at_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;
33396EOF
33397"
33398at_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;
33419EOF
33420
33421) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33422at_status=$? at_failed=false
33423$at_check_filter
33424at_fn_diff_devnull "$at_stderr" || at_failed=:
33425echo stdout:; tee stdout <"$at_stdout"
33426at_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"
33433at_fn_check_prepare_trace "synclines.at:213"
33434( $at_check_trace; cat stdout
33435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33436at_status=$? at_failed=false
33437$at_check_filter
33438at_fn_diff_devnull "$at_stderr" || at_failed=:
33439echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
33440" | \
33441  $at_diff - "$at_stdout" || at_failed=:
33442at_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
33450read at_status <"$at_status_file"
33451#AT_STOP_131
33452#AT_START_132
33453at_fn_group_banner 132 'synclines.at:232' \
33454  "Epilogue syncline" "                              " 7
33455at_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
33478cat >syncline.c <<'_ATEOF'
33479#error "1"
33480int 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"
33486at_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>&-
33489at_status=$? at_failed=false
33490$at_check_filter
33491echo stderr:; tee stderr <"$at_stderr"
33492at_fn_diff_devnull "$at_stdout" || at_failed=:
33493at_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;
33567EOF
33568"
33569at_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;
33590EOF
33591
33592) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33593at_status=$? at_failed=false
33594$at_check_filter
33595at_fn_diff_devnull "$at_stderr" || at_failed=:
33596echo stdout:; tee stdout <"$at_stdout"
33597at_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"
33604at_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>&-
33607at_status=$? at_failed=false
33608$at_check_filter
33609at_fn_diff_devnull "$at_stderr" || at_failed=:
33610at_fn_diff_devnull "$at_stdout" || at_failed=:
33611at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
33612$at_failed && at_fn_log_failure
33613$at_traceon; }
33614
33615
33616cat >input.y <<'_ATEOF'
33617%{
33618void yyerror ( const char *msg);
33619int yylex (void);
33620%}
33621%%
33622exp: '0';
33623%%
33624#error "8"
33625_ATEOF
33626
33627if 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"
33635at_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>&-
33639at_status=$? at_failed=false
33640$at_check_filter
33641echo stderr:; cat "$at_stderr"
33642echo stdout:; cat "$at_stdout"
33643at_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"
33649at_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>&-
33652at_status=$? at_failed=false
33653$at_check_filter
33654echo stderr:; cat "$at_stderr"
33655echo stdout:; cat "$at_stdout"
33656at_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"
33665at_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>&-
33670at_status=$? at_failed=false
33671$at_check_filter
33672at_fn_diff_devnull "$at_stderr" || at_failed=:
33673$at_diff expout "$at_stdout" || at_failed=:
33674at_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"
33683at_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>&-
33688at_status=$? at_failed=false
33689$at_check_filter
33690at_fn_diff_devnull "$at_stderr" || at_failed=:
33691$at_diff expout "$at_stdout" || at_failed=:
33692at_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
33698fi
33699{ set +x
33700$as_echo "$at_srcdir/synclines.at:232: bison -o input.c input.y"
33701at_fn_check_prepare_trace "synclines.at:232"
33702( $at_check_trace; bison -o input.c input.y
33703) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33704at_status=$? at_failed=false
33705$at_check_filter
33706at_fn_diff_devnull "$at_stderr" || at_failed=:
33707at_fn_diff_devnull "$at_stdout" || at_failed=:
33708at_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"
33715at_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>&-
33718at_status=$? at_failed=false
33719$at_check_filter
33720echo stderr:; tee stderr <"$at_stderr"
33721at_fn_diff_devnull "$at_stdout" || at_failed=:
33722at_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;
33796EOF
33797"
33798at_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;
33819EOF
33820
33821) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33822at_status=$? at_failed=false
33823$at_check_filter
33824at_fn_diff_devnull "$at_stderr" || at_failed=:
33825echo stdout:; tee stdout <"$at_stdout"
33826at_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"
33833at_fn_check_prepare_trace "synclines.at:232"
33834( $at_check_trace; cat stdout
33835) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33836at_status=$? at_failed=false
33837$at_check_filter
33838at_fn_diff_devnull "$at_stderr" || at_failed=:
33839echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
33840" | \
33841  $at_diff - "$at_stdout" || at_failed=:
33842at_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
33850read at_status <"$at_status_file"
33851#AT_STOP_132
33852#AT_START_133
33853at_fn_group_banner 133 'synclines.at:249' \
33854  "%code top syncline" "                             " 7
33855at_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
33878cat >syncline.c <<'_ATEOF'
33879#error "1"
33880int 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"
33886at_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>&-
33889at_status=$? at_failed=false
33890$at_check_filter
33891echo stderr:; tee stderr <"$at_stderr"
33892at_fn_diff_devnull "$at_stdout" || at_failed=:
33893at_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;
33967EOF
33968"
33969at_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;
33990EOF
33991
33992) >>"$at_stdout" 2>>"$at_stderr" 5>&-
33993at_status=$? at_failed=false
33994$at_check_filter
33995at_fn_diff_devnull "$at_stderr" || at_failed=:
33996echo stdout:; tee stdout <"$at_stdout"
33997at_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"
34004at_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>&-
34007at_status=$? at_failed=false
34008$at_check_filter
34009at_fn_diff_devnull "$at_stderr" || at_failed=:
34010at_fn_diff_devnull "$at_stdout" || at_failed=:
34011at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
34012$at_failed && at_fn_log_failure
34013$at_traceon; }
34014
34015
34016cat >input.y <<'_ATEOF'
34017%code top {
34018#error "2"
34019}
34020%{
34021void yyerror ( const char *msg);
34022int yylex (void);
34023%}
34024%%
34025exp: '0';
34026%%
34027_ATEOF
34028
34029if 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"
34037at_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>&-
34041at_status=$? at_failed=false
34042$at_check_filter
34043echo stderr:; cat "$at_stderr"
34044echo stdout:; cat "$at_stdout"
34045at_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"
34051at_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>&-
34054at_status=$? at_failed=false
34055$at_check_filter
34056echo stderr:; cat "$at_stderr"
34057echo stdout:; cat "$at_stdout"
34058at_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"
34067at_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>&-
34072at_status=$? at_failed=false
34073$at_check_filter
34074at_fn_diff_devnull "$at_stderr" || at_failed=:
34075$at_diff expout "$at_stdout" || at_failed=:
34076at_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"
34085at_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>&-
34090at_status=$? at_failed=false
34091$at_check_filter
34092at_fn_diff_devnull "$at_stderr" || at_failed=:
34093$at_diff expout "$at_stdout" || at_failed=:
34094at_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
34100fi
34101{ set +x
34102$as_echo "$at_srcdir/synclines.at:249: bison -o input.c input.y"
34103at_fn_check_prepare_trace "synclines.at:249"
34104( $at_check_trace; bison -o input.c input.y
34105) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34106at_status=$? at_failed=false
34107$at_check_filter
34108at_fn_diff_devnull "$at_stderr" || at_failed=:
34109at_fn_diff_devnull "$at_stdout" || at_failed=:
34110at_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"
34117at_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>&-
34120at_status=$? at_failed=false
34121$at_check_filter
34122echo stderr:; tee stderr <"$at_stderr"
34123at_fn_diff_devnull "$at_stdout" || at_failed=:
34124at_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;
34198EOF
34199"
34200at_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;
34221EOF
34222
34223) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34224at_status=$? at_failed=false
34225$at_check_filter
34226at_fn_diff_devnull "$at_stderr" || at_failed=:
34227echo stdout:; tee stdout <"$at_stdout"
34228at_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"
34235at_fn_check_prepare_trace "synclines.at:249"
34236( $at_check_trace; cat stdout
34237) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34238at_status=$? at_failed=false
34239$at_check_filter
34240at_fn_diff_devnull "$at_stderr" || at_failed=:
34241echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
34242" | \
34243  $at_diff - "$at_stdout" || at_failed=:
34244at_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
34252read at_status <"$at_status_file"
34253#AT_STOP_133
34254#AT_START_134
34255at_fn_group_banner 134 'synclines.at:290' \
34256  "%no-lines" "                                      " 7
34257at_xfail=no
34258(
34259  $as_echo "134. $at_setup_line: testing $at_desc ..."
34260  $at_traceon
34261
34262
34263
34264cat >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%{
34275void yyerror ( const char *msg);
34276int yylex (void);
34277%}
34278%%
34279exp: '0'
34280_ATEOF
34281
34282
34283if 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"
34291at_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>&-
34295at_status=$? at_failed=false
34296$at_check_filter
34297echo stderr:; cat "$at_stderr"
34298echo stdout:; cat "$at_stdout"
34299at_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"
34305at_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>&-
34308at_status=$? at_failed=false
34309$at_check_filter
34310echo stderr:; cat "$at_stderr"
34311echo stdout:; cat "$at_stdout"
34312at_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"
34321at_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>&-
34326at_status=$? at_failed=false
34327$at_check_filter
34328at_fn_diff_devnull "$at_stderr" || at_failed=:
34329$at_diff expout "$at_stdout" || at_failed=:
34330at_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"
34339at_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>&-
34344at_status=$? at_failed=false
34345$at_check_filter
34346at_fn_diff_devnull "$at_stderr" || at_failed=:
34347$at_diff expout "$at_stdout" || at_failed=:
34348at_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
34354fi
34355{ set +x
34356$as_echo "$at_srcdir/synclines.at:290: bison --no-lines -o input.c -d input.y"
34357at_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>&-
34360at_status=$? at_failed=false
34361$at_check_filter
34362at_fn_diff_devnull "$at_stderr" || at_failed=:
34363at_fn_diff_devnull "$at_stdout" || at_failed=:
34364at_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"
34371at_fn_check_prepare_trace "synclines.at:290"
34372( $at_check_trace; grep '#line' *.c *.h
34373) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34374at_status=$? at_failed=false
34375$at_check_filter
34376at_fn_diff_devnull "$at_stderr" || at_failed=:
34377at_fn_diff_devnull "$at_stdout" || at_failed=:
34378at_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
34387read at_status <"$at_status_file"
34388#AT_STOP_134
34389#AT_START_135
34390at_fn_group_banner 135 'synclines.at:291' \
34391  "%no-lines" "                                      " 7
34392at_xfail=no
34393(
34394  $as_echo "135. $at_setup_line: testing $at_desc ..."
34395  $at_traceon
34396
34397
34398
34399cat >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%{
34410void yyerror ( const char *msg);
34411int yylex (void);
34412%}
34413%%
34414exp: '0'
34415_ATEOF
34416
34417
34418if 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"
34426at_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>&-
34430at_status=$? at_failed=false
34431$at_check_filter
34432echo stderr:; cat "$at_stderr"
34433echo stdout:; cat "$at_stdout"
34434at_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"
34440at_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>&-
34443at_status=$? at_failed=false
34444$at_check_filter
34445echo stderr:; cat "$at_stderr"
34446echo stdout:; cat "$at_stdout"
34447at_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"
34456at_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>&-
34461at_status=$? at_failed=false
34462$at_check_filter
34463at_fn_diff_devnull "$at_stderr" || at_failed=:
34464$at_diff expout "$at_stdout" || at_failed=:
34465at_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"
34474at_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>&-
34479at_status=$? at_failed=false
34480$at_check_filter
34481at_fn_diff_devnull "$at_stderr" || at_failed=:
34482$at_diff expout "$at_stdout" || at_failed=:
34483at_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
34489fi
34490{ set +x
34491$as_echo "$at_srcdir/synclines.at:291: bison --no-lines -o input.c -d input.y"
34492at_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>&-
34495at_status=$? at_failed=false
34496$at_check_filter
34497at_fn_diff_devnull "$at_stderr" || at_failed=:
34498at_fn_diff_devnull "$at_stdout" || at_failed=:
34499at_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"
34506at_fn_check_prepare_trace "synclines.at:291"
34507( $at_check_trace; grep '#line' *.c *.h
34508) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34509at_status=$? at_failed=false
34510$at_check_filter
34511at_fn_diff_devnull "$at_stderr" || at_failed=:
34512at_fn_diff_devnull "$at_stdout" || at_failed=:
34513at_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
34522read at_status <"$at_status_file"
34523#AT_STOP_135
34524#AT_START_136
34525at_fn_group_banner 136 'synclines.at:292' \
34526  "%no-lines" "                                      " 7
34527at_xfail=no
34528(
34529  $as_echo "136. $at_setup_line: testing $at_desc ..."
34530  $at_traceon
34531
34532
34533
34534cat >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
34546int yylex (yy::parser::semantic_type *lvalp);
34547%}
34548%%
34549exp: '0'
34550_ATEOF
34551
34552
34553if 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"
34561at_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>&-
34565at_status=$? at_failed=false
34566$at_check_filter
34567echo stderr:; cat "$at_stderr"
34568echo stdout:; cat "$at_stdout"
34569at_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"
34575at_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>&-
34578at_status=$? at_failed=false
34579$at_check_filter
34580echo stderr:; cat "$at_stderr"
34581echo stdout:; cat "$at_stdout"
34582at_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"
34591at_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>&-
34596at_status=$? at_failed=false
34597$at_check_filter
34598at_fn_diff_devnull "$at_stderr" || at_failed=:
34599$at_diff expout "$at_stdout" || at_failed=:
34600at_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"
34609at_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>&-
34614at_status=$? at_failed=false
34615$at_check_filter
34616at_fn_diff_devnull "$at_stderr" || at_failed=:
34617$at_diff expout "$at_stdout" || at_failed=:
34618at_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
34624fi
34625{ set +x
34626$as_echo "$at_srcdir/synclines.at:292: bison --no-lines -o input.cc -d input.y"
34627at_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>&-
34630at_status=$? at_failed=false
34631$at_check_filter
34632at_fn_diff_devnull "$at_stderr" || at_failed=:
34633at_fn_diff_devnull "$at_stdout" || at_failed=:
34634at_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"
34641at_fn_check_prepare_trace "synclines.at:292"
34642( $at_check_trace; grep '#line' *.cc *.hh
34643) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34644at_status=$? at_failed=false
34645$at_check_filter
34646at_fn_diff_devnull "$at_stderr" || at_failed=:
34647at_fn_diff_devnull "$at_stdout" || at_failed=:
34648at_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
34657read at_status <"$at_status_file"
34658#AT_STOP_136
34659#AT_START_137
34660at_fn_group_banner 137 'synclines.at:293' \
34661  "%no-lines" "                                      " 7
34662at_xfail=no
34663(
34664  $as_echo "137. $at_setup_line: testing $at_desc ..."
34665  $at_traceon
34666
34667
34668
34669cat >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
34681int yylex (yy::parser::semantic_type *lvalp);
34682%}
34683%%
34684exp: '0'
34685_ATEOF
34686
34687
34688if 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"
34696at_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>&-
34700at_status=$? at_failed=false
34701$at_check_filter
34702echo stderr:; cat "$at_stderr"
34703echo stdout:; cat "$at_stdout"
34704at_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"
34710at_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>&-
34713at_status=$? at_failed=false
34714$at_check_filter
34715echo stderr:; cat "$at_stderr"
34716echo stdout:; cat "$at_stdout"
34717at_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"
34726at_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>&-
34731at_status=$? at_failed=false
34732$at_check_filter
34733at_fn_diff_devnull "$at_stderr" || at_failed=:
34734$at_diff expout "$at_stdout" || at_failed=:
34735at_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"
34744at_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>&-
34749at_status=$? at_failed=false
34750$at_check_filter
34751at_fn_diff_devnull "$at_stderr" || at_failed=:
34752$at_diff expout "$at_stdout" || at_failed=:
34753at_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
34759fi
34760{ set +x
34761$as_echo "$at_srcdir/synclines.at:293: bison --no-lines -o input.cc -d input.y"
34762at_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>&-
34765at_status=$? at_failed=false
34766$at_check_filter
34767at_fn_diff_devnull "$at_stderr" || at_failed=:
34768at_fn_diff_devnull "$at_stdout" || at_failed=:
34769at_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"
34776at_fn_check_prepare_trace "synclines.at:293"
34777( $at_check_trace; grep '#line' *.cc *.hh
34778) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34779at_status=$? at_failed=false
34780$at_check_filter
34781at_fn_diff_devnull "$at_stderr" || at_failed=:
34782at_fn_diff_devnull "$at_stdout" || at_failed=:
34783at_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
34792read at_status <"$at_status_file"
34793#AT_STOP_137
34794#AT_START_138
34795at_fn_group_banner 138 'headers.at:57' \
34796  "Invalid CPP guards:  --defines=input/input.h" "   " 8
34797at_xfail=no
34798(
34799  $as_echo "138. $at_setup_line: testing $at_desc ..."
34800  $at_traceon
34801
34802
34803# Possibly create inner directories.
34804dirname=`$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'`
34827as_dir=$dirname; as_fn_mkdir_p
34828
34829cat >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>
34841void yyerror ( const char *msg);
34842int yylex (void);
34843%}
34844%%
34845dummy:;
34846%%
34847#include <input/input.h>
34848_ATEOF
34849
34850
34851
34852if 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"
34860at_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>&-
34864at_status=$? at_failed=false
34865$at_check_filter
34866echo stderr:; cat "$at_stderr"
34867echo stdout:; cat "$at_stdout"
34868at_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"
34874at_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>&-
34877at_status=$? at_failed=false
34878$at_check_filter
34879echo stderr:; cat "$at_stderr"
34880echo stdout:; cat "$at_stdout"
34881at_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"
34890at_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>&-
34895at_status=$? at_failed=false
34896$at_check_filter
34897at_fn_diff_devnull "$at_stderr" || at_failed=:
34898$at_diff expout "$at_stdout" || at_failed=:
34899at_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"
34908at_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>&-
34913at_status=$? at_failed=false
34914$at_check_filter
34915at_fn_diff_devnull "$at_stderr" || at_failed=:
34916$at_diff expout "$at_stdout" || at_failed=:
34917at_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
34923fi
34924{ set +x
34925$as_echo "$at_srcdir/headers.at:57: bison --defines=input/input.h --output=input/input.c input/input.y"
34926at_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>&-
34929at_status=$? at_failed=false
34930$at_check_filter
34931at_fn_diff_devnull "$at_stderr" || at_failed=:
34932at_fn_diff_devnull "$at_stdout" || at_failed=:
34933at_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"
34941at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:57"
34942( $at_check_trace; $BISON_C_WORKS
34943) >>"$at_stdout" 2>>"$at_stderr" 5>&-
34944at_status=$? at_failed=false
34945$at_check_filter
34946echo stderr:; cat "$at_stderr"
34947echo stdout:; cat "$at_stdout"
34948at_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 "
34954at_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>&-
34957at_status=$? at_failed=false
34958$at_check_filter
34959echo stderr:; cat "$at_stderr"
34960echo stdout:; cat "$at_stdout"
34961at_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
34970read at_status <"$at_status_file"
34971#AT_STOP_138
34972#AT_START_139
34973at_fn_group_banner 139 'headers.at:58' \
34974  "Invalid CPP guards:  --defines=9foo.h" "          " 8
34975at_xfail=no
34976(
34977  $as_echo "139. $at_setup_line: testing $at_desc ..."
34978  $at_traceon
34979
34980
34981# Possibly create inner directories.
34982dirname=`$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'`
35005as_dir=$dirname; as_fn_mkdir_p
35006
35007cat >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>
35019void yyerror ( const char *msg);
35020int yylex (void);
35021%}
35022%%
35023dummy:;
35024%%
35025#include <9foo.h>
35026_ATEOF
35027
35028
35029
35030if 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"
35038at_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>&-
35042at_status=$? at_failed=false
35043$at_check_filter
35044echo stderr:; cat "$at_stderr"
35045echo stdout:; cat "$at_stdout"
35046at_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"
35052at_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>&-
35055at_status=$? at_failed=false
35056$at_check_filter
35057echo stderr:; cat "$at_stderr"
35058echo stdout:; cat "$at_stdout"
35059at_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"
35068at_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>&-
35073at_status=$? at_failed=false
35074$at_check_filter
35075at_fn_diff_devnull "$at_stderr" || at_failed=:
35076$at_diff expout "$at_stdout" || at_failed=:
35077at_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"
35086at_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>&-
35091at_status=$? at_failed=false
35092$at_check_filter
35093at_fn_diff_devnull "$at_stderr" || at_failed=:
35094$at_diff expout "$at_stdout" || at_failed=:
35095at_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
35101fi
35102{ set +x
35103$as_echo "$at_srcdir/headers.at:58: bison --defines=9foo.h --output=9foo.c 9foo.y"
35104at_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>&-
35107at_status=$? at_failed=false
35108$at_check_filter
35109at_fn_diff_devnull "$at_stderr" || at_failed=:
35110at_fn_diff_devnull "$at_stdout" || at_failed=:
35111at_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"
35119at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:58"
35120( $at_check_trace; $BISON_C_WORKS
35121) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35122at_status=$? at_failed=false
35123$at_check_filter
35124echo stderr:; cat "$at_stderr"
35125echo stdout:; cat "$at_stdout"
35126at_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 "
35132at_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>&-
35135at_status=$? at_failed=false
35136$at_check_filter
35137echo stderr:; cat "$at_stderr"
35138echo stdout:; cat "$at_stdout"
35139at_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
35148read at_status <"$at_status_file"
35149#AT_STOP_139
35150#AT_START_140
35151at_fn_group_banner 140 'headers.at:59' \
35152  "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 8
35153at_xfail=no
35154(
35155  $as_echo "140. $at_setup_line: testing $at_desc ..."
35156  $at_traceon
35157
35158
35159# Possibly create inner directories.
35160dirname=`$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'`
35183as_dir=$dirname; as_fn_mkdir_p
35184
35185cat >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>
35197void yyerror ( const char *msg);
35198int yylex (void);
35199%}
35200%%
35201dummy:;
35202%%
35203#include <input/input.h>
35204_ATEOF
35205
35206
35207
35208if 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"
35216at_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>&-
35220at_status=$? at_failed=false
35221$at_check_filter
35222echo stderr:; cat "$at_stderr"
35223echo stdout:; cat "$at_stdout"
35224at_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"
35230at_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>&-
35233at_status=$? at_failed=false
35234$at_check_filter
35235echo stderr:; cat "$at_stderr"
35236echo stdout:; cat "$at_stdout"
35237at_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"
35246at_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>&-
35251at_status=$? at_failed=false
35252$at_check_filter
35253at_fn_diff_devnull "$at_stderr" || at_failed=:
35254$at_diff expout "$at_stdout" || at_failed=:
35255at_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"
35264at_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>&-
35269at_status=$? at_failed=false
35270$at_check_filter
35271at_fn_diff_devnull "$at_stderr" || at_failed=:
35272$at_diff expout "$at_stdout" || at_failed=:
35273at_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
35279fi
35280{ set +x
35281$as_echo "$at_srcdir/headers.at:59: bison --defines=input/input.h --output=input/input.c input/input.y"
35282at_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>&-
35285at_status=$? at_failed=false
35286$at_check_filter
35287at_fn_diff_devnull "$at_stderr" || at_failed=:
35288at_fn_diff_devnull "$at_stdout" || at_failed=:
35289at_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"
35297at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:59"
35298( $at_check_trace; $BISON_C_WORKS
35299) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35300at_status=$? at_failed=false
35301$at_check_filter
35302echo stderr:; cat "$at_stderr"
35303echo stdout:; cat "$at_stdout"
35304at_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 "
35310at_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>&-
35313at_status=$? at_failed=false
35314$at_check_filter
35315echo stderr:; cat "$at_stderr"
35316echo stdout:; cat "$at_stdout"
35317at_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
35326read at_status <"$at_status_file"
35327#AT_STOP_140
35328#AT_START_141
35329at_fn_group_banner 141 'headers.at:60' \
35330  "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 8
35331at_xfail=no
35332(
35333  $as_echo "141. $at_setup_line: testing $at_desc ..."
35334  $at_traceon
35335
35336
35337# Possibly create inner directories.
35338dirname=`$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'`
35361as_dir=$dirname; as_fn_mkdir_p
35362
35363cat >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>
35375void yyerror ( const char *msg);
35376int yylex (void);
35377%}
35378%%
35379dummy:;
35380%%
35381#include <9foo.h>
35382_ATEOF
35383
35384
35385
35386if 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"
35394at_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>&-
35398at_status=$? at_failed=false
35399$at_check_filter
35400echo stderr:; cat "$at_stderr"
35401echo stdout:; cat "$at_stdout"
35402at_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"
35408at_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>&-
35411at_status=$? at_failed=false
35412$at_check_filter
35413echo stderr:; cat "$at_stderr"
35414echo stdout:; cat "$at_stdout"
35415at_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"
35424at_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>&-
35429at_status=$? at_failed=false
35430$at_check_filter
35431at_fn_diff_devnull "$at_stderr" || at_failed=:
35432$at_diff expout "$at_stdout" || at_failed=:
35433at_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"
35442at_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>&-
35447at_status=$? at_failed=false
35448$at_check_filter
35449at_fn_diff_devnull "$at_stderr" || at_failed=:
35450$at_diff expout "$at_stdout" || at_failed=:
35451at_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
35457fi
35458{ set +x
35459$as_echo "$at_srcdir/headers.at:60: bison --defines=9foo.h --output=9foo.c 9foo.y"
35460at_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>&-
35463at_status=$? at_failed=false
35464$at_check_filter
35465at_fn_diff_devnull "$at_stderr" || at_failed=:
35466at_fn_diff_devnull "$at_stdout" || at_failed=:
35467at_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"
35475at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:60"
35476( $at_check_trace; $BISON_C_WORKS
35477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35478at_status=$? at_failed=false
35479$at_check_filter
35480echo stderr:; cat "$at_stderr"
35481echo stdout:; cat "$at_stdout"
35482at_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 "
35488at_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>&-
35491at_status=$? at_failed=false
35492$at_check_filter
35493echo stderr:; cat "$at_stderr"
35494echo stdout:; cat "$at_stdout"
35495at_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
35504read at_status <"$at_status_file"
35505#AT_STOP_141
35506#AT_START_142
35507at_fn_group_banner 142 'headers.at:69' \
35508  "export YYLTYPE" "                                 " 8
35509at_xfail=no
35510(
35511  $as_echo "142. $at_setup_line: testing $at_desc ..."
35512  $at_traceon
35513
35514
35515cat >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
35531static int
35532my_lex (void)
35533{
35534  return EOF;
35535}
35536
35537static void
35538my_error (const char *msg)
35539{
35540  fprintf (stderr, "%s\n", msg);
35541}
35542
35543%}
35544%%
35545exp:;
35546_ATEOF
35547
35548
35549
35550if 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"
35558at_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>&-
35562at_status=$? at_failed=false
35563$at_check_filter
35564echo stderr:; cat "$at_stderr"
35565echo stdout:; cat "$at_stdout"
35566at_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"
35572at_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>&-
35575at_status=$? at_failed=false
35576$at_check_filter
35577echo stderr:; cat "$at_stderr"
35578echo stdout:; cat "$at_stdout"
35579at_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"
35588at_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>&-
35593at_status=$? at_failed=false
35594$at_check_filter
35595at_fn_diff_devnull "$at_stderr" || at_failed=:
35596$at_diff expout "$at_stdout" || at_failed=:
35597at_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"
35606at_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>&-
35611at_status=$? at_failed=false
35612$at_check_filter
35613at_fn_diff_devnull "$at_stderr" || at_failed=:
35614$at_diff expout "$at_stdout" || at_failed=:
35615at_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
35621fi
35622{ set +x
35623$as_echo "$at_srcdir/headers.at:96: bison --defines -o input.c input.y"
35624at_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>&-
35627at_status=$? at_failed=false
35628$at_check_filter
35629at_fn_diff_devnull "$at_stderr" || at_failed=:
35630at_fn_diff_devnull "$at_stdout" || at_failed=:
35631at_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.
35638cat >caller.c <<'_ATEOF'
35639#include "input.h"
35640YYLTYPE *my_llocp = &my_lloc;
35641
35642int my_parse (void);
35643
35644int
35645main (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"
35656at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:114"
35657( $at_check_trace; $BISON_C_WORKS
35658) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35659at_status=$? at_failed=false
35660$at_check_filter
35661echo stderr:; cat "$at_stderr"
35662echo stdout:; cat "$at_stdout"
35663at_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 "
35669at_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>&-
35672at_status=$? at_failed=false
35673$at_check_filter
35674echo stderr:; cat "$at_stderr"
35675echo stdout:; cat "$at_stdout"
35676at_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"
35682at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:115"
35683( $at_check_trace; $BISON_C_WORKS
35684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35685at_status=$? at_failed=false
35686$at_check_filter
35687echo stderr:; cat "$at_stderr"
35688echo stdout:; cat "$at_stdout"
35689at_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 "
35695at_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>&-
35698at_status=$? at_failed=false
35699$at_check_filter
35700echo stderr:; cat "$at_stderr"
35701echo stdout:; cat "$at_stdout"
35702at_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"
35708at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:116"
35709( $at_check_trace; $BISON_C_WORKS
35710) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35711at_status=$? at_failed=false
35712$at_check_filter
35713echo stderr:; cat "$at_stderr"
35714echo stdout:; cat "$at_stdout"
35715at_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"
35721at_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>&-
35724at_status=$? at_failed=false
35725$at_check_filter
35726echo stderr:; cat "$at_stderr"
35727echo stdout:; cat "$at_stdout"
35728at_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"
35734at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:117"
35735( $at_check_trace;  $PREPARSER ./caller
35736) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35737at_status=$? at_failed=false
35738$at_check_filter
35739echo stderr:; tee stderr <"$at_stderr"
35740at_fn_diff_devnull "$at_stdout" || at_failed=:
35741at_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"
35747at_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>&-
35750at_status=$? at_failed=false
35751$at_check_filter
35752at_fn_diff_devnull "$at_stderr" || at_failed=:
35753at_fn_diff_devnull "$at_stdout" || at_failed=:
35754at_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
35763read at_status <"$at_status_file"
35764#AT_STOP_142
35765#AT_START_143
35766at_fn_group_banner 143 'headers.at:125' \
35767  "Several parsers" "                                " 8
35768at_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
35781cat >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
35791extern "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
35814int
35815main (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
35834cat >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%%
35856exp:
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.  */
35870static
35871void x1_error ( const char *msg)
35872{
35873  fprintf (stderr, "%s\n", msg);
35874}
35875#include <assert.h>
35876static
35877int 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
35892if 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"
35900at_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>&-
35904at_status=$? at_failed=false
35905$at_check_filter
35906echo stderr:; cat "$at_stderr"
35907echo stdout:; cat "$at_stdout"
35908at_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"
35914at_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>&-
35917at_status=$? at_failed=false
35918$at_check_filter
35919echo stderr:; cat "$at_stderr"
35920echo stdout:; cat "$at_stdout"
35921at_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"
35930at_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>&-
35935at_status=$? at_failed=false
35936$at_check_filter
35937at_fn_diff_devnull "$at_stderr" || at_failed=:
35938$at_diff expout "$at_stdout" || at_failed=:
35939at_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"
35948at_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>&-
35953at_status=$? at_failed=false
35954$at_check_filter
35955at_fn_diff_devnull "$at_stderr" || at_failed=:
35956$at_diff expout "$at_stdout" || at_failed=:
35957at_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
35963fi
35964{ set +x
35965$as_echo "$at_srcdir/headers.at:218: bison -d -o x1.c x1.y"
35966at_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>&-
35969at_status=$? at_failed=false
35970$at_check_filter
35971at_fn_diff_devnull "$at_stderr" || at_failed=:
35972at_fn_diff_devnull "$at_stdout" || at_failed=:
35973at_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"
35981at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:218"
35982( $at_check_trace; $BISON_C_WORKS
35983) >>"$at_stdout" 2>>"$at_stderr" 5>&-
35984at_status=$? at_failed=false
35985$at_check_filter
35986echo stderr:; cat "$at_stderr"
35987echo stdout:; cat "$at_stdout"
35988at_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 "
35994at_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>&-
35997at_status=$? at_failed=false
35998$at_check_filter
35999echo stderr:; cat "$at_stderr"
36000echo stdout:; cat "$at_stdout"
36001at_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"
36007at_fn_check_prepare_trace "headers.at:218"
36008( $at_check_trace; echo "x1" >>expout
36009) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36010at_status=$? at_failed=false
36011$at_check_filter
36012at_fn_diff_devnull "$at_stderr" || at_failed=:
36013at_fn_diff_devnull "$at_stdout" || at_failed=:
36014at_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
36022cat >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%%
36044exp:
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.  */
36058static
36059void 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>
36066static
36067int 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
36084if 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"
36092at_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>&-
36096at_status=$? at_failed=false
36097$at_check_filter
36098echo stderr:; cat "$at_stderr"
36099echo stdout:; cat "$at_stdout"
36100at_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"
36106at_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>&-
36109at_status=$? at_failed=false
36110$at_check_filter
36111echo stderr:; cat "$at_stderr"
36112echo stdout:; cat "$at_stdout"
36113at_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"
36122at_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>&-
36127at_status=$? at_failed=false
36128$at_check_filter
36129at_fn_diff_devnull "$at_stderr" || at_failed=:
36130$at_diff expout "$at_stdout" || at_failed=:
36131at_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"
36140at_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>&-
36145at_status=$? at_failed=false
36146$at_check_filter
36147at_fn_diff_devnull "$at_stderr" || at_failed=:
36148$at_diff expout "$at_stdout" || at_failed=:
36149at_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
36155fi
36156{ set +x
36157$as_echo "$at_srcdir/headers.at:219: bison -d -o x2.c x2.y"
36158at_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>&-
36161at_status=$? at_failed=false
36162$at_check_filter
36163at_fn_diff_devnull "$at_stderr" || at_failed=:
36164at_fn_diff_devnull "$at_stdout" || at_failed=:
36165at_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"
36173at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:219"
36174( $at_check_trace; $BISON_C_WORKS
36175) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36176at_status=$? at_failed=false
36177$at_check_filter
36178echo stderr:; cat "$at_stderr"
36179echo stdout:; cat "$at_stdout"
36180at_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 "
36186at_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>&-
36189at_status=$? at_failed=false
36190$at_check_filter
36191echo stderr:; cat "$at_stderr"
36192echo stdout:; cat "$at_stdout"
36193at_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"
36199at_fn_check_prepare_trace "headers.at:219"
36200( $at_check_trace; echo "x2" >>expout
36201) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36202at_status=$? at_failed=false
36203$at_check_filter
36204at_fn_diff_devnull "$at_stderr" || at_failed=:
36205at_fn_diff_devnull "$at_stdout" || at_failed=:
36206at_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
36214cat >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%%
36236exp:
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.  */
36250static
36251void x3_error ( const char *msg)
36252{
36253  fprintf (stderr, "%s\n", msg);
36254}
36255#include <assert.h>
36256static
36257int 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
36272if 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"
36280at_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>&-
36284at_status=$? at_failed=false
36285$at_check_filter
36286echo stderr:; cat "$at_stderr"
36287echo stdout:; cat "$at_stdout"
36288at_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"
36294at_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>&-
36297at_status=$? at_failed=false
36298$at_check_filter
36299echo stderr:; cat "$at_stderr"
36300echo stdout:; cat "$at_stdout"
36301at_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"
36310at_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>&-
36315at_status=$? at_failed=false
36316$at_check_filter
36317at_fn_diff_devnull "$at_stderr" || at_failed=:
36318$at_diff expout "$at_stdout" || at_failed=:
36319at_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"
36328at_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>&-
36333at_status=$? at_failed=false
36334$at_check_filter
36335at_fn_diff_devnull "$at_stderr" || at_failed=:
36336$at_diff expout "$at_stdout" || at_failed=:
36337at_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
36343fi
36344{ set +x
36345$as_echo "$at_srcdir/headers.at:220: bison -d -o x3.c x3.y"
36346at_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>&-
36349at_status=$? at_failed=false
36350$at_check_filter
36351at_fn_diff_devnull "$at_stderr" || at_failed=:
36352at_fn_diff_devnull "$at_stdout" || at_failed=:
36353at_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"
36361at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:220"
36362( $at_check_trace; $BISON_C_WORKS
36363) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36364at_status=$? at_failed=false
36365$at_check_filter
36366echo stderr:; cat "$at_stderr"
36367echo stdout:; cat "$at_stdout"
36368at_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 "
36374at_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>&-
36377at_status=$? at_failed=false
36378$at_check_filter
36379echo stderr:; cat "$at_stderr"
36380echo stdout:; cat "$at_stdout"
36381at_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"
36387at_fn_check_prepare_trace "headers.at:220"
36388( $at_check_trace; echo "x3" >>expout
36389) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36390at_status=$? at_failed=false
36391$at_check_filter
36392at_fn_diff_devnull "$at_stderr" || at_failed=:
36393at_fn_diff_devnull "$at_stdout" || at_failed=:
36394at_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
36402cat >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%%
36424exp:
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.  */
36438static
36439void 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>
36446static
36447int 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
36464if 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"
36472at_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>&-
36476at_status=$? at_failed=false
36477$at_check_filter
36478echo stderr:; cat "$at_stderr"
36479echo stdout:; cat "$at_stdout"
36480at_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"
36486at_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>&-
36489at_status=$? at_failed=false
36490$at_check_filter
36491echo stderr:; cat "$at_stderr"
36492echo stdout:; cat "$at_stdout"
36493at_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"
36502at_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>&-
36507at_status=$? at_failed=false
36508$at_check_filter
36509at_fn_diff_devnull "$at_stderr" || at_failed=:
36510$at_diff expout "$at_stdout" || at_failed=:
36511at_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"
36520at_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>&-
36525at_status=$? at_failed=false
36526$at_check_filter
36527at_fn_diff_devnull "$at_stderr" || at_failed=:
36528$at_diff expout "$at_stdout" || at_failed=:
36529at_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
36535fi
36536{ set +x
36537$as_echo "$at_srcdir/headers.at:221: bison -d -o x4.c x4.y"
36538at_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>&-
36541at_status=$? at_failed=false
36542$at_check_filter
36543at_fn_diff_devnull "$at_stderr" || at_failed=:
36544at_fn_diff_devnull "$at_stdout" || at_failed=:
36545at_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"
36553at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:221"
36554( $at_check_trace; $BISON_C_WORKS
36555) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36556at_status=$? at_failed=false
36557$at_check_filter
36558echo stderr:; cat "$at_stderr"
36559echo stdout:; cat "$at_stdout"
36560at_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 "
36566at_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>&-
36569at_status=$? at_failed=false
36570$at_check_filter
36571echo stderr:; cat "$at_stderr"
36572echo stdout:; cat "$at_stdout"
36573at_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"
36579at_fn_check_prepare_trace "headers.at:221"
36580( $at_check_trace; echo "x4" >>expout
36581) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36582at_status=$? at_failed=false
36583$at_check_filter
36584at_fn_diff_devnull "$at_stderr" || at_failed=:
36585at_fn_diff_devnull "$at_stdout" || at_failed=:
36586at_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
36594cat >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%%
36616exp:
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.  */
36629void
36630x5_::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>
36636static
36637int 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
36654if 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"
36662at_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>&-
36666at_status=$? at_failed=false
36667$at_check_filter
36668echo stderr:; cat "$at_stderr"
36669echo stdout:; cat "$at_stdout"
36670at_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"
36676at_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>&-
36679at_status=$? at_failed=false
36680$at_check_filter
36681echo stderr:; cat "$at_stderr"
36682echo stdout:; cat "$at_stdout"
36683at_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"
36692at_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>&-
36697at_status=$? at_failed=false
36698$at_check_filter
36699at_fn_diff_devnull "$at_stderr" || at_failed=:
36700$at_diff expout "$at_stdout" || at_failed=:
36701at_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"
36710at_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>&-
36715at_status=$? at_failed=false
36716$at_check_filter
36717at_fn_diff_devnull "$at_stderr" || at_failed=:
36718$at_diff expout "$at_stdout" || at_failed=:
36719at_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
36725fi
36726{ set +x
36727$as_echo "$at_srcdir/headers.at:222: bison -d -o x5.cc x5.y"
36728at_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>&-
36731at_status=$? at_failed=false
36732$at_check_filter
36733at_fn_diff_devnull "$at_stderr" || at_failed=:
36734at_fn_diff_devnull "$at_stdout" || at_failed=:
36735at_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"
36744at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:222"
36745( $at_check_trace; $BISON_CXX_WORKS
36746) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36747at_status=$? at_failed=false
36748$at_check_filter
36749echo stderr:; cat "$at_stderr"
36750echo stdout:; cat "$at_stdout"
36751at_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 "
36757at_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>&-
36760at_status=$? at_failed=false
36761$at_check_filter
36762echo stderr:; cat "$at_stderr"
36763echo stdout:; cat "$at_stdout"
36764at_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"
36770at_fn_check_prepare_trace "headers.at:222"
36771( $at_check_trace; echo "x5" >>expout
36772) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36773at_status=$? at_failed=false
36774$at_check_filter
36775at_fn_diff_devnull "$at_stderr" || at_failed=:
36776at_fn_diff_devnull "$at_stdout" || at_failed=:
36777at_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
36785cat >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%%
36807exp:
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.  */
36821static
36822void x6_error ( const char *msg)
36823{
36824  fprintf (stderr, "%s\n", msg);
36825}
36826#include <assert.h>
36827static
36828int 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
36843if 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"
36851at_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>&-
36855at_status=$? at_failed=false
36856$at_check_filter
36857echo stderr:; cat "$at_stderr"
36858echo stdout:; cat "$at_stdout"
36859at_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"
36865at_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>&-
36868at_status=$? at_failed=false
36869$at_check_filter
36870echo stderr:; cat "$at_stderr"
36871echo stdout:; cat "$at_stdout"
36872at_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"
36881at_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>&-
36886at_status=$? at_failed=false
36887$at_check_filter
36888at_fn_diff_devnull "$at_stderr" || at_failed=:
36889$at_diff expout "$at_stdout" || at_failed=:
36890at_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"
36899at_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>&-
36904at_status=$? at_failed=false
36905$at_check_filter
36906at_fn_diff_devnull "$at_stderr" || at_failed=:
36907$at_diff expout "$at_stdout" || at_failed=:
36908at_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
36914fi
36915{ set +x
36916$as_echo "$at_srcdir/headers.at:223: bison -d -o x6.c x6.y"
36917at_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>&-
36920at_status=$? at_failed=false
36921$at_check_filter
36922at_fn_diff_devnull "$at_stderr" || at_failed=:
36923at_fn_diff_devnull "$at_stdout" || at_failed=:
36924at_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"
36932at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:223"
36933( $at_check_trace; $BISON_C_WORKS
36934) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36935at_status=$? at_failed=false
36936$at_check_filter
36937echo stderr:; cat "$at_stderr"
36938echo stdout:; cat "$at_stdout"
36939at_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 "
36945at_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>&-
36948at_status=$? at_failed=false
36949$at_check_filter
36950echo stderr:; cat "$at_stderr"
36951echo stdout:; cat "$at_stdout"
36952at_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"
36958at_fn_check_prepare_trace "headers.at:223"
36959( $at_check_trace; echo "x6" >>expout
36960) >>"$at_stdout" 2>>"$at_stderr" 5>&-
36961at_status=$? at_failed=false
36962$at_check_filter
36963at_fn_diff_devnull "$at_stderr" || at_failed=:
36964at_fn_diff_devnull "$at_stdout" || at_failed=:
36965at_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
36973cat >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%%
36995exp:
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.  */
37009static
37010void x7_error ( const char *msg)
37011{
37012  fprintf (stderr, "%s\n", msg);
37013}
37014#include <assert.h>
37015static
37016int 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
37031if 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"
37039at_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>&-
37043at_status=$? at_failed=false
37044$at_check_filter
37045echo stderr:; cat "$at_stderr"
37046echo stdout:; cat "$at_stdout"
37047at_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"
37053at_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>&-
37056at_status=$? at_failed=false
37057$at_check_filter
37058echo stderr:; cat "$at_stderr"
37059echo stdout:; cat "$at_stdout"
37060at_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"
37069at_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>&-
37074at_status=$? at_failed=false
37075$at_check_filter
37076at_fn_diff_devnull "$at_stderr" || at_failed=:
37077$at_diff expout "$at_stdout" || at_failed=:
37078at_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"
37087at_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>&-
37092at_status=$? at_failed=false
37093$at_check_filter
37094at_fn_diff_devnull "$at_stderr" || at_failed=:
37095$at_diff expout "$at_stdout" || at_failed=:
37096at_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
37102fi
37103{ set +x
37104$as_echo "$at_srcdir/headers.at:224: bison -d -o x7.c x7.y"
37105at_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>&-
37108at_status=$? at_failed=false
37109$at_check_filter
37110at_fn_diff_devnull "$at_stderr" || at_failed=:
37111at_fn_diff_devnull "$at_stdout" || at_failed=:
37112at_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"
37120at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:224"
37121( $at_check_trace; $BISON_C_WORKS
37122) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37123at_status=$? at_failed=false
37124$at_check_filter
37125echo stderr:; cat "$at_stderr"
37126echo stdout:; cat "$at_stdout"
37127at_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 "
37133at_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>&-
37136at_status=$? at_failed=false
37137$at_check_filter
37138echo stderr:; cat "$at_stderr"
37139echo stdout:; cat "$at_stdout"
37140at_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"
37146at_fn_check_prepare_trace "headers.at:224"
37147( $at_check_trace; echo "x7" >>expout
37148) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37149at_status=$? at_failed=false
37150$at_check_filter
37151at_fn_diff_devnull "$at_stderr" || at_failed=:
37152at_fn_diff_devnull "$at_stdout" || at_failed=:
37153at_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
37161cat >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%%
37183exp:
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.  */
37197static
37198void x8_error ( const char *msg)
37199{
37200  fprintf (stderr, "%s\n", msg);
37201}
37202#include <assert.h>
37203static
37204int 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
37219if 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"
37227at_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>&-
37231at_status=$? at_failed=false
37232$at_check_filter
37233echo stderr:; cat "$at_stderr"
37234echo stdout:; cat "$at_stdout"
37235at_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"
37241at_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>&-
37244at_status=$? at_failed=false
37245$at_check_filter
37246echo stderr:; cat "$at_stderr"
37247echo stdout:; cat "$at_stdout"
37248at_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"
37257at_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>&-
37262at_status=$? at_failed=false
37263$at_check_filter
37264at_fn_diff_devnull "$at_stderr" || at_failed=:
37265$at_diff expout "$at_stdout" || at_failed=:
37266at_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"
37275at_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>&-
37280at_status=$? at_failed=false
37281$at_check_filter
37282at_fn_diff_devnull "$at_stderr" || at_failed=:
37283$at_diff expout "$at_stdout" || at_failed=:
37284at_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
37290fi
37291{ set +x
37292$as_echo "$at_srcdir/headers.at:225: bison -d -o x8.c x8.y"
37293at_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>&-
37296at_status=$? at_failed=false
37297$at_check_filter
37298at_fn_diff_devnull "$at_stderr" || at_failed=:
37299at_fn_diff_devnull "$at_stdout" || at_failed=:
37300at_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"
37308at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:225"
37309( $at_check_trace; $BISON_C_WORKS
37310) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37311at_status=$? at_failed=false
37312$at_check_filter
37313echo stderr:; cat "$at_stderr"
37314echo stdout:; cat "$at_stdout"
37315at_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 "
37321at_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>&-
37324at_status=$? at_failed=false
37325$at_check_filter
37326echo stderr:; cat "$at_stderr"
37327echo stdout:; cat "$at_stdout"
37328at_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"
37334at_fn_check_prepare_trace "headers.at:225"
37335( $at_check_trace; echo "x8" >>expout
37336) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37337at_status=$? at_failed=false
37338$at_check_filter
37339at_fn_diff_devnull "$at_stderr" || at_failed=:
37340at_fn_diff_devnull "$at_stdout" || at_failed=:
37341at_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"
37382at_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>&-
37406at_status=$? at_failed=false
37407$at_check_filter
37408at_fn_diff_devnull "$at_stderr" || at_failed=:
37409at_fn_diff_devnull "$at_stdout" || at_failed=:
37410at_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++.
37417for h in *.h *.hh
37418do
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"
37429EOF
37430
37431{ set +x
37432$as_echo "$at_srcdir/headers.at:270: \$BISON_CXX_WORKS"
37433at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:270"
37434( $at_check_trace; $BISON_CXX_WORKS
37435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37436at_status=$? at_failed=false
37437$at_check_filter
37438echo stderr:; cat "$at_stderr"
37439echo stdout:; cat "$at_stdout"
37440at_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 "
37446at_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>&-
37449at_status=$? at_failed=false
37450$at_check_filter
37451echo stderr:; cat "$at_stderr"
37452echo stdout:; cat "$at_stdout"
37453at_fn_check_status 0 $at_status "$at_srcdir/headers.at:270"
37454$at_failed && at_fn_log_failure
37455$at_traceon; }
37456
37457done
37458
37459# Do this late, so that other checks have been performed.
37460cat >c-and-cxx.h <<'_ATEOF'
37461#ifdef __cplusplus
37462extern "C"
37463{
37464#endif
37465  int fortytwo (void);
37466#ifdef __cplusplus
37467}
37468#endif
37469_ATEOF
37470
37471cat >c-only.c <<'_ATEOF'
37472#include "c-and-cxx.h"
37473int
37474main (void)
37475{
37476  return fortytwo () == 42 ? 0 : 1;
37477}
37478_ATEOF
37479
37480cat >cxx-only.cc <<'_ATEOF'
37481#include "c-and-cxx.h"
37482int fortytwo ()
37483{
37484  return 42;
37485}
37486_ATEOF
37487
37488{ set +x
37489$as_echo "$at_srcdir/headers.at:274: \$BISON_C_WORKS"
37490at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:274"
37491( $at_check_trace; $BISON_C_WORKS
37492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37493at_status=$? at_failed=false
37494$at_check_filter
37495echo stderr:; cat "$at_stderr"
37496echo stdout:; cat "$at_stdout"
37497at_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 "
37503at_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>&-
37506at_status=$? at_failed=false
37507$at_check_filter
37508echo stderr:; cat "$at_stderr"
37509echo stdout:; cat "$at_stdout"
37510at_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"
37517at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:274"
37518( $at_check_trace; $BISON_CXX_WORKS
37519) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37520at_status=$? at_failed=false
37521$at_check_filter
37522echo stderr:; cat "$at_stderr"
37523echo stdout:; cat "$at_stdout"
37524at_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 "
37530at_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>&-
37533at_status=$? at_failed=false
37534$at_check_filter
37535echo stderr:; cat "$at_stderr"
37536echo stdout:; cat "$at_stdout"
37537at_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"
37544at_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>&-
37548at_status=$? at_failed=false
37549$at_check_filter
37550at_fn_diff_devnull "$at_stderr" || at_failed=:
37551echo stdout:; cat "$at_stdout"
37552at_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"
37558at_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>&-
37561at_status=$? at_failed=false
37562$at_check_filter
37563echo stderr:; tee stderr <"$at_stderr"
37564at_fn_diff_devnull "$at_stdout" || at_failed=:
37565at_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"
37571at_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>&-
37574at_status=$? at_failed=false
37575$at_check_filter
37576at_fn_diff_devnull "$at_stderr" || at_failed=:
37577at_fn_diff_devnull "$at_stdout" || at_failed=:
37578at_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"
37588at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:276"
37589( $at_check_trace; $BISON_CXX_WORKS
37590) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37591at_status=$? at_failed=false
37592$at_check_filter
37593echo stderr:; cat "$at_stderr"
37594echo stdout:; cat "$at_stdout"
37595at_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"
37601at_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>&-
37604at_status=$? at_failed=false
37605$at_check_filter
37606echo stderr:; cat "$at_stderr"
37607echo stdout:; cat "$at_stdout"
37608at_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"
37614at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:277"
37615( $at_check_trace;  $PREPARSER ./parser
37616) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37617at_status=$? at_failed=false
37618$at_check_filter
37619echo stderr:; tee stderr <"$at_stderr"
37620$at_diff expout "$at_stdout" || at_failed=:
37621at_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"
37627at_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>&-
37630at_status=$? at_failed=false
37631$at_check_filter
37632at_fn_diff_devnull "$at_stderr" || at_failed=:
37633at_fn_diff_devnull "$at_stdout" || at_failed=:
37634at_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
37645read at_status <"$at_status_file"
37646#AT_STOP_143
37647#AT_START_144
37648at_fn_group_banner 144 'actions.at:24' \
37649  "Mid-rule actions" "                               " 9
37650at_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
37662cat >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%{
37674static void yyerror ( const char *msg);
37675static int yylex (void);
37676%}
37677%%
37678exp:     { 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.  */
37693static
37694void yyerror ( const char *msg)
37695{
37696  fprintf (stderr, "%s\n", msg);
37697}
37698#include <assert.h>
37699static
37700int 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}
37711int
37712main (void)
37713{
37714  return yyparse ();
37715}
37716_ATEOF
37717
37718
37719
37720
37721if 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"
37729at_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>&-
37733at_status=$? at_failed=false
37734$at_check_filter
37735echo stderr:; cat "$at_stderr"
37736echo stdout:; cat "$at_stdout"
37737at_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"
37743at_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>&-
37746at_status=$? at_failed=false
37747$at_check_filter
37748echo stderr:; cat "$at_stderr"
37749echo stdout:; cat "$at_stdout"
37750at_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"
37759at_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>&-
37764at_status=$? at_failed=false
37765$at_check_filter
37766at_fn_diff_devnull "$at_stderr" || at_failed=:
37767$at_diff expout "$at_stdout" || at_failed=:
37768at_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"
37777at_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>&-
37782at_status=$? at_failed=false
37783$at_check_filter
37784at_fn_diff_devnull "$at_stderr" || at_failed=:
37785$at_diff expout "$at_stdout" || at_failed=:
37786at_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
37792fi
37793{ set +x
37794$as_echo "$at_srcdir/actions.at:63: bison -d -v -o input.c input.y"
37795at_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>&-
37798at_status=$? at_failed=false
37799$at_check_filter
37800at_fn_diff_devnull "$at_stderr" || at_failed=:
37801at_fn_diff_devnull "$at_stdout" || at_failed=:
37802at_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"
37809at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:64"
37810( $at_check_trace; $BISON_C_WORKS
37811) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37812at_status=$? at_failed=false
37813$at_check_filter
37814echo stderr:; cat "$at_stderr"
37815echo stdout:; cat "$at_stdout"
37816at_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"
37822at_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>&-
37825at_status=$? at_failed=false
37826$at_check_filter
37827echo stderr:; cat "$at_stderr"
37828echo stdout:; cat "$at_stdout"
37829at_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"
37835at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:65"
37836( $at_check_trace;  $PREPARSER ./input
37837) >>"$at_stdout" 2>>"$at_stderr" 5>&-
37838at_status=$? at_failed=false
37839$at_check_filter
37840echo stderr:; tee stderr <"$at_stderr"
37841echo >>"$at_stdout"; $as_echo "0123456789
37842" | \
37843  $at_diff - "$at_stdout" || at_failed=:
37844at_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"
37850at_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>&-
37853at_status=$? at_failed=false
37854$at_check_filter
37855at_fn_diff_devnull "$at_stderr" || at_failed=:
37856at_fn_diff_devnull "$at_stdout" || at_failed=:
37857at_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
37866read at_status <"$at_status_file"
37867#AT_STOP_144
37868#AT_START_145
37869at_fn_group_banner 145 'actions.at:133' \
37870  "Initial location: yacc.c " "                      " 9
37871at_xfail=no
37872(
37873  $as_echo "145. $at_setup_line: testing $at_desc ..."
37874  $at_traceon
37875
37876
37877
37878cat >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 */
37897static void yyerror ( const char *msg);
37898static int yylex (void);
37899}
37900%%
37901exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
37902%%
37903#include <stdio.h>
37904/* A C error reporting function.  */
37905static
37906void yyerror ( const char *msg)
37907{
37908  YY_LOCATION_PRINT (stderr, (yylloc));
37909  fprintf (stderr, ": ");
37910  fprintf (stderr, "%s\n", msg);
37911}
37912
37913int yylex (void)
37914{
37915  return 'x';
37916}
37917
37918int
37919main (void)
37920{
37921  yydebug = !!getenv("YYDEBUG");
37922  return !!yyparse ();
37923}
37924_ATEOF
37925
37926
37927
37928if 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"
37936at_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>&-
37940at_status=$? at_failed=false
37941$at_check_filter
37942echo stderr:; cat "$at_stderr"
37943echo stdout:; cat "$at_stdout"
37944at_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"
37950at_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>&-
37953at_status=$? at_failed=false
37954$at_check_filter
37955echo stderr:; cat "$at_stderr"
37956echo stdout:; cat "$at_stdout"
37957at_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"
37966at_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>&-
37971at_status=$? at_failed=false
37972$at_check_filter
37973at_fn_diff_devnull "$at_stderr" || at_failed=:
37974$at_diff expout "$at_stdout" || at_failed=:
37975at_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"
37984at_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>&-
37989at_status=$? at_failed=false
37990$at_check_filter
37991at_fn_diff_devnull "$at_stderr" || at_failed=:
37992$at_diff expout "$at_stdout" || at_failed=:
37993at_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
37999fi
38000{ set +x
38001$as_echo "$at_srcdir/actions.at:133: bison -o input.c input.y"
38002at_fn_check_prepare_trace "actions.at:133"
38003( $at_check_trace; bison -o input.c input.y
38004) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38005at_status=$? at_failed=false
38006$at_check_filter
38007at_fn_diff_devnull "$at_stderr" || at_failed=:
38008at_fn_diff_devnull "$at_stdout" || at_failed=:
38009at_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"
38016at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:133"
38017( $at_check_trace; $BISON_C_WORKS
38018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38019at_status=$? at_failed=false
38020$at_check_filter
38021echo stderr:; cat "$at_stderr"
38022echo stdout:; cat "$at_stdout"
38023at_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"
38029at_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>&-
38032at_status=$? at_failed=false
38033$at_check_filter
38034echo stderr:; cat "$at_stderr"
38035echo stdout:; cat "$at_stdout"
38036at_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"
38043at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:133"
38044( $at_check_trace;  $PREPARSER ./input
38045) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38046at_status=$? at_failed=false
38047$at_check_filter
38048echo stderr:; tee stderr <"$at_stderr"
38049at_fn_diff_devnull "$at_stdout" || at_failed=:
38050at_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"
38056at_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>&-
38059at_status=$? at_failed=false
38060$at_check_filter
38061echo >>"$at_stderr"; $as_echo "1.1
380621.1: syntax error
38063" | \
38064  $at_diff - "$at_stderr" || at_failed=:
38065at_fn_diff_devnull "$at_stdout" || at_failed=:
38066at_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
38075read at_status <"$at_status_file"
38076#AT_STOP_145
38077#AT_START_146
38078at_fn_group_banner 146 'actions.at:134' \
38079  "Initial location: yacc.c %define api.pure full" " " 9
38080at_xfail=no
38081(
38082  $as_echo "146. $at_setup_line: testing $at_desc ..."
38083  $at_traceon
38084
38085
38086
38087cat >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 */
38106static void yyerror (YYLTYPE const * const llocp,  const char *msg);
38107static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
38108}
38109%%
38110exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
38111%%
38112#include <stdio.h>
38113/* A C error reporting function.  */
38114static
38115void 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
38122int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
38123{
38124  YYUSE(lvalp);
38125  YYUSE(llocp);
38126  return 'x';
38127}
38128
38129int
38130main (void)
38131{
38132  yydebug = !!getenv("YYDEBUG");
38133  return !!yyparse ();
38134}
38135_ATEOF
38136
38137
38138
38139if 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"
38147at_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>&-
38151at_status=$? at_failed=false
38152$at_check_filter
38153echo stderr:; cat "$at_stderr"
38154echo stdout:; cat "$at_stdout"
38155at_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"
38161at_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>&-
38164at_status=$? at_failed=false
38165$at_check_filter
38166echo stderr:; cat "$at_stderr"
38167echo stdout:; cat "$at_stdout"
38168at_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"
38177at_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>&-
38182at_status=$? at_failed=false
38183$at_check_filter
38184at_fn_diff_devnull "$at_stderr" || at_failed=:
38185$at_diff expout "$at_stdout" || at_failed=:
38186at_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"
38195at_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>&-
38200at_status=$? at_failed=false
38201$at_check_filter
38202at_fn_diff_devnull "$at_stderr" || at_failed=:
38203$at_diff expout "$at_stdout" || at_failed=:
38204at_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
38210fi
38211{ set +x
38212$as_echo "$at_srcdir/actions.at:134: bison -o input.c input.y"
38213at_fn_check_prepare_trace "actions.at:134"
38214( $at_check_trace; bison -o input.c input.y
38215) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38216at_status=$? at_failed=false
38217$at_check_filter
38218at_fn_diff_devnull "$at_stderr" || at_failed=:
38219at_fn_diff_devnull "$at_stdout" || at_failed=:
38220at_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"
38227at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:134"
38228( $at_check_trace; $BISON_C_WORKS
38229) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38230at_status=$? at_failed=false
38231$at_check_filter
38232echo stderr:; cat "$at_stderr"
38233echo stdout:; cat "$at_stdout"
38234at_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"
38240at_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>&-
38243at_status=$? at_failed=false
38244$at_check_filter
38245echo stderr:; cat "$at_stderr"
38246echo stdout:; cat "$at_stdout"
38247at_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"
38254at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:134"
38255( $at_check_trace;  $PREPARSER ./input
38256) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38257at_status=$? at_failed=false
38258$at_check_filter
38259echo stderr:; tee stderr <"$at_stderr"
38260at_fn_diff_devnull "$at_stdout" || at_failed=:
38261at_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"
38267at_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>&-
38270at_status=$? at_failed=false
38271$at_check_filter
38272echo >>"$at_stderr"; $as_echo "1.1
382731.1: syntax error
38274" | \
38275  $at_diff - "$at_stderr" || at_failed=:
38276at_fn_diff_devnull "$at_stdout" || at_failed=:
38277at_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
38286read at_status <"$at_status_file"
38287#AT_STOP_146
38288#AT_START_147
38289at_fn_group_banner 147 'actions.at:135' \
38290  "Initial location: yacc.c %define api.pure %parse-param { int x }" "" 9
38291at_xfail=no
38292(
38293  $as_echo "147. $at_setup_line: testing $at_desc ..."
38294  $at_traceon
38295
38296
38297
38298cat >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 */
38317static void yyerror (YYLTYPE const * const llocp, int x,  const char *msg);
38318static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
38319}
38320%%
38321exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
38322%%
38323#include <stdio.h>
38324/* A C error reporting function.  */
38325static
38326void 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
38334int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
38335{
38336  YYUSE(lvalp);
38337  YYUSE(llocp);
38338  return 'x';
38339}
38340
38341int
38342main (void)
38343{
38344  yydebug = !!getenv("YYDEBUG");
38345  return !!yyparse (0);
38346}
38347_ATEOF
38348
38349
38350
38351if 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"
38359at_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>&-
38363at_status=$? at_failed=false
38364$at_check_filter
38365echo stderr:; cat "$at_stderr"
38366echo stdout:; cat "$at_stdout"
38367at_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"
38373at_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>&-
38376at_status=$? at_failed=false
38377$at_check_filter
38378echo stderr:; cat "$at_stderr"
38379echo stdout:; cat "$at_stdout"
38380at_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"
38389at_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>&-
38394at_status=$? at_failed=false
38395$at_check_filter
38396at_fn_diff_devnull "$at_stderr" || at_failed=:
38397$at_diff expout "$at_stdout" || at_failed=:
38398at_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"
38407at_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>&-
38412at_status=$? at_failed=false
38413$at_check_filter
38414at_fn_diff_devnull "$at_stderr" || at_failed=:
38415$at_diff expout "$at_stdout" || at_failed=:
38416at_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
38422fi
38423{ set +x
38424$as_echo "$at_srcdir/actions.at:135: bison -o input.c input.y"
38425at_fn_check_prepare_trace "actions.at:135"
38426( $at_check_trace; bison -o input.c input.y
38427) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38428at_status=$? at_failed=false
38429$at_check_filter
38430at_fn_diff_devnull "$at_stderr" || at_failed=:
38431at_fn_diff_devnull "$at_stdout" || at_failed=:
38432at_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"
38439at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:135"
38440( $at_check_trace; $BISON_C_WORKS
38441) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38442at_status=$? at_failed=false
38443$at_check_filter
38444echo stderr:; cat "$at_stderr"
38445echo stdout:; cat "$at_stdout"
38446at_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"
38452at_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>&-
38455at_status=$? at_failed=false
38456$at_check_filter
38457echo stderr:; cat "$at_stderr"
38458echo stdout:; cat "$at_stdout"
38459at_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"
38466at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:135"
38467( $at_check_trace;  $PREPARSER ./input
38468) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38469at_status=$? at_failed=false
38470$at_check_filter
38471echo stderr:; tee stderr <"$at_stderr"
38472at_fn_diff_devnull "$at_stdout" || at_failed=:
38473at_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"
38479at_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>&-
38482at_status=$? at_failed=false
38483$at_check_filter
38484echo >>"$at_stderr"; $as_echo "1.1
384851.1: syntax error
38486" | \
38487  $at_diff - "$at_stderr" || at_failed=:
38488at_fn_diff_devnull "$at_stdout" || at_failed=:
38489at_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
38498read at_status <"$at_status_file"
38499#AT_STOP_147
38500#AT_START_148
38501at_fn_group_banner 148 'actions.at:136' \
38502  "Initial location: yacc.c %define api.push-pull both" "" 9
38503at_xfail=no
38504(
38505  $as_echo "148. $at_setup_line: testing $at_desc ..."
38506  $at_traceon
38507
38508
38509
38510cat >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 */
38529static void yyerror ( const char *msg);
38530static int yylex (void);
38531}
38532%%
38533exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
38534%%
38535#include <stdio.h>
38536/* A C error reporting function.  */
38537static
38538void yyerror ( const char *msg)
38539{
38540  YY_LOCATION_PRINT (stderr, (yylloc));
38541  fprintf (stderr, ": ");
38542  fprintf (stderr, "%s\n", msg);
38543}
38544
38545int yylex (void)
38546{
38547  return 'x';
38548}
38549
38550int
38551main (void)
38552{
38553  yydebug = !!getenv("YYDEBUG");
38554  return !!yyparse ();
38555}
38556_ATEOF
38557
38558
38559
38560if 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"
38568at_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>&-
38572at_status=$? at_failed=false
38573$at_check_filter
38574echo stderr:; cat "$at_stderr"
38575echo stdout:; cat "$at_stdout"
38576at_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"
38582at_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>&-
38585at_status=$? at_failed=false
38586$at_check_filter
38587echo stderr:; cat "$at_stderr"
38588echo stdout:; cat "$at_stdout"
38589at_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"
38598at_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>&-
38603at_status=$? at_failed=false
38604$at_check_filter
38605at_fn_diff_devnull "$at_stderr" || at_failed=:
38606$at_diff expout "$at_stdout" || at_failed=:
38607at_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"
38616at_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>&-
38621at_status=$? at_failed=false
38622$at_check_filter
38623at_fn_diff_devnull "$at_stderr" || at_failed=:
38624$at_diff expout "$at_stdout" || at_failed=:
38625at_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
38631fi
38632{ set +x
38633$as_echo "$at_srcdir/actions.at:136: bison -o input.c input.y"
38634at_fn_check_prepare_trace "actions.at:136"
38635( $at_check_trace; bison -o input.c input.y
38636) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38637at_status=$? at_failed=false
38638$at_check_filter
38639at_fn_diff_devnull "$at_stderr" || at_failed=:
38640at_fn_diff_devnull "$at_stdout" || at_failed=:
38641at_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"
38648at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:136"
38649( $at_check_trace; $BISON_C_WORKS
38650) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38651at_status=$? at_failed=false
38652$at_check_filter
38653echo stderr:; cat "$at_stderr"
38654echo stdout:; cat "$at_stdout"
38655at_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"
38661at_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>&-
38664at_status=$? at_failed=false
38665$at_check_filter
38666echo stderr:; cat "$at_stderr"
38667echo stdout:; cat "$at_stdout"
38668at_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"
38675at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:136"
38676( $at_check_trace;  $PREPARSER ./input
38677) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38678at_status=$? at_failed=false
38679$at_check_filter
38680echo stderr:; tee stderr <"$at_stderr"
38681at_fn_diff_devnull "$at_stdout" || at_failed=:
38682at_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"
38688at_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>&-
38691at_status=$? at_failed=false
38692$at_check_filter
38693echo >>"$at_stderr"; $as_echo "1.1
386941.1: syntax error
38695" | \
38696  $at_diff - "$at_stderr" || at_failed=:
38697at_fn_diff_devnull "$at_stdout" || at_failed=:
38698at_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
38707read at_status <"$at_status_file"
38708#AT_STOP_148
38709#AT_START_149
38710at_fn_group_banner 149 'actions.at:137' \
38711  "Initial location: yacc.c %define api.push-pull both %define api.pure full" "" 9
38712at_xfail=no
38713(
38714  $as_echo "149. $at_setup_line: testing $at_desc ..."
38715  $at_traceon
38716
38717
38718
38719cat >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 */
38738static void yyerror (YYLTYPE const * const llocp,  const char *msg);
38739static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
38740}
38741%%
38742exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
38743%%
38744#include <stdio.h>
38745/* A C error reporting function.  */
38746static
38747void 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
38754int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
38755{
38756  YYUSE(lvalp);
38757  YYUSE(llocp);
38758  return 'x';
38759}
38760
38761int
38762main (void)
38763{
38764  yydebug = !!getenv("YYDEBUG");
38765  return !!yyparse ();
38766}
38767_ATEOF
38768
38769
38770
38771if 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"
38779at_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>&-
38783at_status=$? at_failed=false
38784$at_check_filter
38785echo stderr:; cat "$at_stderr"
38786echo stdout:; cat "$at_stdout"
38787at_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"
38793at_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>&-
38796at_status=$? at_failed=false
38797$at_check_filter
38798echo stderr:; cat "$at_stderr"
38799echo stdout:; cat "$at_stdout"
38800at_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"
38809at_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>&-
38814at_status=$? at_failed=false
38815$at_check_filter
38816at_fn_diff_devnull "$at_stderr" || at_failed=:
38817$at_diff expout "$at_stdout" || at_failed=:
38818at_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"
38827at_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>&-
38832at_status=$? at_failed=false
38833$at_check_filter
38834at_fn_diff_devnull "$at_stderr" || at_failed=:
38835$at_diff expout "$at_stdout" || at_failed=:
38836at_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
38842fi
38843{ set +x
38844$as_echo "$at_srcdir/actions.at:137: bison -o input.c input.y"
38845at_fn_check_prepare_trace "actions.at:137"
38846( $at_check_trace; bison -o input.c input.y
38847) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38848at_status=$? at_failed=false
38849$at_check_filter
38850at_fn_diff_devnull "$at_stderr" || at_failed=:
38851at_fn_diff_devnull "$at_stdout" || at_failed=:
38852at_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"
38859at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:137"
38860( $at_check_trace; $BISON_C_WORKS
38861) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38862at_status=$? at_failed=false
38863$at_check_filter
38864echo stderr:; cat "$at_stderr"
38865echo stdout:; cat "$at_stdout"
38866at_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"
38872at_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>&-
38875at_status=$? at_failed=false
38876$at_check_filter
38877echo stderr:; cat "$at_stderr"
38878echo stdout:; cat "$at_stdout"
38879at_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"
38886at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:137"
38887( $at_check_trace;  $PREPARSER ./input
38888) >>"$at_stdout" 2>>"$at_stderr" 5>&-
38889at_status=$? at_failed=false
38890$at_check_filter
38891echo stderr:; tee stderr <"$at_stderr"
38892at_fn_diff_devnull "$at_stdout" || at_failed=:
38893at_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"
38899at_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>&-
38902at_status=$? at_failed=false
38903$at_check_filter
38904echo >>"$at_stderr"; $as_echo "1.1
389051.1: syntax error
38906" | \
38907  $at_diff - "$at_stderr" || at_failed=:
38908at_fn_diff_devnull "$at_stdout" || at_failed=:
38909at_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
38918read at_status <"$at_status_file"
38919#AT_STOP_149
38920#AT_START_150
38921at_fn_group_banner 150 'actions.at:138' \
38922  "Initial location: glr.c " "                       " 9
38923at_xfail=no
38924(
38925  $as_echo "150. $at_setup_line: testing $at_desc ..."
38926  $at_traceon
38927
38928
38929
38930cat >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 */
38949static void yyerror ( const char *msg);
38950static int yylex (void);
38951}
38952%%
38953exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
38954%%
38955#include <stdio.h>
38956/* A C error reporting function.  */
38957static
38958void yyerror ( const char *msg)
38959{
38960  YY_LOCATION_PRINT (stderr, (yylloc));
38961  fprintf (stderr, ": ");
38962  fprintf (stderr, "%s\n", msg);
38963}
38964
38965int yylex (void)
38966{
38967  return 'x';
38968}
38969
38970int
38971main (void)
38972{
38973  yydebug = !!getenv("YYDEBUG");
38974  return !!yyparse ();
38975}
38976_ATEOF
38977
38978
38979
38980if 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"
38988at_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>&-
38992at_status=$? at_failed=false
38993$at_check_filter
38994echo stderr:; cat "$at_stderr"
38995echo stdout:; cat "$at_stdout"
38996at_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"
39002at_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>&-
39005at_status=$? at_failed=false
39006$at_check_filter
39007echo stderr:; cat "$at_stderr"
39008echo stdout:; cat "$at_stdout"
39009at_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"
39018at_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>&-
39023at_status=$? at_failed=false
39024$at_check_filter
39025at_fn_diff_devnull "$at_stderr" || at_failed=:
39026$at_diff expout "$at_stdout" || at_failed=:
39027at_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"
39036at_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>&-
39041at_status=$? at_failed=false
39042$at_check_filter
39043at_fn_diff_devnull "$at_stderr" || at_failed=:
39044$at_diff expout "$at_stdout" || at_failed=:
39045at_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
39051fi
39052{ set +x
39053$as_echo "$at_srcdir/actions.at:138: bison -o input.c input.y"
39054at_fn_check_prepare_trace "actions.at:138"
39055( $at_check_trace; bison -o input.c input.y
39056) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39057at_status=$? at_failed=false
39058$at_check_filter
39059at_fn_diff_devnull "$at_stderr" || at_failed=:
39060at_fn_diff_devnull "$at_stdout" || at_failed=:
39061at_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"
39068at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:138"
39069( $at_check_trace; $BISON_C_WORKS
39070) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39071at_status=$? at_failed=false
39072$at_check_filter
39073echo stderr:; cat "$at_stderr"
39074echo stdout:; cat "$at_stdout"
39075at_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"
39081at_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>&-
39084at_status=$? at_failed=false
39085$at_check_filter
39086echo stderr:; cat "$at_stderr"
39087echo stdout:; cat "$at_stdout"
39088at_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"
39095at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:138"
39096( $at_check_trace;  $PREPARSER ./input
39097) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39098at_status=$? at_failed=false
39099$at_check_filter
39100echo stderr:; tee stderr <"$at_stderr"
39101at_fn_diff_devnull "$at_stdout" || at_failed=:
39102at_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"
39108at_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>&-
39111at_status=$? at_failed=false
39112$at_check_filter
39113echo >>"$at_stderr"; $as_echo "1.1
391141.1: syntax error
39115" | \
39116  $at_diff - "$at_stderr" || at_failed=:
39117at_fn_diff_devnull "$at_stdout" || at_failed=:
39118at_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
39127read at_status <"$at_status_file"
39128#AT_STOP_150
39129#AT_START_151
39130at_fn_group_banner 151 'actions.at:139' \
39131  "Initial location: glr.c %define api.pure" "       " 9
39132at_xfail=no
39133(
39134  $as_echo "151. $at_setup_line: testing $at_desc ..."
39135  $at_traceon
39136
39137
39138
39139cat >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 */
39158static void yyerror (YYLTYPE const * const llocp,  const char *msg);
39159static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
39160}
39161%%
39162exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
39163%%
39164#include <stdio.h>
39165/* A C error reporting function.  */
39166static
39167void 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
39174int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
39175{
39176  YYUSE(lvalp);
39177  YYUSE(llocp);
39178  return 'x';
39179}
39180
39181int
39182main (void)
39183{
39184  yydebug = !!getenv("YYDEBUG");
39185  return !!yyparse ();
39186}
39187_ATEOF
39188
39189
39190
39191if 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"
39199at_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>&-
39203at_status=$? at_failed=false
39204$at_check_filter
39205echo stderr:; cat "$at_stderr"
39206echo stdout:; cat "$at_stdout"
39207at_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"
39213at_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>&-
39216at_status=$? at_failed=false
39217$at_check_filter
39218echo stderr:; cat "$at_stderr"
39219echo stdout:; cat "$at_stdout"
39220at_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"
39229at_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>&-
39234at_status=$? at_failed=false
39235$at_check_filter
39236at_fn_diff_devnull "$at_stderr" || at_failed=:
39237$at_diff expout "$at_stdout" || at_failed=:
39238at_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"
39247at_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>&-
39252at_status=$? at_failed=false
39253$at_check_filter
39254at_fn_diff_devnull "$at_stderr" || at_failed=:
39255$at_diff expout "$at_stdout" || at_failed=:
39256at_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
39262fi
39263{ set +x
39264$as_echo "$at_srcdir/actions.at:139: bison -o input.c input.y"
39265at_fn_check_prepare_trace "actions.at:139"
39266( $at_check_trace; bison -o input.c input.y
39267) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39268at_status=$? at_failed=false
39269$at_check_filter
39270at_fn_diff_devnull "$at_stderr" || at_failed=:
39271at_fn_diff_devnull "$at_stdout" || at_failed=:
39272at_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"
39279at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:139"
39280( $at_check_trace; $BISON_C_WORKS
39281) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39282at_status=$? at_failed=false
39283$at_check_filter
39284echo stderr:; cat "$at_stderr"
39285echo stdout:; cat "$at_stdout"
39286at_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"
39292at_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>&-
39295at_status=$? at_failed=false
39296$at_check_filter
39297echo stderr:; cat "$at_stderr"
39298echo stdout:; cat "$at_stdout"
39299at_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"
39306at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:139"
39307( $at_check_trace;  $PREPARSER ./input
39308) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39309at_status=$? at_failed=false
39310$at_check_filter
39311echo stderr:; tee stderr <"$at_stderr"
39312at_fn_diff_devnull "$at_stdout" || at_failed=:
39313at_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"
39319at_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>&-
39322at_status=$? at_failed=false
39323$at_check_filter
39324echo >>"$at_stderr"; $as_echo "1.1
393251.1: syntax error
39326" | \
39327  $at_diff - "$at_stderr" || at_failed=:
39328at_fn_diff_devnull "$at_stdout" || at_failed=:
39329at_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
39338read at_status <"$at_status_file"
39339#AT_STOP_151
39340#AT_START_152
39341at_fn_group_banner 152 'actions.at:140' \
39342  "Initial location: lalr1.cc " "                    " 9
39343at_xfail=no
39344(
39345  $as_echo "152. $at_setup_line: testing $at_desc ..."
39346  $at_traceon
39347
39348
39349
39350cat >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
39370static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
39371}
39372%%
39373exp: { std::cerr << @$ << std::endl; }
39374%%
39375/* A C++ error reporting function.  */
39376void
39377yy::parser::error (const location_type& l, const std::string& m)
39378{
39379  (void) l;
39380  std::cerr << l << ": " << m << std::endl;
39381}
39382
39383int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
39384{
39385  YYUSE(lvalp);
39386  YYUSE(llocp);
39387  return 'x';
39388}
39389
39390int
39391main (void)
39392{
39393  yy::parser p;
39394  p.set_debug_level (!!getenv("YYDEBUG"));
39395  return p.parse ();
39396}
39397_ATEOF
39398
39399
39400
39401if 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"
39409at_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>&-
39413at_status=$? at_failed=false
39414$at_check_filter
39415echo stderr:; cat "$at_stderr"
39416echo stdout:; cat "$at_stdout"
39417at_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"
39423at_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>&-
39426at_status=$? at_failed=false
39427$at_check_filter
39428echo stderr:; cat "$at_stderr"
39429echo stdout:; cat "$at_stdout"
39430at_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"
39439at_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>&-
39444at_status=$? at_failed=false
39445$at_check_filter
39446at_fn_diff_devnull "$at_stderr" || at_failed=:
39447$at_diff expout "$at_stdout" || at_failed=:
39448at_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"
39457at_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>&-
39462at_status=$? at_failed=false
39463$at_check_filter
39464at_fn_diff_devnull "$at_stderr" || at_failed=:
39465$at_diff expout "$at_stdout" || at_failed=:
39466at_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
39472fi
39473{ set +x
39474$as_echo "$at_srcdir/actions.at:140: bison -o input.cc input.y"
39475at_fn_check_prepare_trace "actions.at:140"
39476( $at_check_trace; bison -o input.cc input.y
39477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39478at_status=$? at_failed=false
39479$at_check_filter
39480at_fn_diff_devnull "$at_stderr" || at_failed=:
39481at_fn_diff_devnull "$at_stdout" || at_failed=:
39482at_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"
39490at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:140"
39491( $at_check_trace; $BISON_CXX_WORKS
39492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39493at_status=$? at_failed=false
39494$at_check_filter
39495echo stderr:; cat "$at_stderr"
39496echo stdout:; cat "$at_stdout"
39497at_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"
39503at_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>&-
39506at_status=$? at_failed=false
39507$at_check_filter
39508echo stderr:; cat "$at_stderr"
39509echo stdout:; cat "$at_stdout"
39510at_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"
39517at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:140"
39518( $at_check_trace;  $PREPARSER ./input
39519) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39520at_status=$? at_failed=false
39521$at_check_filter
39522echo stderr:; tee stderr <"$at_stderr"
39523at_fn_diff_devnull "$at_stdout" || at_failed=:
39524at_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"
39530at_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>&-
39533at_status=$? at_failed=false
39534$at_check_filter
39535echo >>"$at_stderr"; $as_echo "1.1
395361.1: syntax error
39537" | \
39538  $at_diff - "$at_stderr" || at_failed=:
39539at_fn_diff_devnull "$at_stdout" || at_failed=:
39540at_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
39549read at_status <"$at_status_file"
39550#AT_STOP_152
39551#AT_START_153
39552at_fn_group_banner 153 'actions.at:141' \
39553  "Initial location: glr.cc " "                      " 9
39554at_xfail=no
39555(
39556  $as_echo "153. $at_setup_line: testing $at_desc ..."
39557  $at_traceon
39558
39559
39560
39561cat >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
39581static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
39582}
39583%%
39584exp: { std::cerr << @$ << std::endl; }
39585%%
39586/* A C++ error reporting function.  */
39587void
39588yy::parser::error (const location_type& l, const std::string& m)
39589{
39590  (void) l;
39591  std::cerr << l << ": " << m << std::endl;
39592}
39593
39594int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
39595{
39596  YYUSE(lvalp);
39597  YYUSE(llocp);
39598  return 'x';
39599}
39600
39601int
39602main (void)
39603{
39604  yy::parser p;
39605  p.set_debug_level (!!getenv("YYDEBUG"));
39606  return p.parse ();
39607}
39608_ATEOF
39609
39610
39611
39612if 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"
39620at_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>&-
39624at_status=$? at_failed=false
39625$at_check_filter
39626echo stderr:; cat "$at_stderr"
39627echo stdout:; cat "$at_stdout"
39628at_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"
39634at_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>&-
39637at_status=$? at_failed=false
39638$at_check_filter
39639echo stderr:; cat "$at_stderr"
39640echo stdout:; cat "$at_stdout"
39641at_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"
39650at_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>&-
39655at_status=$? at_failed=false
39656$at_check_filter
39657at_fn_diff_devnull "$at_stderr" || at_failed=:
39658$at_diff expout "$at_stdout" || at_failed=:
39659at_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"
39668at_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>&-
39673at_status=$? at_failed=false
39674$at_check_filter
39675at_fn_diff_devnull "$at_stderr" || at_failed=:
39676$at_diff expout "$at_stdout" || at_failed=:
39677at_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
39683fi
39684{ set +x
39685$as_echo "$at_srcdir/actions.at:141: bison -o input.cc input.y"
39686at_fn_check_prepare_trace "actions.at:141"
39687( $at_check_trace; bison -o input.cc input.y
39688) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39689at_status=$? at_failed=false
39690$at_check_filter
39691at_fn_diff_devnull "$at_stderr" || at_failed=:
39692at_fn_diff_devnull "$at_stdout" || at_failed=:
39693at_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"
39701at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:141"
39702( $at_check_trace; $BISON_CXX_WORKS
39703) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39704at_status=$? at_failed=false
39705$at_check_filter
39706echo stderr:; cat "$at_stderr"
39707echo stdout:; cat "$at_stdout"
39708at_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"
39714at_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>&-
39717at_status=$? at_failed=false
39718$at_check_filter
39719echo stderr:; cat "$at_stderr"
39720echo stdout:; cat "$at_stdout"
39721at_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"
39728at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:141"
39729( $at_check_trace;  $PREPARSER ./input
39730) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39731at_status=$? at_failed=false
39732$at_check_filter
39733echo stderr:; tee stderr <"$at_stderr"
39734at_fn_diff_devnull "$at_stdout" || at_failed=:
39735at_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"
39741at_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>&-
39744at_status=$? at_failed=false
39745$at_check_filter
39746echo >>"$at_stderr"; $as_echo "1.1
397471.1: syntax error
39748" | \
39749  $at_diff - "$at_stderr" || at_failed=:
39750at_fn_diff_devnull "$at_stdout" || at_failed=:
39751at_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
39760read at_status <"$at_status_file"
39761#AT_STOP_153
39762#AT_START_154
39763at_fn_group_banner 154 'actions.at:150' \
39764  "Initial location: yacc.c %define api.pure full" " " 9
39765at_xfail=no
39766(
39767  $as_echo "154. $at_setup_line: testing $at_desc ..."
39768  $at_traceon
39769
39770
39771
39772cat >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 */
39798static void yyerror (YYLTYPE const * const llocp,  const char *msg);
39799static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
39800}
39801%%
39802exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
39803%%
39804#include <stdio.h>
39805/* A C error reporting function.  */
39806static
39807void 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
39814int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
39815{
39816  YYUSE(lvalp);
39817  YYUSE(llocp);
39818  return 'x';
39819}
39820
39821int
39822main (void)
39823{
39824  yydebug = !!getenv("YYDEBUG");
39825  return !!yyparse ();
39826}
39827_ATEOF
39828
39829
39830
39831if 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"
39839at_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>&-
39843at_status=$? at_failed=false
39844$at_check_filter
39845echo stderr:; cat "$at_stderr"
39846echo stdout:; cat "$at_stdout"
39847at_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"
39853at_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>&-
39856at_status=$? at_failed=false
39857$at_check_filter
39858echo stderr:; cat "$at_stderr"
39859echo stdout:; cat "$at_stdout"
39860at_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"
39869at_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>&-
39874at_status=$? at_failed=false
39875$at_check_filter
39876at_fn_diff_devnull "$at_stderr" || at_failed=:
39877$at_diff expout "$at_stdout" || at_failed=:
39878at_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"
39887at_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>&-
39892at_status=$? at_failed=false
39893$at_check_filter
39894at_fn_diff_devnull "$at_stderr" || at_failed=:
39895$at_diff expout "$at_stdout" || at_failed=:
39896at_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
39902fi
39903{ set +x
39904$as_echo "$at_srcdir/actions.at:150: bison -o input.c input.y"
39905at_fn_check_prepare_trace "actions.at:150"
39906( $at_check_trace; bison -o input.c input.y
39907) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39908at_status=$? at_failed=false
39909$at_check_filter
39910at_fn_diff_devnull "$at_stderr" || at_failed=:
39911at_fn_diff_devnull "$at_stdout" || at_failed=:
39912at_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"
39919at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:150"
39920( $at_check_trace; $BISON_C_WORKS
39921) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39922at_status=$? at_failed=false
39923$at_check_filter
39924echo stderr:; cat "$at_stderr"
39925echo stdout:; cat "$at_stdout"
39926at_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"
39932at_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>&-
39935at_status=$? at_failed=false
39936$at_check_filter
39937echo stderr:; cat "$at_stderr"
39938echo stdout:; cat "$at_stdout"
39939at_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"
39946at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:150"
39947( $at_check_trace;  $PREPARSER ./input
39948) >>"$at_stdout" 2>>"$at_stderr" 5>&-
39949at_status=$? at_failed=false
39950$at_check_filter
39951echo stderr:; tee stderr <"$at_stderr"
39952at_fn_diff_devnull "$at_stdout" || at_failed=:
39953at_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"
39959at_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>&-
39962at_status=$? at_failed=false
39963$at_check_filter
39964echo >>"$at_stderr"; $as_echo "
39965: syntax error
39966" | \
39967  $at_diff - "$at_stderr" || at_failed=:
39968at_fn_diff_devnull "$at_stdout" || at_failed=:
39969at_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
39978read at_status <"$at_status_file"
39979#AT_STOP_154
39980#AT_START_155
39981at_fn_group_banner 155 'actions.at:161' \
39982  "Initial location: yacc.c %define api.pure full" " " 9
39983at_xfail=no
39984(
39985  $as_echo "155. $at_setup_line: testing $at_desc ..."
39986  $at_traceon
39987
39988
39989
39990cat >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 */
40016static void yyerror (YYLTYPE const * const llocp,  const char *msg);
40017static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
40018}
40019%%
40020exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
40021%%
40022#include <stdio.h>
40023/* A C error reporting function.  */
40024static
40025void 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
40032int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
40033{
40034  YYUSE(lvalp);
40035  YYUSE(llocp);
40036  return 'x';
40037}
40038
40039int
40040main (void)
40041{
40042  yydebug = !!getenv("YYDEBUG");
40043  return !!yyparse ();
40044}
40045_ATEOF
40046
40047
40048
40049if 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"
40057at_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>&-
40061at_status=$? at_failed=false
40062$at_check_filter
40063echo stderr:; cat "$at_stderr"
40064echo stdout:; cat "$at_stdout"
40065at_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"
40071at_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>&-
40074at_status=$? at_failed=false
40075$at_check_filter
40076echo stderr:; cat "$at_stderr"
40077echo stdout:; cat "$at_stdout"
40078at_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"
40087at_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>&-
40092at_status=$? at_failed=false
40093$at_check_filter
40094at_fn_diff_devnull "$at_stderr" || at_failed=:
40095$at_diff expout "$at_stdout" || at_failed=:
40096at_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"
40105at_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>&-
40110at_status=$? at_failed=false
40111$at_check_filter
40112at_fn_diff_devnull "$at_stderr" || at_failed=:
40113$at_diff expout "$at_stdout" || at_failed=:
40114at_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
40120fi
40121{ set +x
40122$as_echo "$at_srcdir/actions.at:161: bison -o input.c input.y"
40123at_fn_check_prepare_trace "actions.at:161"
40124( $at_check_trace; bison -o input.c input.y
40125) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40126at_status=$? at_failed=false
40127$at_check_filter
40128at_fn_diff_devnull "$at_stderr" || at_failed=:
40129at_fn_diff_devnull "$at_stdout" || at_failed=:
40130at_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"
40137at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:161"
40138( $at_check_trace; $BISON_C_WORKS
40139) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40140at_status=$? at_failed=false
40141$at_check_filter
40142echo stderr:; cat "$at_stderr"
40143echo stdout:; cat "$at_stdout"
40144at_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"
40150at_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>&-
40153at_status=$? at_failed=false
40154$at_check_filter
40155echo stderr:; cat "$at_stderr"
40156echo stdout:; cat "$at_stdout"
40157at_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"
40164at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:161"
40165( $at_check_trace;  $PREPARSER ./input
40166) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40167at_status=$? at_failed=false
40168$at_check_filter
40169echo stderr:; tee stderr <"$at_stderr"
40170at_fn_diff_devnull "$at_stdout" || at_failed=:
40171at_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"
40177at_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>&-
40180at_status=$? at_failed=false
40181$at_check_filter
40182echo >>"$at_stderr"; $as_echo "0
401830: syntax error
40184" | \
40185  $at_diff - "$at_stderr" || at_failed=:
40186at_fn_diff_devnull "$at_stdout" || at_failed=:
40187at_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
40196read at_status <"$at_status_file"
40197#AT_STOP_155
40198#AT_START_156
40199at_fn_group_banner 156 'actions.at:244' \
40200  "Location print: yacc.c " "                        " 9
40201at_xfail=no
40202(
40203  $as_echo "156. $at_setup_line: testing $at_desc ..."
40204  $at_traceon
40205
40206
40207
40208cat >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 */
40227static void yyerror ( const char *msg);
40228static int yylex (void);
40229}
40230%%
40231exp:;
40232%%
40233#include <stdio.h>
40234/* A C error reporting function.  */
40235static
40236void 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>
40243static
40244int 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
40258int
40259main (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
40282if 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"
40290at_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>&-
40294at_status=$? at_failed=false
40295$at_check_filter
40296echo stderr:; cat "$at_stderr"
40297echo stdout:; cat "$at_stdout"
40298at_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"
40304at_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>&-
40307at_status=$? at_failed=false
40308$at_check_filter
40309echo stderr:; cat "$at_stderr"
40310echo stdout:; cat "$at_stdout"
40311at_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"
40320at_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>&-
40325at_status=$? at_failed=false
40326$at_check_filter
40327at_fn_diff_devnull "$at_stderr" || at_failed=:
40328$at_diff expout "$at_stdout" || at_failed=:
40329at_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"
40338at_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>&-
40343at_status=$? at_failed=false
40344$at_check_filter
40345at_fn_diff_devnull "$at_stderr" || at_failed=:
40346$at_diff expout "$at_stdout" || at_failed=:
40347at_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
40353fi
40354{ set +x
40355$as_echo "$at_srcdir/actions.at:244: bison -o input.c input.y"
40356at_fn_check_prepare_trace "actions.at:244"
40357( $at_check_trace; bison -o input.c input.y
40358) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40359at_status=$? at_failed=false
40360$at_check_filter
40361at_fn_diff_devnull "$at_stderr" || at_failed=:
40362at_fn_diff_devnull "$at_stdout" || at_failed=:
40363at_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"
40370at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:244"
40371( $at_check_trace; $BISON_C_WORKS
40372) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40373at_status=$? at_failed=false
40374$at_check_filter
40375echo stderr:; cat "$at_stderr"
40376echo stdout:; cat "$at_stdout"
40377at_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"
40383at_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>&-
40386at_status=$? at_failed=false
40387$at_check_filter
40388echo stderr:; cat "$at_stderr"
40389echo stdout:; cat "$at_stdout"
40390at_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"
40397at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:244"
40398( $at_check_trace;  $PREPARSER ./input
40399) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40400at_status=$? at_failed=false
40401$at_check_filter
40402echo stderr:; tee stderr <"$at_stderr"
40403echo >>"$at_stdout"; $as_echo "1.1
404042.1-9
404053.1-4.0
404065.1-6.9
404077.2
404088.0
40409" | \
40410  $at_diff - "$at_stdout" || at_failed=:
40411at_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"
40417at_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>&-
40420at_status=$? at_failed=false
40421$at_check_filter
40422at_fn_diff_devnull "$at_stderr" || at_failed=:
40423at_fn_diff_devnull "$at_stdout" || at_failed=:
40424at_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
40433read at_status <"$at_status_file"
40434#AT_STOP_156
40435#AT_START_157
40436at_fn_group_banner 157 'actions.at:245' \
40437  "Location print: glr.c " "                         " 9
40438at_xfail=no
40439(
40440  $as_echo "157. $at_setup_line: testing $at_desc ..."
40441  $at_traceon
40442
40443
40444
40445cat >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 */
40464static void yyerror ( const char *msg);
40465static int yylex (void);
40466}
40467%%
40468exp:;
40469%%
40470#include <stdio.h>
40471/* A C error reporting function.  */
40472static
40473void 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>
40480static
40481int 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
40495int
40496main (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
40519if 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"
40527at_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>&-
40531at_status=$? at_failed=false
40532$at_check_filter
40533echo stderr:; cat "$at_stderr"
40534echo stdout:; cat "$at_stdout"
40535at_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"
40541at_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>&-
40544at_status=$? at_failed=false
40545$at_check_filter
40546echo stderr:; cat "$at_stderr"
40547echo stdout:; cat "$at_stdout"
40548at_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"
40557at_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>&-
40562at_status=$? at_failed=false
40563$at_check_filter
40564at_fn_diff_devnull "$at_stderr" || at_failed=:
40565$at_diff expout "$at_stdout" || at_failed=:
40566at_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"
40575at_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>&-
40580at_status=$? at_failed=false
40581$at_check_filter
40582at_fn_diff_devnull "$at_stderr" || at_failed=:
40583$at_diff expout "$at_stdout" || at_failed=:
40584at_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
40590fi
40591{ set +x
40592$as_echo "$at_srcdir/actions.at:245: bison -o input.c input.y"
40593at_fn_check_prepare_trace "actions.at:245"
40594( $at_check_trace; bison -o input.c input.y
40595) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40596at_status=$? at_failed=false
40597$at_check_filter
40598at_fn_diff_devnull "$at_stderr" || at_failed=:
40599at_fn_diff_devnull "$at_stdout" || at_failed=:
40600at_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"
40607at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:245"
40608( $at_check_trace; $BISON_C_WORKS
40609) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40610at_status=$? at_failed=false
40611$at_check_filter
40612echo stderr:; cat "$at_stderr"
40613echo stdout:; cat "$at_stdout"
40614at_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"
40620at_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>&-
40623at_status=$? at_failed=false
40624$at_check_filter
40625echo stderr:; cat "$at_stderr"
40626echo stdout:; cat "$at_stdout"
40627at_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"
40634at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:245"
40635( $at_check_trace;  $PREPARSER ./input
40636) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40637at_status=$? at_failed=false
40638$at_check_filter
40639echo stderr:; tee stderr <"$at_stderr"
40640echo >>"$at_stdout"; $as_echo "1.1
406412.1-9
406423.1-4.0
406435.1-6.9
406447.2
406458.0
40646" | \
40647  $at_diff - "$at_stdout" || at_failed=:
40648at_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"
40654at_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>&-
40657at_status=$? at_failed=false
40658$at_check_filter
40659at_fn_diff_devnull "$at_stderr" || at_failed=:
40660at_fn_diff_devnull "$at_stdout" || at_failed=:
40661at_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
40670read at_status <"$at_status_file"
40671#AT_STOP_157
40672#AT_START_158
40673at_fn_group_banner 158 'actions.at:257' \
40674  "Exotic Dollars" "                                 " 9
40675at_xfail=no
40676(
40677  $as_echo "158. $at_setup_line: testing $at_desc ..."
40678  $at_traceon
40679
40680
40681
40682cat >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%{
40694static void yyerror ( const char *msg);
40695static 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%%
40708exp: 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;
40715a_1: { $$ = 1; };
40716a_2: { $$ = 2; };
40717a_5: { $$ = 5; };
40718
40719sum_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.  */
40728static
40729void yyerror ( const char *msg)
40730{
40731  fprintf (stderr, "%s\n", msg);
40732}
40733#include <assert.h>
40734static
40735int 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}
40746int
40747main (void)
40748{
40749  return yyparse ();
40750}
40751_ATEOF
40752
40753
40754
40755if 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"
40763at_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>&-
40767at_status=$? at_failed=false
40768$at_check_filter
40769echo stderr:; cat "$at_stderr"
40770echo stdout:; cat "$at_stdout"
40771at_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"
40777at_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>&-
40780at_status=$? at_failed=false
40781$at_check_filter
40782echo stderr:; cat "$at_stderr"
40783echo stdout:; cat "$at_stdout"
40784at_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"
40793at_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>&-
40798at_status=$? at_failed=false
40799$at_check_filter
40800at_fn_diff_devnull "$at_stderr" || at_failed=:
40801$at_diff expout "$at_stdout" || at_failed=:
40802at_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"
40811at_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>&-
40816at_status=$? at_failed=false
40817$at_check_filter
40818at_fn_diff_devnull "$at_stderr" || at_failed=:
40819$at_diff expout "$at_stdout" || at_failed=:
40820at_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
40826fi
40827{ set +x
40828$as_echo "$at_srcdir/actions.at:305: bison -d -v -o input.c input.y"
40829at_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>&-
40832at_status=$? at_failed=false
40833$at_check_filter
40834at_fn_diff_devnull "$at_stderr" || at_failed=:
40835at_fn_diff_devnull "$at_stdout" || at_failed=:
40836at_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"
40843at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:306"
40844( $at_check_trace; $BISON_C_WORKS
40845) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40846at_status=$? at_failed=false
40847$at_check_filter
40848echo stderr:; cat "$at_stderr"
40849echo stdout:; cat "$at_stdout"
40850at_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"
40856at_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>&-
40859at_status=$? at_failed=false
40860$at_check_filter
40861echo stderr:; cat "$at_stderr"
40862echo stdout:; cat "$at_stdout"
40863at_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"
40869at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:307"
40870( $at_check_trace;  $PREPARSER ./input
40871) >>"$at_stdout" 2>>"$at_stderr" 5>&-
40872at_status=$? at_failed=false
40873$at_check_filter
40874echo stderr:; tee stderr <"$at_stderr"
40875echo >>"$at_stdout"; $as_echo "15
40876" | \
40877  $at_diff - "$at_stdout" || at_failed=:
40878at_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"
40884at_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>&-
40887at_status=$? at_failed=false
40888$at_check_filter
40889at_fn_diff_devnull "$at_stderr" || at_failed=:
40890at_fn_diff_devnull "$at_stdout" || at_failed=:
40891at_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.
40900cat >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>
40912static void yyerror ( const char *msg);
40913static int yylex (void);
40914  typedef struct { int val; } stype;
40915# define YYSTYPE stype
40916%}
40917
40918%%
40919start: one two { $$.val = $1.val + $2.val; } sum ;
40920one: { $$.val = 1; } ;
40921two: { $$.val = 2; } ;
40922sum: { printf ("%d\n", $0.val + $-1.val + $-2.val); } ;
40923
40924%%
40925#include <stdio.h>
40926/* A C error reporting function.  */
40927static
40928void yyerror ( const char *msg)
40929{
40930  fprintf (stderr, "%s\n", msg);
40931}
40932#include <assert.h>
40933static
40934int 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}
40945int
40946main (void)
40947{
40948  return yyparse ();
40949}
40950_ATEOF
40951
40952
40953
40954if 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"
40962at_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>&-
40966at_status=$? at_failed=false
40967$at_check_filter
40968echo stderr:; cat "$at_stderr"
40969echo stdout:; cat "$at_stdout"
40970at_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"
40976at_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>&-
40979at_status=$? at_failed=false
40980$at_check_filter
40981echo stderr:; cat "$at_stderr"
40982echo stdout:; cat "$at_stdout"
40983at_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"
40992at_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>&-
40997at_status=$? at_failed=false
40998$at_check_filter
40999at_fn_diff_devnull "$at_stderr" || at_failed=:
41000$at_diff expout "$at_stdout" || at_failed=:
41001at_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"
41010at_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>&-
41015at_status=$? at_failed=false
41016$at_check_filter
41017at_fn_diff_devnull "$at_stderr" || at_failed=:
41018$at_diff expout "$at_stdout" || at_failed=:
41019at_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
41025fi
41026{ set +x
41027$as_echo "$at_srcdir/actions.at:340: bison -o input.c input.y"
41028at_fn_check_prepare_trace "actions.at:340"
41029( $at_check_trace; bison -o input.c input.y
41030) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41031at_status=$? at_failed=false
41032$at_check_filter
41033at_fn_diff_devnull "$at_stderr" || at_failed=:
41034at_fn_diff_devnull "$at_stdout" || at_failed=:
41035at_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"
41042at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:340"
41043( $at_check_trace; $BISON_C_WORKS
41044) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41045at_status=$? at_failed=false
41046$at_check_filter
41047echo stderr:; cat "$at_stderr"
41048echo stdout:; cat "$at_stdout"
41049at_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"
41055at_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>&-
41058at_status=$? at_failed=false
41059$at_check_filter
41060echo stderr:; cat "$at_stderr"
41061echo stdout:; cat "$at_stdout"
41062at_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"
41069at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:341"
41070( $at_check_trace;  $PREPARSER ./input
41071) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41072at_status=$? at_failed=false
41073$at_check_filter
41074echo stderr:; tee stderr <"$at_stderr"
41075echo >>"$at_stdout"; $as_echo "6
41076" | \
41077  $at_diff - "$at_stdout" || at_failed=:
41078at_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"
41084at_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>&-
41087at_status=$? at_failed=false
41088$at_check_filter
41089at_fn_diff_devnull "$at_stderr" || at_failed=:
41090at_fn_diff_devnull "$at_stdout" || at_failed=:
41091at_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
41101read at_status <"$at_status_file"
41102#AT_STOP_158
41103#AT_START_159
41104at_fn_group_banner 159 'actions.at:751' \
41105  "Printers and Destructors" "                       " 9
41106at_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
41118cat >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
41151static int yylex (void);
41152static 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
41197input:
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
41213line:
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
41250thing:
41251  'x'
41252    {
41253      $$ = $1;
41254      V(thing, $$, @$, ": ");
41255      V('x',   $1, @1, "\n");
41256    }
41257;
41258%%
41259/* Alias to ARGV[1]. */
41260const char *source = YY_NULL;
41261
41262#include <stdio.h>
41263/* A C error reporting function.  */
41264static
41265void yyerror ( const char *msg)
41266{
41267  YY_LOCATION_PRINT (stderr, (yylloc));
41268  fprintf (stderr, ": ");
41269  fprintf (stderr, "%s\n", msg);
41270}
41271
41272static
41273int 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
41291int
41292main (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
41311if 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"
41319at_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>&-
41323at_status=$? at_failed=false
41324$at_check_filter
41325echo stderr:; cat "$at_stderr"
41326echo stdout:; cat "$at_stdout"
41327at_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"
41333at_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>&-
41336at_status=$? at_failed=false
41337$at_check_filter
41338echo stderr:; cat "$at_stderr"
41339echo stdout:; cat "$at_stdout"
41340at_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"
41349at_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>&-
41354at_status=$? at_failed=false
41355$at_check_filter
41356at_fn_diff_devnull "$at_stderr" || at_failed=:
41357$at_diff expout "$at_stdout" || at_failed=:
41358at_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"
41367at_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>&-
41372at_status=$? at_failed=false
41373$at_check_filter
41374at_fn_diff_devnull "$at_stderr" || at_failed=:
41375$at_diff expout "$at_stdout" || at_failed=:
41376at_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
41382fi
41383{ set +x
41384$as_echo "$at_srcdir/actions.at:751: bison -o input.c input.y"
41385at_fn_check_prepare_trace "actions.at:751"
41386( $at_check_trace; bison -o input.c input.y
41387) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41388at_status=$? at_failed=false
41389$at_check_filter
41390at_fn_diff_devnull "$at_stderr" || at_failed=:
41391at_fn_diff_devnull "$at_stdout" || at_failed=:
41392at_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"
41399at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:751"
41400( $at_check_trace; $BISON_C_WORKS
41401) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41402at_status=$? at_failed=false
41403$at_check_filter
41404echo stderr:; cat "$at_stderr"
41405echo stdout:; cat "$at_stdout"
41406at_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"
41412at_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>&-
41415at_status=$? at_failed=false
41416$at_check_filter
41417echo stderr:; cat "$at_stderr"
41418echo stdout:; cat "$at_stdout"
41419at_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)'"
41433at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:751"
41434( $at_check_trace;  $PREPARSER ./input '(x)'
41435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41436at_status=$? at_failed=false
41437$at_check_filter
41438echo stderr:; tee stderr <"$at_stderr"
41439at_fn_diff_devnull "$at_stdout" || at_failed=:
41440at_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"
41446at_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>&-
41449at_status=$? at_failed=false
41450$at_check_filter
41451echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
41452sending: 'x' (1@10-19)
41453thing (1@10-19): 'x' (1@10-19)
41454sending: ')' (2@20-29)
41455line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
41456sending: END (3@30-39)
41457input (0@29-29): /* Nothing */
41458input (2@0-29): line (0@0-29) input (0@29-29)
41459Freeing token END (3@30-39)
41460Freeing nterm input (2@0-29)
41461Successful parse.
41462" | \
41463  $at_diff - "$at_stderr" || at_failed=:
41464at_fn_diff_devnull "$at_stdout" || at_failed=:
41465at_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)'"
41478at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:751"
41479( $at_check_trace;  $PREPARSER ./input '(y)'
41480) >>"$at_stdout" 2>>"$at_stderr" 5>&-
41481at_status=$? at_failed=false
41482$at_check_filter
41483echo stderr:; tee stderr <"$at_stderr"
41484at_fn_diff_devnull "$at_stdout" || at_failed=:
41485at_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"
41491at_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>&-
41494at_status=$? at_failed=false
41495$at_check_filter
41496echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
41497sending: 'y' (1@10-19)
4149810.10-19.18: syntax error, unexpected 'y', expecting 'x'
41499Freeing token 'y' (1@10-19)
41500sending: ')' (2@20-29)
41501line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
41502sending: END (3@30-39)
41503input (0@29-29): /* Nothing */
41504input (2@0-29): line (-1@0-29) input (0@29-29)
41505Freeing token END (3@30-39)
41506Freeing nterm input (2@0-29)
41507Successful parse.
41508" | \
41509  $at_diff - "$at_stderr" || at_failed=:
41510at_fn_diff_devnull "$at_stdout" || at_failed=:
41511at_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'"
41534at_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>&-
41537at_status=$? at_failed=false
41538$at_check_filter
41539echo stderr:; tee stderr <"$at_stderr"
41540at_fn_diff_devnull "$at_stdout" || at_failed=:
41541at_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"
41547at_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>&-
41550at_status=$? at_failed=false
41551$at_check_filter
41552echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
41553sending: 'x' (1@10-19)
41554thing (1@10-19): 'x' (1@10-19)
41555sending: 'x' (2@20-29)
41556thing (2@20-29): 'x' (2@20-29)
41557sending: 'x' (3@30-39)
4155830.30-39.38: syntax error, unexpected 'x', expecting ')'
41559Freeing nterm thing (2@20-29)
41560Freeing nterm thing (1@10-19)
41561Freeing token 'x' (3@30-39)
41562sending: 'x' (4@40-49)
41563Freeing token 'x' (4@40-49)
41564sending: 'x' (5@50-59)
41565Freeing token 'x' (5@50-59)
41566sending: ')' (6@60-69)
41567line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
41568sending: '(' (7@70-79)
41569sending: 'x' (8@80-89)
41570thing (8@80-89): 'x' (8@80-89)
41571sending: ')' (9@90-99)
41572line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
41573sending: '(' (10@100-109)
41574sending: 'x' (11@110-119)
41575thing (11@110-119): 'x' (11@110-119)
41576sending: ')' (12@120-129)
41577line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
41578sending: 'y' (13@130-139)
41579input (0@129-129): /* Nothing */
41580input (2@100-129): line (10@100-129) input (0@129-129)
41581input (2@70-129): line (7@70-99) input (2@100-129)
41582input (2@0-129): line (-1@0-69) input (2@70-129)
41583130.130-139.138: syntax error, unexpected 'y', expecting END
41584Freeing nterm input (2@0-129)
41585Freeing token 'y' (13@130-139)
41586Parsing FAILED.
41587" | \
41588  $at_diff - "$at_stderr" || at_failed=:
41589at_fn_diff_devnull "$at_stdout" || at_failed=:
41590at_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'"
41608at_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>&-
41611at_status=$? at_failed=false
41612$at_check_filter
41613echo stderr:; tee stderr <"$at_stderr"
41614at_fn_diff_devnull "$at_stdout" || at_failed=:
41615at_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"
41621at_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>&-
41624at_status=$? at_failed=false
41625$at_check_filter
41626echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
41627sending: 'x' (1@10-19)
41628thing (1@10-19): 'x' (1@10-19)
41629sending: ')' (2@20-29)
41630line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
41631sending: '(' (3@30-39)
41632sending: 'x' (4@40-49)
41633thing (4@40-49): 'x' (4@40-49)
41634sending: ')' (5@50-59)
41635line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
41636sending: 'x' (6@60-69)
41637thing (6@60-69): 'x' (6@60-69)
41638sending: END (7@70-79)
4163970.70-79.78: syntax error, unexpected END, expecting 'x'
41640Freeing nterm thing (6@60-69)
41641Freeing nterm line (3@30-59)
41642Freeing nterm line (0@0-29)
41643Freeing token END (7@70-79)
41644Parsing FAILED.
41645" | \
41646  $at_diff - "$at_stderr" || at_failed=:
41647at_fn_diff_devnull "$at_stdout" || at_failed=:
41648at_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)'"
41662at_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>&-
41665at_status=$? at_failed=false
41666$at_check_filter
41667echo stderr:; tee stderr <"$at_stderr"
41668at_fn_diff_devnull "$at_stdout" || at_failed=:
41669at_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"
41675at_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>&-
41678at_status=$? at_failed=false
41679$at_check_filter
41680echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
41681sending: 'x' (1@10-19)
41682thing (1@10-19): 'x' (1@10-19)
41683sending: ')' (2@20-29)
41684line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
41685sending: '(' (3@30-39)
41686sending: 'x' (4@40-49)
41687thing (4@40-49): 'x' (4@40-49)
41688sending: ')' (5@50-59)
41689line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
41690sending: '(' (6@60-69)
41691sending: 'x' (7@70-79)
41692thing (7@70-79): 'x' (7@70-79)
41693sending: ')' (8@80-89)
41694line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
41695sending: '(' (9@90-99)
41696sending: 'x' (10@100-109)
41697thing (10@100-109): 'x' (10@100-109)
41698sending: ')' (11@110-119)
41699line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
41700sending: '(' (12@120-129)
41701sending: 'x' (13@130-139)
41702thing (13@130-139): 'x' (13@130-139)
41703sending: ')' (14@140-149)
41704line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
41705sending: '(' (15@150-159)
41706sending: 'x' (16@160-169)
41707thing (16@160-169): 'x' (16@160-169)
41708sending: ')' (17@170-179)
41709line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
41710sending: '(' (18@180-189)
41711sending: 'x' (19@190-199)
41712thing (19@190-199): 'x' (19@190-199)
41713sending: ')' (20@200-209)
41714200.200-209.208: memory exhausted
41715Freeing nterm thing (19@190-199)
41716Freeing nterm line (15@150-179)
41717Freeing nterm line (12@120-149)
41718Freeing nterm line (9@90-119)
41719Freeing nterm line (6@60-89)
41720Freeing nterm line (3@30-59)
41721Freeing nterm line (0@0-29)
41722Parsing FAILED (status 2).
41723" | \
41724  $at_diff - "$at_stderr" || at_failed=:
41725at_fn_diff_devnull "$at_stdout" || at_failed=:
41726at_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
41739read at_status <"$at_status_file"
41740#AT_STOP_159
41741#AT_START_160
41742at_fn_group_banner 160 'actions.at:752' \
41743  "Printers and Destructors with union" "            " 9
41744at_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
41756cat >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
41792static int yylex (void);
41793static 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
41838input:
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
41854line:
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
41891thing:
41892  'x'
41893    {
41894      $$ = $1;
41895      V(thing, $$, @$, ": ");
41896      V('x',   $1, @1, "\n");
41897    }
41898;
41899%%
41900/* Alias to ARGV[1]. */
41901const char *source = YY_NULL;
41902
41903#include <stdio.h>
41904/* A C error reporting function.  */
41905static
41906void yyerror ( const char *msg)
41907{
41908  YY_LOCATION_PRINT (stderr, (yylloc));
41909  fprintf (stderr, ": ");
41910  fprintf (stderr, "%s\n", msg);
41911}
41912
41913static
41914int 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
41932int
41933main (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
41952if 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"
41960at_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>&-
41964at_status=$? at_failed=false
41965$at_check_filter
41966echo stderr:; cat "$at_stderr"
41967echo stdout:; cat "$at_stdout"
41968at_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"
41974at_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>&-
41977at_status=$? at_failed=false
41978$at_check_filter
41979echo stderr:; cat "$at_stderr"
41980echo stdout:; cat "$at_stdout"
41981at_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"
41990at_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>&-
41995at_status=$? at_failed=false
41996$at_check_filter
41997at_fn_diff_devnull "$at_stderr" || at_failed=:
41998$at_diff expout "$at_stdout" || at_failed=:
41999at_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"
42008at_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>&-
42013at_status=$? at_failed=false
42014$at_check_filter
42015at_fn_diff_devnull "$at_stderr" || at_failed=:
42016$at_diff expout "$at_stdout" || at_failed=:
42017at_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
42023fi
42024{ set +x
42025$as_echo "$at_srcdir/actions.at:752: bison -o input.c input.y"
42026at_fn_check_prepare_trace "actions.at:752"
42027( $at_check_trace; bison -o input.c input.y
42028) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42029at_status=$? at_failed=false
42030$at_check_filter
42031at_fn_diff_devnull "$at_stderr" || at_failed=:
42032at_fn_diff_devnull "$at_stdout" || at_failed=:
42033at_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"
42040at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:752"
42041( $at_check_trace; $BISON_C_WORKS
42042) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42043at_status=$? at_failed=false
42044$at_check_filter
42045echo stderr:; cat "$at_stderr"
42046echo stdout:; cat "$at_stdout"
42047at_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"
42053at_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>&-
42056at_status=$? at_failed=false
42057$at_check_filter
42058echo stderr:; cat "$at_stderr"
42059echo stdout:; cat "$at_stdout"
42060at_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)'"
42074at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:752"
42075( $at_check_trace;  $PREPARSER ./input '(x)'
42076) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42077at_status=$? at_failed=false
42078$at_check_filter
42079echo stderr:; tee stderr <"$at_stderr"
42080at_fn_diff_devnull "$at_stdout" || at_failed=:
42081at_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"
42087at_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>&-
42090at_status=$? at_failed=false
42091$at_check_filter
42092echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42093sending: 'x' (1@10-19)
42094thing (1@10-19): 'x' (1@10-19)
42095sending: ')' (2@20-29)
42096line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
42097sending: END (3@30-39)
42098input (0@29-29): /* Nothing */
42099input (2@0-29): line (0@0-29) input (0@29-29)
42100Freeing token END (3@30-39)
42101Freeing nterm input (2@0-29)
42102Successful parse.
42103" | \
42104  $at_diff - "$at_stderr" || at_failed=:
42105at_fn_diff_devnull "$at_stdout" || at_failed=:
42106at_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)'"
42119at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:752"
42120( $at_check_trace;  $PREPARSER ./input '(y)'
42121) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42122at_status=$? at_failed=false
42123$at_check_filter
42124echo stderr:; tee stderr <"$at_stderr"
42125at_fn_diff_devnull "$at_stdout" || at_failed=:
42126at_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"
42132at_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>&-
42135at_status=$? at_failed=false
42136$at_check_filter
42137echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42138sending: 'y' (1@10-19)
4213910.10-19.18: syntax error, unexpected 'y', expecting 'x'
42140Freeing token 'y' (1@10-19)
42141sending: ')' (2@20-29)
42142line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
42143sending: END (3@30-39)
42144input (0@29-29): /* Nothing */
42145input (2@0-29): line (-1@0-29) input (0@29-29)
42146Freeing token END (3@30-39)
42147Freeing nterm input (2@0-29)
42148Successful parse.
42149" | \
42150  $at_diff - "$at_stderr" || at_failed=:
42151at_fn_diff_devnull "$at_stdout" || at_failed=:
42152at_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'"
42175at_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>&-
42178at_status=$? at_failed=false
42179$at_check_filter
42180echo stderr:; tee stderr <"$at_stderr"
42181at_fn_diff_devnull "$at_stdout" || at_failed=:
42182at_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"
42188at_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>&-
42191at_status=$? at_failed=false
42192$at_check_filter
42193echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42194sending: 'x' (1@10-19)
42195thing (1@10-19): 'x' (1@10-19)
42196sending: 'x' (2@20-29)
42197thing (2@20-29): 'x' (2@20-29)
42198sending: 'x' (3@30-39)
4219930.30-39.38: syntax error, unexpected 'x', expecting ')'
42200Freeing nterm thing (2@20-29)
42201Freeing nterm thing (1@10-19)
42202Freeing token 'x' (3@30-39)
42203sending: 'x' (4@40-49)
42204Freeing token 'x' (4@40-49)
42205sending: 'x' (5@50-59)
42206Freeing token 'x' (5@50-59)
42207sending: ')' (6@60-69)
42208line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
42209sending: '(' (7@70-79)
42210sending: 'x' (8@80-89)
42211thing (8@80-89): 'x' (8@80-89)
42212sending: ')' (9@90-99)
42213line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
42214sending: '(' (10@100-109)
42215sending: 'x' (11@110-119)
42216thing (11@110-119): 'x' (11@110-119)
42217sending: ')' (12@120-129)
42218line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
42219sending: 'y' (13@130-139)
42220input (0@129-129): /* Nothing */
42221input (2@100-129): line (10@100-129) input (0@129-129)
42222input (2@70-129): line (7@70-99) input (2@100-129)
42223input (2@0-129): line (-1@0-69) input (2@70-129)
42224130.130-139.138: syntax error, unexpected 'y', expecting END
42225Freeing nterm input (2@0-129)
42226Freeing token 'y' (13@130-139)
42227Parsing FAILED.
42228" | \
42229  $at_diff - "$at_stderr" || at_failed=:
42230at_fn_diff_devnull "$at_stdout" || at_failed=:
42231at_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'"
42249at_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>&-
42252at_status=$? at_failed=false
42253$at_check_filter
42254echo stderr:; tee stderr <"$at_stderr"
42255at_fn_diff_devnull "$at_stdout" || at_failed=:
42256at_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"
42262at_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>&-
42265at_status=$? at_failed=false
42266$at_check_filter
42267echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42268sending: 'x' (1@10-19)
42269thing (1@10-19): 'x' (1@10-19)
42270sending: ')' (2@20-29)
42271line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
42272sending: '(' (3@30-39)
42273sending: 'x' (4@40-49)
42274thing (4@40-49): 'x' (4@40-49)
42275sending: ')' (5@50-59)
42276line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
42277sending: 'x' (6@60-69)
42278thing (6@60-69): 'x' (6@60-69)
42279sending: END (7@70-79)
4228070.70-79.78: syntax error, unexpected END, expecting 'x'
42281Freeing nterm thing (6@60-69)
42282Freeing nterm line (3@30-59)
42283Freeing nterm line (0@0-29)
42284Freeing token END (7@70-79)
42285Parsing FAILED.
42286" | \
42287  $at_diff - "$at_stderr" || at_failed=:
42288at_fn_diff_devnull "$at_stdout" || at_failed=:
42289at_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)'"
42303at_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>&-
42306at_status=$? at_failed=false
42307$at_check_filter
42308echo stderr:; tee stderr <"$at_stderr"
42309at_fn_diff_devnull "$at_stdout" || at_failed=:
42310at_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"
42316at_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>&-
42319at_status=$? at_failed=false
42320$at_check_filter
42321echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42322sending: 'x' (1@10-19)
42323thing (1@10-19): 'x' (1@10-19)
42324sending: ')' (2@20-29)
42325line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
42326sending: '(' (3@30-39)
42327sending: 'x' (4@40-49)
42328thing (4@40-49): 'x' (4@40-49)
42329sending: ')' (5@50-59)
42330line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
42331sending: '(' (6@60-69)
42332sending: 'x' (7@70-79)
42333thing (7@70-79): 'x' (7@70-79)
42334sending: ')' (8@80-89)
42335line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
42336sending: '(' (9@90-99)
42337sending: 'x' (10@100-109)
42338thing (10@100-109): 'x' (10@100-109)
42339sending: ')' (11@110-119)
42340line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
42341sending: '(' (12@120-129)
42342sending: 'x' (13@130-139)
42343thing (13@130-139): 'x' (13@130-139)
42344sending: ')' (14@140-149)
42345line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
42346sending: '(' (15@150-159)
42347sending: 'x' (16@160-169)
42348thing (16@160-169): 'x' (16@160-169)
42349sending: ')' (17@170-179)
42350line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
42351sending: '(' (18@180-189)
42352sending: 'x' (19@190-199)
42353thing (19@190-199): 'x' (19@190-199)
42354sending: ')' (20@200-209)
42355200.200-209.208: memory exhausted
42356Freeing nterm thing (19@190-199)
42357Freeing nterm line (15@150-179)
42358Freeing nterm line (12@120-149)
42359Freeing nterm line (9@90-119)
42360Freeing nterm line (6@60-89)
42361Freeing nterm line (3@30-59)
42362Freeing nterm line (0@0-29)
42363Parsing FAILED (status 2).
42364" | \
42365  $at_diff - "$at_stderr" || at_failed=:
42366at_fn_diff_devnull "$at_stdout" || at_failed=:
42367at_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
42380read at_status <"$at_status_file"
42381#AT_STOP_160
42382#AT_START_161
42383at_fn_group_banner 161 'actions.at:754' \
42384  "Printers and Destructors: %defines %skeleton \"lalr1.cc\"" "" 9
42385at_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
42397cat >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 {
42429typedef yy::location YYLTYPE;
42430static 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
42476input:
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
42492line:
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
42529thing:
42530  'x'
42531    {
42532      $$ = $1;
42533      V(thing, $$, @$, ": ");
42534      V('x',   $1, @1, "\n");
42535    }
42536;
42537%%
42538/* Alias to ARGV[1]. */
42539const char *source = YY_NULL;
42540
42541/* A C++ error reporting function.  */
42542void
42543yy::parser::error (const location_type& l, const std::string& m)
42544{
42545  (void) l;
42546  std::cerr << l << ": " << m << std::endl;
42547}
42548
42549static
42550int 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}
42566static bool yydebug;
42567int
42568yyparse ()
42569{
42570  yy::parser parser;
42571  parser.set_debug_level (yydebug);
42572  return parser.parse ();
42573}
42574
42575
42576int
42577main (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
42596if 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"
42604at_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>&-
42608at_status=$? at_failed=false
42609$at_check_filter
42610echo stderr:; cat "$at_stderr"
42611echo stdout:; cat "$at_stdout"
42612at_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"
42618at_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>&-
42621at_status=$? at_failed=false
42622$at_check_filter
42623echo stderr:; cat "$at_stderr"
42624echo stdout:; cat "$at_stdout"
42625at_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"
42634at_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>&-
42639at_status=$? at_failed=false
42640$at_check_filter
42641at_fn_diff_devnull "$at_stderr" || at_failed=:
42642$at_diff expout "$at_stdout" || at_failed=:
42643at_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"
42652at_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>&-
42657at_status=$? at_failed=false
42658$at_check_filter
42659at_fn_diff_devnull "$at_stderr" || at_failed=:
42660$at_diff expout "$at_stdout" || at_failed=:
42661at_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
42667fi
42668{ set +x
42669$as_echo "$at_srcdir/actions.at:754: bison -o input.cc input.y"
42670at_fn_check_prepare_trace "actions.at:754"
42671( $at_check_trace; bison -o input.cc input.y
42672) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42673at_status=$? at_failed=false
42674$at_check_filter
42675at_fn_diff_devnull "$at_stderr" || at_failed=:
42676at_fn_diff_devnull "$at_stdout" || at_failed=:
42677at_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"
42685at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:754"
42686( $at_check_trace; $BISON_CXX_WORKS
42687) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42688at_status=$? at_failed=false
42689$at_check_filter
42690echo stderr:; cat "$at_stderr"
42691echo stdout:; cat "$at_stdout"
42692at_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"
42698at_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>&-
42701at_status=$? at_failed=false
42702$at_check_filter
42703echo stderr:; cat "$at_stderr"
42704echo stdout:; cat "$at_stdout"
42705at_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)'"
42719at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:754"
42720( $at_check_trace;  $PREPARSER ./input '(x)'
42721) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42722at_status=$? at_failed=false
42723$at_check_filter
42724echo stderr:; tee stderr <"$at_stderr"
42725at_fn_diff_devnull "$at_stdout" || at_failed=:
42726at_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"
42732at_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>&-
42735at_status=$? at_failed=false
42736$at_check_filter
42737echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42738sending: 'x' (1@10-19)
42739thing (1@10-19): 'x' (1@10-19)
42740sending: ')' (2@20-29)
42741line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
42742sending: END (3@30-39)
42743input (0@29-29): /* Nothing */
42744input (2@0-29): line (0@0-29) input (0@29-29)
42745Freeing token END (3@30-39)
42746Freeing nterm input (2@0-29)
42747Successful parse.
42748" | \
42749  $at_diff - "$at_stderr" || at_failed=:
42750at_fn_diff_devnull "$at_stdout" || at_failed=:
42751at_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)'"
42764at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:754"
42765( $at_check_trace;  $PREPARSER ./input '(y)'
42766) >>"$at_stdout" 2>>"$at_stderr" 5>&-
42767at_status=$? at_failed=false
42768$at_check_filter
42769echo stderr:; tee stderr <"$at_stderr"
42770at_fn_diff_devnull "$at_stdout" || at_failed=:
42771at_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"
42777at_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>&-
42780at_status=$? at_failed=false
42781$at_check_filter
42782echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42783sending: 'y' (1@10-19)
4278410.10-19.18: syntax error, unexpected 'y', expecting 'x'
42785Freeing token 'y' (1@10-19)
42786sending: ')' (2@20-29)
42787line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
42788sending: END (3@30-39)
42789input (0@29-29): /* Nothing */
42790input (2@0-29): line (-1@0-29) input (0@29-29)
42791Freeing token END (3@30-39)
42792Freeing nterm input (2@0-29)
42793Successful parse.
42794" | \
42795  $at_diff - "$at_stderr" || at_failed=:
42796at_fn_diff_devnull "$at_stdout" || at_failed=:
42797at_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'"
42820at_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>&-
42823at_status=$? at_failed=false
42824$at_check_filter
42825echo stderr:; tee stderr <"$at_stderr"
42826at_fn_diff_devnull "$at_stdout" || at_failed=:
42827at_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"
42833at_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>&-
42836at_status=$? at_failed=false
42837$at_check_filter
42838echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42839sending: 'x' (1@10-19)
42840thing (1@10-19): 'x' (1@10-19)
42841sending: 'x' (2@20-29)
42842thing (2@20-29): 'x' (2@20-29)
42843sending: 'x' (3@30-39)
4284430.30-39.38: syntax error, unexpected 'x', expecting ')'
42845Freeing nterm thing (2@20-29)
42846Freeing nterm thing (1@10-19)
42847Freeing token 'x' (3@30-39)
42848sending: 'x' (4@40-49)
42849Freeing token 'x' (4@40-49)
42850sending: 'x' (5@50-59)
42851Freeing token 'x' (5@50-59)
42852sending: ')' (6@60-69)
42853line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
42854sending: '(' (7@70-79)
42855sending: 'x' (8@80-89)
42856thing (8@80-89): 'x' (8@80-89)
42857sending: ')' (9@90-99)
42858line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
42859sending: '(' (10@100-109)
42860sending: 'x' (11@110-119)
42861thing (11@110-119): 'x' (11@110-119)
42862sending: ')' (12@120-129)
42863line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
42864sending: 'y' (13@130-139)
42865input (0@129-129): /* Nothing */
42866input (2@100-129): line (10@100-129) input (0@129-129)
42867input (2@70-129): line (7@70-99) input (2@100-129)
42868input (2@0-129): line (-1@0-69) input (2@70-129)
42869130.130-139.138: syntax error, unexpected 'y', expecting END
42870Freeing nterm input (2@0-129)
42871Freeing token 'y' (13@130-139)
42872Parsing FAILED.
42873" | \
42874  $at_diff - "$at_stderr" || at_failed=:
42875at_fn_diff_devnull "$at_stdout" || at_failed=:
42876at_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'"
42894at_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>&-
42897at_status=$? at_failed=false
42898$at_check_filter
42899echo stderr:; tee stderr <"$at_stderr"
42900at_fn_diff_devnull "$at_stdout" || at_failed=:
42901at_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"
42907at_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>&-
42910at_status=$? at_failed=false
42911$at_check_filter
42912echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
42913sending: 'x' (1@10-19)
42914thing (1@10-19): 'x' (1@10-19)
42915sending: ')' (2@20-29)
42916line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
42917sending: '(' (3@30-39)
42918sending: 'x' (4@40-49)
42919thing (4@40-49): 'x' (4@40-49)
42920sending: ')' (5@50-59)
42921line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
42922sending: 'x' (6@60-69)
42923thing (6@60-69): 'x' (6@60-69)
42924sending: END (7@70-79)
4292570.70-79.78: syntax error, unexpected END, expecting 'x'
42926Freeing nterm thing (6@60-69)
42927Freeing nterm line (3@30-59)
42928Freeing nterm line (0@0-29)
42929Freeing token END (7@70-79)
42930Parsing FAILED.
42931" | \
42932  $at_diff - "$at_stderr" || at_failed=:
42933at_fn_diff_devnull "$at_stdout" || at_failed=:
42934at_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
42953read at_status <"$at_status_file"
42954#AT_STOP_161
42955#AT_START_162
42956at_fn_group_banner 162 'actions.at:755' \
42957  "Printers and Destructors with union: %defines %skeleton \"lalr1.cc\"" "" 9
42958at_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
42970cat >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 {
43005typedef yy::location YYLTYPE;
43006static 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
43052input:
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
43068line:
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
43105thing:
43106  'x'
43107    {
43108      $$ = $1;
43109      V(thing, $$, @$, ": ");
43110      V('x',   $1, @1, "\n");
43111    }
43112;
43113%%
43114/* Alias to ARGV[1]. */
43115const char *source = YY_NULL;
43116
43117/* A C++ error reporting function.  */
43118void
43119yy::parser::error (const location_type& l, const std::string& m)
43120{
43121  (void) l;
43122  std::cerr << l << ": " << m << std::endl;
43123}
43124
43125static
43126int 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}
43142static bool yydebug;
43143int
43144yyparse ()
43145{
43146  yy::parser parser;
43147  parser.set_debug_level (yydebug);
43148  return parser.parse ();
43149}
43150
43151
43152int
43153main (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
43172if 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"
43180at_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>&-
43184at_status=$? at_failed=false
43185$at_check_filter
43186echo stderr:; cat "$at_stderr"
43187echo stdout:; cat "$at_stdout"
43188at_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"
43194at_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>&-
43197at_status=$? at_failed=false
43198$at_check_filter
43199echo stderr:; cat "$at_stderr"
43200echo stdout:; cat "$at_stdout"
43201at_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"
43210at_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>&-
43215at_status=$? at_failed=false
43216$at_check_filter
43217at_fn_diff_devnull "$at_stderr" || at_failed=:
43218$at_diff expout "$at_stdout" || at_failed=:
43219at_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"
43228at_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>&-
43233at_status=$? at_failed=false
43234$at_check_filter
43235at_fn_diff_devnull "$at_stderr" || at_failed=:
43236$at_diff expout "$at_stdout" || at_failed=:
43237at_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
43243fi
43244{ set +x
43245$as_echo "$at_srcdir/actions.at:755: bison -o input.cc input.y"
43246at_fn_check_prepare_trace "actions.at:755"
43247( $at_check_trace; bison -o input.cc input.y
43248) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43249at_status=$? at_failed=false
43250$at_check_filter
43251at_fn_diff_devnull "$at_stderr" || at_failed=:
43252at_fn_diff_devnull "$at_stdout" || at_failed=:
43253at_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"
43261at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:755"
43262( $at_check_trace; $BISON_CXX_WORKS
43263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43264at_status=$? at_failed=false
43265$at_check_filter
43266echo stderr:; cat "$at_stderr"
43267echo stdout:; cat "$at_stdout"
43268at_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"
43274at_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>&-
43277at_status=$? at_failed=false
43278$at_check_filter
43279echo stderr:; cat "$at_stderr"
43280echo stdout:; cat "$at_stdout"
43281at_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)'"
43295at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:755"
43296( $at_check_trace;  $PREPARSER ./input '(x)'
43297) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43298at_status=$? at_failed=false
43299$at_check_filter
43300echo stderr:; tee stderr <"$at_stderr"
43301at_fn_diff_devnull "$at_stdout" || at_failed=:
43302at_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"
43308at_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>&-
43311at_status=$? at_failed=false
43312$at_check_filter
43313echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43314sending: 'x' (1@10-19)
43315thing (1@10-19): 'x' (1@10-19)
43316sending: ')' (2@20-29)
43317line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
43318sending: END (3@30-39)
43319input (0@29-29): /* Nothing */
43320input (2@0-29): line (0@0-29) input (0@29-29)
43321Freeing token END (3@30-39)
43322Freeing nterm input (2@0-29)
43323Successful parse.
43324" | \
43325  $at_diff - "$at_stderr" || at_failed=:
43326at_fn_diff_devnull "$at_stdout" || at_failed=:
43327at_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)'"
43340at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:755"
43341( $at_check_trace;  $PREPARSER ./input '(y)'
43342) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43343at_status=$? at_failed=false
43344$at_check_filter
43345echo stderr:; tee stderr <"$at_stderr"
43346at_fn_diff_devnull "$at_stdout" || at_failed=:
43347at_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"
43353at_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>&-
43356at_status=$? at_failed=false
43357$at_check_filter
43358echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43359sending: 'y' (1@10-19)
4336010.10-19.18: syntax error, unexpected 'y', expecting 'x'
43361Freeing token 'y' (1@10-19)
43362sending: ')' (2@20-29)
43363line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
43364sending: END (3@30-39)
43365input (0@29-29): /* Nothing */
43366input (2@0-29): line (-1@0-29) input (0@29-29)
43367Freeing token END (3@30-39)
43368Freeing nterm input (2@0-29)
43369Successful parse.
43370" | \
43371  $at_diff - "$at_stderr" || at_failed=:
43372at_fn_diff_devnull "$at_stdout" || at_failed=:
43373at_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'"
43396at_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>&-
43399at_status=$? at_failed=false
43400$at_check_filter
43401echo stderr:; tee stderr <"$at_stderr"
43402at_fn_diff_devnull "$at_stdout" || at_failed=:
43403at_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"
43409at_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>&-
43412at_status=$? at_failed=false
43413$at_check_filter
43414echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43415sending: 'x' (1@10-19)
43416thing (1@10-19): 'x' (1@10-19)
43417sending: 'x' (2@20-29)
43418thing (2@20-29): 'x' (2@20-29)
43419sending: 'x' (3@30-39)
4342030.30-39.38: syntax error, unexpected 'x', expecting ')'
43421Freeing nterm thing (2@20-29)
43422Freeing nterm thing (1@10-19)
43423Freeing token 'x' (3@30-39)
43424sending: 'x' (4@40-49)
43425Freeing token 'x' (4@40-49)
43426sending: 'x' (5@50-59)
43427Freeing token 'x' (5@50-59)
43428sending: ')' (6@60-69)
43429line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
43430sending: '(' (7@70-79)
43431sending: 'x' (8@80-89)
43432thing (8@80-89): 'x' (8@80-89)
43433sending: ')' (9@90-99)
43434line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
43435sending: '(' (10@100-109)
43436sending: 'x' (11@110-119)
43437thing (11@110-119): 'x' (11@110-119)
43438sending: ')' (12@120-129)
43439line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
43440sending: 'y' (13@130-139)
43441input (0@129-129): /* Nothing */
43442input (2@100-129): line (10@100-129) input (0@129-129)
43443input (2@70-129): line (7@70-99) input (2@100-129)
43444input (2@0-129): line (-1@0-69) input (2@70-129)
43445130.130-139.138: syntax error, unexpected 'y', expecting END
43446Freeing nterm input (2@0-129)
43447Freeing token 'y' (13@130-139)
43448Parsing FAILED.
43449" | \
43450  $at_diff - "$at_stderr" || at_failed=:
43451at_fn_diff_devnull "$at_stdout" || at_failed=:
43452at_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'"
43470at_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>&-
43473at_status=$? at_failed=false
43474$at_check_filter
43475echo stderr:; tee stderr <"$at_stderr"
43476at_fn_diff_devnull "$at_stdout" || at_failed=:
43477at_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"
43483at_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>&-
43486at_status=$? at_failed=false
43487$at_check_filter
43488echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43489sending: 'x' (1@10-19)
43490thing (1@10-19): 'x' (1@10-19)
43491sending: ')' (2@20-29)
43492line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
43493sending: '(' (3@30-39)
43494sending: 'x' (4@40-49)
43495thing (4@40-49): 'x' (4@40-49)
43496sending: ')' (5@50-59)
43497line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
43498sending: 'x' (6@60-69)
43499thing (6@60-69): 'x' (6@60-69)
43500sending: END (7@70-79)
4350170.70-79.78: syntax error, unexpected END, expecting 'x'
43502Freeing nterm thing (6@60-69)
43503Freeing nterm line (3@30-59)
43504Freeing nterm line (0@0-29)
43505Freeing token END (7@70-79)
43506Parsing FAILED.
43507" | \
43508  $at_diff - "$at_stderr" || at_failed=:
43509at_fn_diff_devnull "$at_stdout" || at_failed=:
43510at_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
43529read at_status <"$at_status_file"
43530#AT_STOP_162
43531#AT_START_163
43532at_fn_group_banner 163 'actions.at:757' \
43533  "Printers and Destructors: %glr-parser" "          " 9
43534at_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
43546cat >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
43579static int yylex (void);
43580static 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
43625input:
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
43641line:
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
43678thing:
43679  'x'
43680    {
43681      $$ = $1;
43682      V(thing, $$, @$, ": ");
43683      V('x',   $1, @1, "\n");
43684    }
43685;
43686%%
43687/* Alias to ARGV[1]. */
43688const char *source = YY_NULL;
43689
43690#include <stdio.h>
43691/* A C error reporting function.  */
43692static
43693void yyerror ( const char *msg)
43694{
43695  YY_LOCATION_PRINT (stderr, (yylloc));
43696  fprintf (stderr, ": ");
43697  fprintf (stderr, "%s\n", msg);
43698}
43699
43700static
43701int 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
43719int
43720main (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
43739if 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"
43747at_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>&-
43751at_status=$? at_failed=false
43752$at_check_filter
43753echo stderr:; cat "$at_stderr"
43754echo stdout:; cat "$at_stdout"
43755at_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"
43761at_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>&-
43764at_status=$? at_failed=false
43765$at_check_filter
43766echo stderr:; cat "$at_stderr"
43767echo stdout:; cat "$at_stdout"
43768at_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"
43777at_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>&-
43782at_status=$? at_failed=false
43783$at_check_filter
43784at_fn_diff_devnull "$at_stderr" || at_failed=:
43785$at_diff expout "$at_stdout" || at_failed=:
43786at_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"
43795at_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>&-
43800at_status=$? at_failed=false
43801$at_check_filter
43802at_fn_diff_devnull "$at_stderr" || at_failed=:
43803$at_diff expout "$at_stdout" || at_failed=:
43804at_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
43810fi
43811{ set +x
43812$as_echo "$at_srcdir/actions.at:757: bison -o input.c input.y"
43813at_fn_check_prepare_trace "actions.at:757"
43814( $at_check_trace; bison -o input.c input.y
43815) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43816at_status=$? at_failed=false
43817$at_check_filter
43818at_fn_diff_devnull "$at_stderr" || at_failed=:
43819at_fn_diff_devnull "$at_stdout" || at_failed=:
43820at_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"
43827at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:757"
43828( $at_check_trace; $BISON_C_WORKS
43829) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43830at_status=$? at_failed=false
43831$at_check_filter
43832echo stderr:; cat "$at_stderr"
43833echo stdout:; cat "$at_stdout"
43834at_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"
43840at_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>&-
43843at_status=$? at_failed=false
43844$at_check_filter
43845echo stderr:; cat "$at_stderr"
43846echo stdout:; cat "$at_stdout"
43847at_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)'"
43861at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:757"
43862( $at_check_trace;  $PREPARSER ./input '(x)'
43863) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43864at_status=$? at_failed=false
43865$at_check_filter
43866echo stderr:; tee stderr <"$at_stderr"
43867at_fn_diff_devnull "$at_stdout" || at_failed=:
43868at_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"
43874at_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>&-
43877at_status=$? at_failed=false
43878$at_check_filter
43879echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43880sending: 'x' (1@10-19)
43881thing (1@10-19): 'x' (1@10-19)
43882sending: ')' (2@20-29)
43883line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
43884sending: END (3@30-39)
43885input (0@29-29): /* Nothing */
43886input (2@0-29): line (0@0-29) input (0@29-29)
43887Freeing token END (3@30-39)
43888Freeing nterm input (2@0-29)
43889Successful parse.
43890" | \
43891  $at_diff - "$at_stderr" || at_failed=:
43892at_fn_diff_devnull "$at_stdout" || at_failed=:
43893at_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)'"
43906at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:757"
43907( $at_check_trace;  $PREPARSER ./input '(y)'
43908) >>"$at_stdout" 2>>"$at_stderr" 5>&-
43909at_status=$? at_failed=false
43910$at_check_filter
43911echo stderr:; tee stderr <"$at_stderr"
43912at_fn_diff_devnull "$at_stdout" || at_failed=:
43913at_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"
43919at_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>&-
43922at_status=$? at_failed=false
43923$at_check_filter
43924echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43925sending: 'y' (1@10-19)
4392610.10-19.18: syntax error, unexpected 'y', expecting 'x'
43927Freeing token 'y' (1@10-19)
43928sending: ')' (2@20-29)
43929line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
43930sending: END (3@30-39)
43931input (0@29-29): /* Nothing */
43932input (2@0-29): line (-1@0-29) input (0@29-29)
43933Freeing token END (3@30-39)
43934Freeing nterm input (2@0-29)
43935Successful parse.
43936" | \
43937  $at_diff - "$at_stderr" || at_failed=:
43938at_fn_diff_devnull "$at_stdout" || at_failed=:
43939at_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'"
43962at_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>&-
43965at_status=$? at_failed=false
43966$at_check_filter
43967echo stderr:; tee stderr <"$at_stderr"
43968at_fn_diff_devnull "$at_stdout" || at_failed=:
43969at_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"
43975at_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>&-
43978at_status=$? at_failed=false
43979$at_check_filter
43980echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
43981sending: 'x' (1@10-19)
43982thing (1@10-19): 'x' (1@10-19)
43983sending: 'x' (2@20-29)
43984thing (2@20-29): 'x' (2@20-29)
43985sending: 'x' (3@30-39)
4398630.30-39.38: syntax error, unexpected 'x', expecting ')'
43987Freeing nterm thing (2@20-29)
43988Freeing nterm thing (1@10-19)
43989Freeing token 'x' (3@30-39)
43990sending: 'x' (4@40-49)
43991Freeing token 'x' (4@40-49)
43992sending: 'x' (5@50-59)
43993Freeing token 'x' (5@50-59)
43994sending: ')' (6@60-69)
43995line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
43996sending: '(' (7@70-79)
43997sending: 'x' (8@80-89)
43998thing (8@80-89): 'x' (8@80-89)
43999sending: ')' (9@90-99)
44000line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
44001sending: '(' (10@100-109)
44002sending: 'x' (11@110-119)
44003thing (11@110-119): 'x' (11@110-119)
44004sending: ')' (12@120-129)
44005line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
44006sending: 'y' (13@130-139)
44007input (0@129-129): /* Nothing */
44008input (2@100-129): line (10@100-129) input (0@129-129)
44009input (2@70-129): line (7@70-99) input (2@100-129)
44010input (2@0-129): line (-1@0-69) input (2@70-129)
44011130.130-139.138: syntax error, unexpected 'y', expecting END
44012Freeing nterm input (2@0-129)
44013Freeing token 'y' (13@130-139)
44014Parsing FAILED.
44015" | \
44016  $at_diff - "$at_stderr" || at_failed=:
44017at_fn_diff_devnull "$at_stdout" || at_failed=:
44018at_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'"
44036at_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>&-
44039at_status=$? at_failed=false
44040$at_check_filter
44041echo stderr:; tee stderr <"$at_stderr"
44042at_fn_diff_devnull "$at_stdout" || at_failed=:
44043at_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"
44049at_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>&-
44052at_status=$? at_failed=false
44053$at_check_filter
44054echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
44055sending: 'x' (1@10-19)
44056thing (1@10-19): 'x' (1@10-19)
44057sending: ')' (2@20-29)
44058line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
44059sending: '(' (3@30-39)
44060sending: 'x' (4@40-49)
44061thing (4@40-49): 'x' (4@40-49)
44062sending: ')' (5@50-59)
44063line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
44064sending: 'x' (6@60-69)
44065thing (6@60-69): 'x' (6@60-69)
44066sending: END (7@70-79)
4406770.70-79.78: syntax error, unexpected END, expecting 'x'
44068Freeing nterm thing (6@60-69)
44069Freeing nterm line (3@30-59)
44070Freeing nterm line (0@0-29)
44071Freeing token END (7@70-79)
44072Parsing FAILED.
44073" | \
44074  $at_diff - "$at_stderr" || at_failed=:
44075at_fn_diff_devnull "$at_stdout" || at_failed=:
44076at_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
44095read at_status <"$at_status_file"
44096#AT_STOP_163
44097#AT_START_164
44098at_fn_group_banner 164 'actions.at:758' \
44099  "Printers and Destructors with union: %glr-parser" "" 9
44100at_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
44112cat >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
44148static int yylex (void);
44149static 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
44194input:
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
44210line:
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
44247thing:
44248  'x'
44249    {
44250      $$ = $1;
44251      V(thing, $$, @$, ": ");
44252      V('x',   $1, @1, "\n");
44253    }
44254;
44255%%
44256/* Alias to ARGV[1]. */
44257const char *source = YY_NULL;
44258
44259#include <stdio.h>
44260/* A C error reporting function.  */
44261static
44262void yyerror ( const char *msg)
44263{
44264  YY_LOCATION_PRINT (stderr, (yylloc));
44265  fprintf (stderr, ": ");
44266  fprintf (stderr, "%s\n", msg);
44267}
44268
44269static
44270int 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
44288int
44289main (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
44308if 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"
44316at_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>&-
44320at_status=$? at_failed=false
44321$at_check_filter
44322echo stderr:; cat "$at_stderr"
44323echo stdout:; cat "$at_stdout"
44324at_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"
44330at_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>&-
44333at_status=$? at_failed=false
44334$at_check_filter
44335echo stderr:; cat "$at_stderr"
44336echo stdout:; cat "$at_stdout"
44337at_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"
44346at_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>&-
44351at_status=$? at_failed=false
44352$at_check_filter
44353at_fn_diff_devnull "$at_stderr" || at_failed=:
44354$at_diff expout "$at_stdout" || at_failed=:
44355at_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"
44364at_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>&-
44369at_status=$? at_failed=false
44370$at_check_filter
44371at_fn_diff_devnull "$at_stderr" || at_failed=:
44372$at_diff expout "$at_stdout" || at_failed=:
44373at_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
44379fi
44380{ set +x
44381$as_echo "$at_srcdir/actions.at:758: bison -o input.c input.y"
44382at_fn_check_prepare_trace "actions.at:758"
44383( $at_check_trace; bison -o input.c input.y
44384) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44385at_status=$? at_failed=false
44386$at_check_filter
44387at_fn_diff_devnull "$at_stderr" || at_failed=:
44388at_fn_diff_devnull "$at_stdout" || at_failed=:
44389at_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"
44396at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:758"
44397( $at_check_trace; $BISON_C_WORKS
44398) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44399at_status=$? at_failed=false
44400$at_check_filter
44401echo stderr:; cat "$at_stderr"
44402echo stdout:; cat "$at_stdout"
44403at_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"
44409at_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>&-
44412at_status=$? at_failed=false
44413$at_check_filter
44414echo stderr:; cat "$at_stderr"
44415echo stdout:; cat "$at_stdout"
44416at_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)'"
44430at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:758"
44431( $at_check_trace;  $PREPARSER ./input '(x)'
44432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44433at_status=$? at_failed=false
44434$at_check_filter
44435echo stderr:; tee stderr <"$at_stderr"
44436at_fn_diff_devnull "$at_stdout" || at_failed=:
44437at_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"
44443at_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>&-
44446at_status=$? at_failed=false
44447$at_check_filter
44448echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
44449sending: 'x' (1@10-19)
44450thing (1@10-19): 'x' (1@10-19)
44451sending: ')' (2@20-29)
44452line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
44453sending: END (3@30-39)
44454input (0@29-29): /* Nothing */
44455input (2@0-29): line (0@0-29) input (0@29-29)
44456Freeing token END (3@30-39)
44457Freeing nterm input (2@0-29)
44458Successful parse.
44459" | \
44460  $at_diff - "$at_stderr" || at_failed=:
44461at_fn_diff_devnull "$at_stdout" || at_failed=:
44462at_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)'"
44475at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:758"
44476( $at_check_trace;  $PREPARSER ./input '(y)'
44477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44478at_status=$? at_failed=false
44479$at_check_filter
44480echo stderr:; tee stderr <"$at_stderr"
44481at_fn_diff_devnull "$at_stdout" || at_failed=:
44482at_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"
44488at_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>&-
44491at_status=$? at_failed=false
44492$at_check_filter
44493echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
44494sending: 'y' (1@10-19)
4449510.10-19.18: syntax error, unexpected 'y', expecting 'x'
44496Freeing token 'y' (1@10-19)
44497sending: ')' (2@20-29)
44498line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
44499sending: END (3@30-39)
44500input (0@29-29): /* Nothing */
44501input (2@0-29): line (-1@0-29) input (0@29-29)
44502Freeing token END (3@30-39)
44503Freeing nterm input (2@0-29)
44504Successful parse.
44505" | \
44506  $at_diff - "$at_stderr" || at_failed=:
44507at_fn_diff_devnull "$at_stdout" || at_failed=:
44508at_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'"
44531at_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>&-
44534at_status=$? at_failed=false
44535$at_check_filter
44536echo stderr:; tee stderr <"$at_stderr"
44537at_fn_diff_devnull "$at_stdout" || at_failed=:
44538at_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"
44544at_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>&-
44547at_status=$? at_failed=false
44548$at_check_filter
44549echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
44550sending: 'x' (1@10-19)
44551thing (1@10-19): 'x' (1@10-19)
44552sending: 'x' (2@20-29)
44553thing (2@20-29): 'x' (2@20-29)
44554sending: 'x' (3@30-39)
4455530.30-39.38: syntax error, unexpected 'x', expecting ')'
44556Freeing nterm thing (2@20-29)
44557Freeing nterm thing (1@10-19)
44558Freeing token 'x' (3@30-39)
44559sending: 'x' (4@40-49)
44560Freeing token 'x' (4@40-49)
44561sending: 'x' (5@50-59)
44562Freeing token 'x' (5@50-59)
44563sending: ')' (6@60-69)
44564line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
44565sending: '(' (7@70-79)
44566sending: 'x' (8@80-89)
44567thing (8@80-89): 'x' (8@80-89)
44568sending: ')' (9@90-99)
44569line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
44570sending: '(' (10@100-109)
44571sending: 'x' (11@110-119)
44572thing (11@110-119): 'x' (11@110-119)
44573sending: ')' (12@120-129)
44574line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
44575sending: 'y' (13@130-139)
44576input (0@129-129): /* Nothing */
44577input (2@100-129): line (10@100-129) input (0@129-129)
44578input (2@70-129): line (7@70-99) input (2@100-129)
44579input (2@0-129): line (-1@0-69) input (2@70-129)
44580130.130-139.138: syntax error, unexpected 'y', expecting END
44581Freeing nterm input (2@0-129)
44582Freeing token 'y' (13@130-139)
44583Parsing FAILED.
44584" | \
44585  $at_diff - "$at_stderr" || at_failed=:
44586at_fn_diff_devnull "$at_stdout" || at_failed=:
44587at_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'"
44605at_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>&-
44608at_status=$? at_failed=false
44609$at_check_filter
44610echo stderr:; tee stderr <"$at_stderr"
44611at_fn_diff_devnull "$at_stdout" || at_failed=:
44612at_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"
44618at_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>&-
44621at_status=$? at_failed=false
44622$at_check_filter
44623echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
44624sending: 'x' (1@10-19)
44625thing (1@10-19): 'x' (1@10-19)
44626sending: ')' (2@20-29)
44627line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
44628sending: '(' (3@30-39)
44629sending: 'x' (4@40-49)
44630thing (4@40-49): 'x' (4@40-49)
44631sending: ')' (5@50-59)
44632line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
44633sending: 'x' (6@60-69)
44634thing (6@60-69): 'x' (6@60-69)
44635sending: END (7@70-79)
4463670.70-79.78: syntax error, unexpected END, expecting 'x'
44637Freeing nterm thing (6@60-69)
44638Freeing nterm line (3@30-59)
44639Freeing nterm line (0@0-29)
44640Freeing token END (7@70-79)
44641Parsing FAILED.
44642" | \
44643  $at_diff - "$at_stderr" || at_failed=:
44644at_fn_diff_devnull "$at_stdout" || at_failed=:
44645at_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
44664read at_status <"$at_status_file"
44665#AT_STOP_164
44666#AT_START_165
44667at_fn_group_banner 165 'actions.at:769' \
44668  "Default tagless %printer and %destructor" "       " 9
44669at_xfail=no
44670(
44671  $as_echo "165. $at_setup_line: testing $at_desc ..."
44672  $at_traceon
44673
44674
44675cat >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>
44691static int yylex (void);
44692static 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
44720start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ;
44721
44722%%
44723#include <stdio.h>
44724/* A C error reporting function.  */
44725static
44726void 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>
44733static
44734int 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
44748int
44749main (void)
44750{
44751  yydebug = 1;
44752  return yyparse ();
44753}
44754_ATEOF
44755
44756
44757
44758if 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"
44766at_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>&-
44770at_status=$? at_failed=false
44771$at_check_filter
44772echo stderr:; cat "$at_stderr"
44773echo stdout:; cat "$at_stdout"
44774at_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"
44780at_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>&-
44783at_status=$? at_failed=false
44784$at_check_filter
44785echo stderr:; cat "$at_stderr"
44786echo stdout:; cat "$at_stdout"
44787at_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"
44796at_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>&-
44801at_status=$? at_failed=false
44802$at_check_filter
44803at_fn_diff_devnull "$at_stderr" || at_failed=:
44804$at_diff expout "$at_stdout" || at_failed=:
44805at_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"
44814at_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>&-
44819at_status=$? at_failed=false
44820$at_check_filter
44821at_fn_diff_devnull "$at_stderr" || at_failed=:
44822$at_diff expout "$at_stdout" || at_failed=:
44823at_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
44829fi
44830{ set +x
44831$as_echo "$at_srcdir/actions.at:822: bison -o input.c input.y"
44832at_fn_check_prepare_trace "actions.at:822"
44833( $at_check_trace; bison -o input.c input.y
44834) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44835at_status=$? at_failed=false
44836$at_check_filter
44837at_fn_diff_devnull "$at_stderr" || at_failed=:
44838at_fn_diff_devnull "$at_stdout" || at_failed=:
44839at_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"
44846at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:823"
44847( $at_check_trace; $BISON_C_WORKS
44848) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44849at_status=$? at_failed=false
44850$at_check_filter
44851echo stderr:; cat "$at_stderr"
44852echo stdout:; cat "$at_stdout"
44853at_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"
44859at_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>&-
44862at_status=$? at_failed=false
44863$at_check_filter
44864echo stderr:; cat "$at_stderr"
44865echo stdout:; cat "$at_stdout"
44866at_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"
44872at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:824"
44873( $at_check_trace;  $PREPARSER ./input
44874) >>"$at_stdout" 2>>"$at_stderr" 5>&-
44875at_status=$? at_failed=false
44876$at_check_filter
44877echo stderr:; tee stderr <"$at_stderr"
44878echo >>"$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=:
44884at_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"
44890at_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>&-
44893at_status=$? at_failed=false
44894$at_check_filter
44895echo >>"$at_stderr"; $as_echo "Starting parse
44896Entering state 0
44897Reading a token: Next token is token 'a' (1.1: <> printer for 'a' @ 1)
44898Shifting token 'a' (1.1: <> printer for 'a' @ 1)
44899Entering state 1
44900Reading a token: Next token is token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
44901Shifting token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
44902Entering state 3
44903Reading a token: Next token is token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
44904Shifting token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
44905Entering state 5
44906Reading a token: Next token is token 'd' (1.4: <> printer for 'd' @ 4)
44907Shifting token 'd' (1.4: <> printer for 'd' @ 4)
44908Entering state 6
44909Reading a token: Now at end of input.
449101.5: syntax error, unexpected \$end, expecting 'e'
44911Error: popping token 'd' (1.4: <> printer for 'd' @ 4)
44912Stack now 0 1 3 5
44913Error: popping token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
44914Stack now 0 1 3
44915Error: popping token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
44916Stack now 0 1
44917Error: popping token 'a' (1.1: <> printer for 'a' @ 1)
44918Stack now 0
44919Cleanup: discarding lookahead token \$end (1.5: )
44920Stack now 0
44921" | \
44922  $at_diff - "$at_stderr" || at_failed=:
44923at_fn_diff_devnull "$at_stdout" || at_failed=:
44924at_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
44934read at_status <"$at_status_file"
44935#AT_STOP_165
44936#AT_START_166
44937at_fn_group_banner 166 'actions.at:867' \
44938  "Default tagged and per-type %printer and %destructor" "" 9
44939at_xfail=no
44940(
44941  $as_echo "166. $at_setup_line: testing $at_desc ..."
44942  $at_traceon
44943
44944
44945cat >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>
44960static void yyerror ( const char *msg);
44961static 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
44998start:
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.  */
45009static
45010void yyerror ( const char *msg)
45011{
45012  fprintf (stderr, "%s\n", msg);
45013}
45014#include <assert.h>
45015static
45016int 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
45028int
45029main (void)
45030{
45031  yydebug = 1;
45032  return yyparse ();
45033}
45034_ATEOF
45035
45036
45037
45038if 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"
45046at_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>&-
45050at_status=$? at_failed=false
45051$at_check_filter
45052echo stderr:; cat "$at_stderr"
45053echo stdout:; cat "$at_stdout"
45054at_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"
45060at_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>&-
45063at_status=$? at_failed=false
45064$at_check_filter
45065echo stderr:; cat "$at_stderr"
45066echo stdout:; cat "$at_stdout"
45067at_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"
45076at_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>&-
45081at_status=$? at_failed=false
45082$at_check_filter
45083at_fn_diff_devnull "$at_stderr" || at_failed=:
45084$at_diff expout "$at_stdout" || at_failed=:
45085at_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"
45094at_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>&-
45099at_status=$? at_failed=false
45100$at_check_filter
45101at_fn_diff_devnull "$at_stderr" || at_failed=:
45102$at_diff expout "$at_stdout" || at_failed=:
45103at_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
45109fi
45110{ set +x
45111$as_echo "$at_srcdir/actions.at:934: bison -o input.c input.y"
45112at_fn_check_prepare_trace "actions.at:934"
45113( $at_check_trace; bison -o input.c input.y
45114) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45115at_status=$? at_failed=false
45116$at_check_filter
45117at_fn_diff_devnull "$at_stderr" || at_failed=:
45118at_fn_diff_devnull "$at_stdout" || at_failed=:
45119at_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"
45126at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:935"
45127( $at_check_trace; $BISON_C_WORKS
45128) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45129at_status=$? at_failed=false
45130$at_check_filter
45131echo stderr:; cat "$at_stderr"
45132echo stdout:; cat "$at_stdout"
45133at_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"
45139at_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>&-
45142at_status=$? at_failed=false
45143$at_check_filter
45144echo stderr:; cat "$at_stderr"
45145echo stdout:; cat "$at_stdout"
45146at_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"
45152at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:936"
45153( $at_check_trace;  $PREPARSER ./input
45154) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45155at_status=$? at_failed=false
45156$at_check_filter
45157echo stderr:; tee stderr <"$at_stderr"
45158echo >>"$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=:
45166at_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"
45172at_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>&-
45175at_status=$? at_failed=false
45176$at_check_filter
45177echo >>"$at_stderr"; $as_echo "Starting parse
45178Entering state 0
45179Reading a token: Next token is token 'a' (<*>/<field2>/e printer)
45180Shifting token 'a' (<*>/<field2>/e printer)
45181Entering state 1
45182Reading a token: Next token is token 'b' (<field1> printer)
45183Shifting token 'b' (<field1> printer)
45184Entering state 3
45185Reading a token: Next token is token 'c' ('c' printer)
45186Shifting token 'c' ('c' printer)
45187Entering state 5
45188Reading a token: Next token is token 'd' ('d' printer)
45189Shifting token 'd' ('d' printer)
45190Entering state 6
45191Reading a token: Next token is token 'e' (<*>/<field2>/e printer)
45192Shifting token 'e' (<*>/<field2>/e printer)
45193Entering state 7
45194Reading a token: Next token is token 'f' (<*>/<field2>/e printer)
45195Shifting token 'f' (<*>/<field2>/e printer)
45196Entering state 8
45197Reading a token: Now at end of input.
45198syntax error, unexpected \$end, expecting 'g'
45199Error: popping token 'f' (<*>/<field2>/e printer)
45200Stack now 0 1 3 5 6 7
45201Error: popping token 'e' (<*>/<field2>/e printer)
45202Stack now 0 1 3 5 6
45203Error: popping token 'd' ('d' printer)
45204Stack now 0 1 3 5
45205Error: popping token 'c' ('c' printer)
45206Stack now 0 1 3
45207Error: popping token 'b' (<field1> printer)
45208Stack now 0 1
45209Error: popping token 'a' (<*>/<field2>/e printer)
45210Stack now 0
45211Cleanup: discarding lookahead token \$end ()
45212Stack now 0
45213" | \
45214  $at_diff - "$at_stderr" || at_failed=:
45215at_fn_diff_devnull "$at_stdout" || at_failed=:
45216at_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
45226read at_status <"$at_status_file"
45227#AT_STOP_166
45228#AT_START_167
45229at_fn_group_banner 167 'actions.at:991' \
45230  "Default %printer and %destructor for user-defined end token" "" 9
45231at_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
45244cat >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>
45260static void yyerror ( const char *msg);
45261static 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
45286start: { $$ = 'S'; } ;
45287
45288%%
45289
45290static int
45291yylex (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.  */
45303static
45304void yyerror ( const char *msg)
45305{
45306  YY_LOCATION_PRINT (stderr, (yylloc));
45307  fprintf (stderr, ": ");
45308  fprintf (stderr, "%s\n", msg);
45309}
45310
45311int
45312main (void)
45313{
45314  yydebug = 1;
45315  return yyparse ();
45316}
45317_ATEOF
45318
45319
45320
45321
45322if 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"
45330at_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>&-
45334at_status=$? at_failed=false
45335$at_check_filter
45336echo stderr:; cat "$at_stderr"
45337echo stdout:; cat "$at_stdout"
45338at_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"
45344at_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>&-
45347at_status=$? at_failed=false
45348$at_check_filter
45349echo stderr:; cat "$at_stderr"
45350echo stdout:; cat "$at_stdout"
45351at_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"
45360at_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>&-
45365at_status=$? at_failed=false
45366$at_check_filter
45367at_fn_diff_devnull "$at_stderr" || at_failed=:
45368$at_diff expout "$at_stdout" || at_failed=:
45369at_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"
45378at_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>&-
45383at_status=$? at_failed=false
45384$at_check_filter
45385at_fn_diff_devnull "$at_stderr" || at_failed=:
45386$at_diff expout "$at_stdout" || at_failed=:
45387at_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
45393fi
45394{ set +x
45395$as_echo "$at_srcdir/actions.at:1087: bison -o input0.c input0.y"
45396at_fn_check_prepare_trace "actions.at:1087"
45397( $at_check_trace; bison -o input0.c input0.y
45398) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45399at_status=$? at_failed=false
45400$at_check_filter
45401at_fn_diff_devnull "$at_stderr" || at_failed=:
45402at_fn_diff_devnull "$at_stdout" || at_failed=:
45403at_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"
45410at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1087"
45411( $at_check_trace; $BISON_C_WORKS
45412) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45413at_status=$? at_failed=false
45414$at_check_filter
45415echo stderr:; cat "$at_stderr"
45416echo stdout:; cat "$at_stdout"
45417at_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"
45423at_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>&-
45426at_status=$? at_failed=false
45427$at_check_filter
45428echo stderr:; cat "$at_stderr"
45429echo stdout:; cat "$at_stdout"
45430at_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"
45436at_fn_check_prepare_dynamic " $PREPARSER ./input0" "actions.at:1087"
45437( $at_check_trace;  $PREPARSER ./input0
45438) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45439at_status=$? at_failed=false
45440$at_check_filter
45441echo stderr:; tee stderr <"$at_stderr"
45442echo >>"$at_stdout"; $as_echo "<> for 'E' @ 1.
45443<> for 'S' @ 1.
45444" | \
45445  $at_diff - "$at_stdout" || at_failed=:
45446at_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"
45452at_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>&-
45455at_status=$? at_failed=false
45456$at_check_filter
45457echo >>"$at_stderr"; $as_echo "Starting parse
45458Entering state 0
45459Reducing stack by rule 1 (line 42):
45460-> \$\$ = nterm start (1.1: <> for 'S' @ 1)
45461Stack now 0
45462Entering state 1
45463Reading a token: Now at end of input.
45464Shifting token END (1.1: <> for 'E' @ 1)
45465Entering state 2
45466Stack now 0 1 2
45467Cleanup: popping token END (1.1: <> for 'E' @ 1)
45468Cleanup: popping nterm start (1.1: <> for 'S' @ 1)
45469" | \
45470  $at_diff - "$at_stderr" || at_failed=:
45471at_fn_diff_devnull "$at_stdout" || at_failed=:
45472at_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
45484cat >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>
45500static void yyerror ( const char *msg);
45501static 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
45526start: { $$ = 'S'; } ;
45527
45528%%
45529
45530static int
45531yylex (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.  */
45543static
45544void yyerror ( const char *msg)
45545{
45546  YY_LOCATION_PRINT (stderr, (yylloc));
45547  fprintf (stderr, ": ");
45548  fprintf (stderr, "%s\n", msg);
45549}
45550
45551int
45552main (void)
45553{
45554  yydebug = 1;
45555  return yyparse ();
45556}
45557_ATEOF
45558
45559
45560
45561
45562if 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"
45570at_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>&-
45574at_status=$? at_failed=false
45575$at_check_filter
45576echo stderr:; cat "$at_stderr"
45577echo stdout:; cat "$at_stdout"
45578at_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"
45584at_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>&-
45587at_status=$? at_failed=false
45588$at_check_filter
45589echo stderr:; cat "$at_stderr"
45590echo stdout:; cat "$at_stdout"
45591at_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"
45600at_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>&-
45605at_status=$? at_failed=false
45606$at_check_filter
45607at_fn_diff_devnull "$at_stderr" || at_failed=:
45608$at_diff expout "$at_stdout" || at_failed=:
45609at_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"
45618at_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>&-
45623at_status=$? at_failed=false
45624$at_check_filter
45625at_fn_diff_devnull "$at_stderr" || at_failed=:
45626$at_diff expout "$at_stdout" || at_failed=:
45627at_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
45633fi
45634{ set +x
45635$as_echo "$at_srcdir/actions.at:1088: bison -o input1.c input1.y"
45636at_fn_check_prepare_trace "actions.at:1088"
45637( $at_check_trace; bison -o input1.c input1.y
45638) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45639at_status=$? at_failed=false
45640$at_check_filter
45641at_fn_diff_devnull "$at_stderr" || at_failed=:
45642at_fn_diff_devnull "$at_stdout" || at_failed=:
45643at_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"
45650at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1088"
45651( $at_check_trace; $BISON_C_WORKS
45652) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45653at_status=$? at_failed=false
45654$at_check_filter
45655echo stderr:; cat "$at_stderr"
45656echo stdout:; cat "$at_stdout"
45657at_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"
45663at_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>&-
45666at_status=$? at_failed=false
45667$at_check_filter
45668echo stderr:; cat "$at_stderr"
45669echo stdout:; cat "$at_stdout"
45670at_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"
45676at_fn_check_prepare_dynamic " $PREPARSER ./input1" "actions.at:1088"
45677( $at_check_trace;  $PREPARSER ./input1
45678) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45679at_status=$? at_failed=false
45680$at_check_filter
45681echo stderr:; tee stderr <"$at_stderr"
45682echo >>"$at_stdout"; $as_echo "<*> for 'E' @ 1.
45683<*> for 'S' @ 1.
45684" | \
45685  $at_diff - "$at_stdout" || at_failed=:
45686at_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"
45692at_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>&-
45695at_status=$? at_failed=false
45696$at_check_filter
45697echo >>"$at_stderr"; $as_echo "Starting parse
45698Entering state 0
45699Reducing stack by rule 1 (line 42):
45700-> \$\$ = nterm start (1.1: <*> for 'S' @ 1)
45701Stack now 0
45702Entering state 1
45703Reading a token: Now at end of input.
45704Shifting token END (1.1: <*> for 'E' @ 1)
45705Entering state 2
45706Stack now 0 1 2
45707Cleanup: popping token END (1.1: <*> for 'E' @ 1)
45708Cleanup: popping nterm start (1.1: <*> for 'S' @ 1)
45709" | \
45710  $at_diff - "$at_stderr" || at_failed=:
45711at_fn_diff_devnull "$at_stdout" || at_failed=:
45712at_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
45725read at_status <"$at_status_file"
45726#AT_STOP_167
45727#AT_START_168
45728at_fn_group_banner 168 'actions.at:1098' \
45729  "Default %printer and %destructor are not for error or \$undefined" "" 9
45730at_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
45745cat >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>
45759static void yyerror ( const char *msg);
45760static 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
45773start:
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.  */
45783static
45784void yyerror ( const char *msg)
45785{
45786  fprintf (stderr, "%s\n", msg);
45787}
45788#include <assert.h>
45789static
45790int 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}
45801int
45802main (void)
45803{
45804  yydebug = 1;
45805  return yyparse ();
45806}
45807_ATEOF
45808
45809
45810
45811
45812if 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"
45820at_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>&-
45824at_status=$? at_failed=false
45825$at_check_filter
45826echo stderr:; cat "$at_stderr"
45827echo stdout:; cat "$at_stdout"
45828at_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"
45834at_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>&-
45837at_status=$? at_failed=false
45838$at_check_filter
45839echo stderr:; cat "$at_stderr"
45840echo stdout:; cat "$at_stdout"
45841at_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"
45850at_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>&-
45855at_status=$? at_failed=false
45856$at_check_filter
45857at_fn_diff_devnull "$at_stderr" || at_failed=:
45858$at_diff expout "$at_stdout" || at_failed=:
45859at_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"
45868at_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>&-
45873at_status=$? at_failed=false
45874$at_check_filter
45875at_fn_diff_devnull "$at_stderr" || at_failed=:
45876$at_diff expout "$at_stdout" || at_failed=:
45877at_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
45883fi
45884{ set +x
45885$as_echo "$at_srcdir/actions.at:1148: bison -o input.c input.y"
45886at_fn_check_prepare_trace "actions.at:1148"
45887( $at_check_trace; bison -o input.c input.y
45888) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45889at_status=$? at_failed=false
45890$at_check_filter
45891at_fn_diff_devnull "$at_stderr" || at_failed=:
45892at_fn_diff_devnull "$at_stdout" || at_failed=:
45893at_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"
45900at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1149"
45901( $at_check_trace; $BISON_C_WORKS
45902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45903at_status=$? at_failed=false
45904$at_check_filter
45905echo stderr:; cat "$at_stderr"
45906echo stdout:; cat "$at_stdout"
45907at_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"
45913at_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>&-
45916at_status=$? at_failed=false
45917$at_check_filter
45918echo stderr:; cat "$at_stderr"
45919echo stdout:; cat "$at_stdout"
45920at_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"
45926at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1150"
45927( $at_check_trace;  $PREPARSER ./input
45928) >>"$at_stdout" 2>>"$at_stderr" 5>&-
45929at_status=$? at_failed=false
45930$at_check_filter
45931echo stderr:; tee stderr <"$at_stderr"
45932at_fn_diff_devnull "$at_stdout" || at_failed=:
45933at_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"
45939at_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>&-
45942at_status=$? at_failed=false
45943$at_check_filter
45944echo >>"$at_stderr"; $as_echo "Starting parse
45945Entering state 0
45946Reading a token: Next token is token 'a' ('a')
45947Shifting token 'a' ('a')
45948Entering state 1
45949Reading a token: Next token is token 'b' ('b')
45950syntax error
45951Shifting token error ()
45952Entering state 3
45953Next token is token 'b' ('b')
45954Shifting token 'b' ('b')
45955Entering state 5
45956Reading a token: Next token is token \$undefined ()
45957Error: popping token 'b' ('b')
45958DESTROY 'b'
45959Stack now 0 1 3
45960Error: popping token error ()
45961Stack now 0 1
45962Shifting token error ()
45963Entering state 3
45964Next token is token \$undefined ()
45965Error: discarding token \$undefined ()
45966Error: popping token error ()
45967Stack now 0 1
45968Shifting token error ()
45969Entering state 3
45970Reading a token: Now at end of input.
45971Cleanup: discarding lookahead token \$end ()
45972Stack now 0 1 3
45973Cleanup: popping token error ()
45974Cleanup: popping token 'a' ('a')
45975DESTROY 'a'
45976" | \
45977  $at_diff - "$at_stderr" || at_failed=:
45978at_fn_diff_devnull "$at_stdout" || at_failed=:
45979at_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
45988read at_status <"$at_status_file"
45989#AT_STOP_168
45990#AT_START_169
45991at_fn_group_banner 169 'actions.at:1193' \
45992  "Default %printer and %destructor are not for \$accept" "" 9
45993at_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
46013cat >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>
46027static void yyerror ( const char *msg);
46028static 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
46046start: { USE($$); } ;
46047
46048%%
46049#include <stdio.h>
46050/* A C error reporting function.  */
46051static
46052void yyerror ( const char *msg)
46053{
46054  fprintf (stderr, "%s\n", msg);
46055}
46056#include <assert.h>
46057static
46058int 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}
46069int
46070main (void)
46071{
46072  return yyparse ();
46073}
46074_ATEOF
46075
46076
46077
46078
46079if 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"
46087at_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>&-
46091at_status=$? at_failed=false
46092$at_check_filter
46093echo stderr:; cat "$at_stderr"
46094echo stdout:; cat "$at_stdout"
46095at_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"
46101at_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>&-
46104at_status=$? at_failed=false
46105$at_check_filter
46106echo stderr:; cat "$at_stderr"
46107echo stdout:; cat "$at_stdout"
46108at_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"
46117at_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>&-
46122at_status=$? at_failed=false
46123$at_check_filter
46124at_fn_diff_devnull "$at_stderr" || at_failed=:
46125$at_diff expout "$at_stdout" || at_failed=:
46126at_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"
46135at_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>&-
46140at_status=$? at_failed=false
46141$at_check_filter
46142at_fn_diff_devnull "$at_stderr" || at_failed=:
46143$at_diff expout "$at_stdout" || at_failed=:
46144at_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
46150fi
46151{ set +x
46152$as_echo "$at_srcdir/actions.at:1247: bison -o input.c input.y"
46153at_fn_check_prepare_trace "actions.at:1247"
46154( $at_check_trace; bison -o input.c input.y
46155) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46156at_status=$? at_failed=false
46157$at_check_filter
46158at_fn_diff_devnull "$at_stderr" || at_failed=:
46159at_fn_diff_devnull "$at_stdout" || at_failed=:
46160at_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"
46167at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1248"
46168( $at_check_trace; $BISON_C_WORKS
46169) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46170at_status=$? at_failed=false
46171$at_check_filter
46172echo stderr:; cat "$at_stderr"
46173echo stdout:; cat "$at_stdout"
46174at_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"
46180at_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>&-
46183at_status=$? at_failed=false
46184$at_check_filter
46185echo stderr:; cat "$at_stderr"
46186echo stdout:; cat "$at_stdout"
46187at_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
46195read at_status <"$at_status_file"
46196#AT_STOP_169
46197#AT_START_170
46198at_fn_group_banner 170 'actions.at:1258' \
46199  "Default %printer and %destructor for mid-rule values" "" 9
46200at_xfail=no
46201(
46202  $as_echo "170. $at_setup_line: testing $at_desc ..."
46203  $at_traceon
46204
46205
46206
46207cat >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>
46221static void yyerror ( const char *msg);
46222static 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
46236start:
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.  */
46248static
46249void yyerror ( const char *msg)
46250{
46251  fprintf (stderr, "%s\n", msg);
46252}
46253#include <assert.h>
46254static
46255int 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}
46266int
46267main (void)
46268{
46269  yydebug = 1;
46270  return yyparse ();
46271}
46272_ATEOF
46273
46274
46275
46276
46277if 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"
46285at_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>&-
46289at_status=$? at_failed=false
46290$at_check_filter
46291echo stderr:; cat "$at_stderr"
46292echo stdout:; cat "$at_stdout"
46293at_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"
46299at_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>&-
46302at_status=$? at_failed=false
46303$at_check_filter
46304echo stderr:; cat "$at_stderr"
46305echo stdout:; cat "$at_stdout"
46306at_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"
46315at_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>&-
46320at_status=$? at_failed=false
46321$at_check_filter
46322at_fn_diff_devnull "$at_stderr" || at_failed=:
46323$at_diff expout "$at_stdout" || at_failed=:
46324at_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"
46333at_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>&-
46338at_status=$? at_failed=false
46339$at_check_filter
46340at_fn_diff_devnull "$at_stderr" || at_failed=:
46341$at_diff expout "$at_stdout" || at_failed=:
46342at_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
46348fi
46349{ set +x
46350$as_echo "$at_srcdir/actions.at:1303: bison -o input.c input.y"
46351at_fn_check_prepare_trace "actions.at:1303"
46352( $at_check_trace; bison -o input.c input.y
46353) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46354at_status=$? at_failed=false
46355$at_check_filter
46356echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$
46357input.y:32.3-23: warning: unused value: \$3
46358" | \
46359  $at_diff - "$at_stderr" || at_failed=:
46360at_fn_diff_devnull "$at_stdout" || at_failed=:
46361at_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.
46368if 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"
46377at_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>&-
46380at_status=$? at_failed=false
46381$at_check_filter
46382echo stderr:; tee stderr <"$at_stderr"
46383$at_diff expout "$at_stdout" || at_failed=:
46384at_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'
46392input.y:33.3-23: warning: unset value: $$
46393input.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"
46423at_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>&-
46427at_status=$? at_failed=false
46428$at_check_filter
46429$at_diff experr "$at_stderr" || at_failed=:
46430at_fn_diff_devnull "$at_stdout" || at_failed=:
46431at_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"
46440at_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>&-
46443at_status=$? at_failed=false
46444$at_check_filter
46445$at_diff experr "$at_stderr" || at_failed=:
46446$at_diff expout "$at_stdout" || at_failed=:
46447at_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"
46457at_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>&-
46460at_status=$? at_failed=false
46461$at_check_filter
46462at_fn_diff_devnull "$at_stderr" || at_failed=:
46463$at_diff expout "$at_stdout" || at_failed=:
46464at_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"
46470at_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>&-
46473at_status=$? at_failed=false
46474$at_check_filter
46475at_fn_diff_devnull "$at_stderr" || at_failed=:
46476$at_diff expout "$at_stdout" || at_failed=:
46477at_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
46483fi
46484
46485if 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"
46493at_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>&-
46497at_status=$? at_failed=false
46498$at_check_filter
46499echo stderr:; cat "$at_stderr"
46500echo stdout:; cat "$at_stdout"
46501at_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"
46507at_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>&-
46510at_status=$? at_failed=false
46511$at_check_filter
46512echo stderr:; cat "$at_stderr"
46513echo stdout:; cat "$at_stdout"
46514at_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"
46523at_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>&-
46528at_status=$? at_failed=false
46529$at_check_filter
46530at_fn_diff_devnull "$at_stderr" || at_failed=:
46531$at_diff expout "$at_stdout" || at_failed=:
46532at_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"
46541at_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>&-
46546at_status=$? at_failed=false
46547$at_check_filter
46548at_fn_diff_devnull "$at_stderr" || at_failed=:
46549$at_diff expout "$at_stdout" || at_failed=:
46550at_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
46556fi
46557{ set +x
46558$as_echo "$at_srcdir/actions.at:1308: bison -fcaret -o input.c input.y"
46559at_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>&-
46562at_status=$? at_failed=false
46563$at_check_filter
46564echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$
46565   {           @\$ = 4; } // Only used.
46566   ^^^^^^^^^^^^^^^^^^^^^
46567input.y:32.3-23: warning: unused value: \$3
46568   { USE (\$\$); @\$ = 3; } // Only set.
46569   ^^^^^^^^^^^^^^^^^^^^^
46570" | \
46571  $at_diff - "$at_stderr" || at_failed=:
46572at_fn_diff_devnull "$at_stdout" || at_failed=:
46573at_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.
46580if 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"
46589at_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>&-
46592at_status=$? at_failed=false
46593$at_check_filter
46594echo stderr:; tee stderr <"$at_stderr"
46595$at_diff expout "$at_stdout" || at_failed=:
46596at_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'
46604input.y:33.3-23: warning: unset value: $$
46605   {           @$ = 4; } // Only used.
46606   ^^^^^^^^^^^^^^^^^^^^^
46607input.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"
46639at_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>&-
46643at_status=$? at_failed=false
46644$at_check_filter
46645$at_diff experr "$at_stderr" || at_failed=:
46646at_fn_diff_devnull "$at_stdout" || at_failed=:
46647at_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"
46656at_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>&-
46659at_status=$? at_failed=false
46660$at_check_filter
46661$at_diff experr "$at_stderr" || at_failed=:
46662$at_diff expout "$at_stdout" || at_failed=:
46663at_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"
46673at_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>&-
46676at_status=$? at_failed=false
46677$at_check_filter
46678at_fn_diff_devnull "$at_stderr" || at_failed=:
46679$at_diff expout "$at_stdout" || at_failed=:
46680at_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"
46686at_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>&-
46689at_status=$? at_failed=false
46690$at_check_filter
46691at_fn_diff_devnull "$at_stderr" || at_failed=:
46692$at_diff expout "$at_stdout" || at_failed=:
46693at_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
46699fi
46700
46701{ set +x
46702$as_echo "$at_srcdir/actions.at:1317: \$BISON_C_WORKS"
46703at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1317"
46704( $at_check_trace; $BISON_C_WORKS
46705) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46706at_status=$? at_failed=false
46707$at_check_filter
46708echo stderr:; cat "$at_stderr"
46709echo stdout:; cat "$at_stdout"
46710at_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"
46716at_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>&-
46719at_status=$? at_failed=false
46720$at_check_filter
46721echo stderr:; cat "$at_stderr"
46722echo stdout:; cat "$at_stdout"
46723at_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"
46729at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1318"
46730( $at_check_trace;  $PREPARSER ./input
46731) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46732at_status=$? at_failed=false
46733$at_check_filter
46734echo stderr:; tee stderr <"$at_stderr"
46735at_fn_diff_devnull "$at_stdout" || at_failed=:
46736at_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"
46742at_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>&-
46745at_status=$? at_failed=false
46746$at_check_filter
46747echo >>"$at_stderr"; $as_echo "Starting parse
46748Entering state 0
46749Reducing stack by rule 1 (line 30):
46750-> \$\$ = nterm \$@1 (: )
46751Stack now 0
46752Entering state 2
46753Reducing stack by rule 2 (line 31):
46754-> \$\$ = nterm @2 (: 2)
46755Stack now 0 2
46756Entering state 4
46757Reducing stack by rule 3 (line 32):
46758-> \$\$ = nterm @3 (: 3)
46759Stack now 0 2 4
46760Entering state 5
46761Reducing stack by rule 4 (line 33):
46762-> \$\$ = nterm @4 (: 4)
46763Stack now 0 2 4 5
46764Entering state 6
46765Reading a token: Now at end of input.
46766syntax error
46767Error: popping nterm @4 (: 4)
46768DESTROY 4
46769Stack now 0 2 4 5
46770Error: popping nterm @3 (: 3)
46771DESTROY 3
46772Stack now 0 2 4
46773Error: popping nterm @2 (: 2)
46774DESTROY 2
46775Stack now 0 2
46776Error: popping nterm \$@1 (: )
46777Stack now 0
46778Cleanup: discarding lookahead token \$end (: )
46779Stack now 0
46780" | \
46781  $at_diff - "$at_stderr" || at_failed=:
46782at_fn_diff_devnull "$at_stdout" || at_failed=:
46783at_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
46792read at_status <"$at_status_file"
46793#AT_STOP_170
46794#AT_START_171
46795at_fn_group_banner 171 'actions.at:1406' \
46796  "@\$ in %initial-action implies %locations" "       " 9
46797at_xfail=no
46798(
46799  $as_echo "171. $at_setup_line: testing $at_desc ..."
46800  $at_traceon
46801
46802
46803cat >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>
46814static void yyerror ( const char *msg);
46815static int yylex (void);
46816}
46817
46818%debug
46819
46820%initial-action {
46821  fprintf (stderr, "%d\n", @$.first_line);
46822}
46823
46824%%
46825
46826start:  ;
46827
46828%%
46829
46830static int
46831yylex (void)
46832{
46833  return 0;
46834}
46835
46836#include <stdio.h>
46837/* A C error reporting function.  */
46838static
46839void yyerror ( const char *msg)
46840{
46841  fprintf (stderr, "%s\n", msg);
46842}
46843int
46844main (void)
46845{
46846  return yyparse ();
46847}
46848_ATEOF
46849
46850
46851
46852if 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"
46860at_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>&-
46864at_status=$? at_failed=false
46865$at_check_filter
46866echo stderr:; cat "$at_stderr"
46867echo stdout:; cat "$at_stdout"
46868at_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"
46874at_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>&-
46877at_status=$? at_failed=false
46878$at_check_filter
46879echo stderr:; cat "$at_stderr"
46880echo stdout:; cat "$at_stdout"
46881at_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"
46890at_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>&-
46895at_status=$? at_failed=false
46896$at_check_filter
46897at_fn_diff_devnull "$at_stderr" || at_failed=:
46898$at_diff expout "$at_stdout" || at_failed=:
46899at_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"
46908at_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>&-
46913at_status=$? at_failed=false
46914$at_check_filter
46915at_fn_diff_devnull "$at_stderr" || at_failed=:
46916$at_diff expout "$at_stdout" || at_failed=:
46917at_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
46923fi
46924{ set +x
46925$as_echo "$at_srcdir/actions.at:1406: bison -o input.c input.y"
46926at_fn_check_prepare_trace "actions.at:1406"
46927( $at_check_trace; bison -o input.c input.y
46928) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46929at_status=$? at_failed=false
46930$at_check_filter
46931at_fn_diff_devnull "$at_stderr" || at_failed=:
46932at_fn_diff_devnull "$at_stdout" || at_failed=:
46933at_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"
46940at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1406"
46941( $at_check_trace; $BISON_C_WORKS
46942) >>"$at_stdout" 2>>"$at_stderr" 5>&-
46943at_status=$? at_failed=false
46944$at_check_filter
46945echo stderr:; cat "$at_stderr"
46946echo stdout:; cat "$at_stdout"
46947at_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"
46953at_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>&-
46956at_status=$? at_failed=false
46957$at_check_filter
46958echo stderr:; cat "$at_stderr"
46959echo stdout:; cat "$at_stdout"
46960at_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
46968read at_status <"$at_status_file"
46969#AT_STOP_171
46970#AT_START_172
46971at_fn_group_banner 172 'actions.at:1407' \
46972  "@\$ in %destructor implies %locations" "           " 9
46973at_xfail=no
46974(
46975  $as_echo "172. $at_setup_line: testing $at_desc ..."
46976  $at_traceon
46977
46978
46979cat >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>
46990static void yyerror ( const char *msg);
46991static int yylex (void);
46992}
46993
46994%debug
46995
46996%destructor {
46997  fprintf (stderr, "%d\n", @$.first_line);
46998} start
46999
47000%%
47001
47002start:  ;
47003
47004%%
47005
47006static int
47007yylex (void)
47008{
47009  return 0;
47010}
47011
47012#include <stdio.h>
47013/* A C error reporting function.  */
47014static
47015void yyerror ( const char *msg)
47016{
47017  fprintf (stderr, "%s\n", msg);
47018}
47019int
47020main (void)
47021{
47022  return yyparse ();
47023}
47024_ATEOF
47025
47026
47027
47028if 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"
47036at_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>&-
47040at_status=$? at_failed=false
47041$at_check_filter
47042echo stderr:; cat "$at_stderr"
47043echo stdout:; cat "$at_stdout"
47044at_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"
47050at_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>&-
47053at_status=$? at_failed=false
47054$at_check_filter
47055echo stderr:; cat "$at_stderr"
47056echo stdout:; cat "$at_stdout"
47057at_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"
47066at_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>&-
47071at_status=$? at_failed=false
47072$at_check_filter
47073at_fn_diff_devnull "$at_stderr" || at_failed=:
47074$at_diff expout "$at_stdout" || at_failed=:
47075at_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"
47084at_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>&-
47089at_status=$? at_failed=false
47090$at_check_filter
47091at_fn_diff_devnull "$at_stderr" || at_failed=:
47092$at_diff expout "$at_stdout" || at_failed=:
47093at_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
47099fi
47100{ set +x
47101$as_echo "$at_srcdir/actions.at:1407: bison -o input.c input.y"
47102at_fn_check_prepare_trace "actions.at:1407"
47103( $at_check_trace; bison -o input.c input.y
47104) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47105at_status=$? at_failed=false
47106$at_check_filter
47107at_fn_diff_devnull "$at_stderr" || at_failed=:
47108at_fn_diff_devnull "$at_stdout" || at_failed=:
47109at_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"
47116at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1407"
47117( $at_check_trace; $BISON_C_WORKS
47118) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47119at_status=$? at_failed=false
47120$at_check_filter
47121echo stderr:; cat "$at_stderr"
47122echo stdout:; cat "$at_stdout"
47123at_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"
47129at_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>&-
47132at_status=$? at_failed=false
47133$at_check_filter
47134echo stderr:; cat "$at_stderr"
47135echo stdout:; cat "$at_stdout"
47136at_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
47144read at_status <"$at_status_file"
47145#AT_STOP_172
47146#AT_START_173
47147at_fn_group_banner 173 'actions.at:1408' \
47148  "@\$ in %printer implies %locations" "              " 9
47149at_xfail=no
47150(
47151  $as_echo "173. $at_setup_line: testing $at_desc ..."
47152  $at_traceon
47153
47154
47155cat >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>
47166static void yyerror ( const char *msg);
47167static int yylex (void);
47168}
47169
47170%debug
47171
47172%printer {
47173  fprintf (stderr, "%d\n", @$.first_line);
47174} start
47175
47176%%
47177
47178start:  ;
47179
47180%%
47181
47182static int
47183yylex (void)
47184{
47185  return 0;
47186}
47187
47188#include <stdio.h>
47189/* A C error reporting function.  */
47190static
47191void yyerror ( const char *msg)
47192{
47193  fprintf (stderr, "%s\n", msg);
47194}
47195int
47196main (void)
47197{
47198  return yyparse ();
47199}
47200_ATEOF
47201
47202
47203
47204if 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"
47212at_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>&-
47216at_status=$? at_failed=false
47217$at_check_filter
47218echo stderr:; cat "$at_stderr"
47219echo stdout:; cat "$at_stdout"
47220at_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"
47226at_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>&-
47229at_status=$? at_failed=false
47230$at_check_filter
47231echo stderr:; cat "$at_stderr"
47232echo stdout:; cat "$at_stdout"
47233at_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"
47242at_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>&-
47247at_status=$? at_failed=false
47248$at_check_filter
47249at_fn_diff_devnull "$at_stderr" || at_failed=:
47250$at_diff expout "$at_stdout" || at_failed=:
47251at_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"
47260at_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>&-
47265at_status=$? at_failed=false
47266$at_check_filter
47267at_fn_diff_devnull "$at_stderr" || at_failed=:
47268$at_diff expout "$at_stdout" || at_failed=:
47269at_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
47275fi
47276{ set +x
47277$as_echo "$at_srcdir/actions.at:1408: bison -o input.c input.y"
47278at_fn_check_prepare_trace "actions.at:1408"
47279( $at_check_trace; bison -o input.c input.y
47280) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47281at_status=$? at_failed=false
47282$at_check_filter
47283at_fn_diff_devnull "$at_stderr" || at_failed=:
47284at_fn_diff_devnull "$at_stdout" || at_failed=:
47285at_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"
47292at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1408"
47293( $at_check_trace; $BISON_C_WORKS
47294) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47295at_status=$? at_failed=false
47296$at_check_filter
47297echo stderr:; cat "$at_stderr"
47298echo stdout:; cat "$at_stdout"
47299at_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"
47305at_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>&-
47308at_status=$? at_failed=false
47309$at_check_filter
47310echo stderr:; cat "$at_stderr"
47311echo stdout:; cat "$at_stdout"
47312at_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
47320read at_status <"$at_status_file"
47321#AT_STOP_173
47322#AT_START_174
47323at_fn_group_banner 174 'actions.at:1529' \
47324  "Qualified \$\$ in actions: yacc.c" "                " 9
47325at_xfail=no
47326(
47327  $as_echo "174. $at_setup_line: testing $at_desc ..."
47328  $at_traceon
47329
47330
47331
47332
47333cat >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%%
47386float: 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.  */
47394static
47395void 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>
47402static
47403int 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}
47416int
47417main (void)
47418{
47419  yydebug = 1;
47420  return yyparse ();
47421}
47422_ATEOF
47423
47424
47425
47426if 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"
47434at_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>&-
47438at_status=$? at_failed=false
47439$at_check_filter
47440echo stderr:; cat "$at_stderr"
47441echo stdout:; cat "$at_stdout"
47442at_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"
47448at_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>&-
47451at_status=$? at_failed=false
47452$at_check_filter
47453echo stderr:; cat "$at_stderr"
47454echo stdout:; cat "$at_stdout"
47455at_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"
47464at_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>&-
47469at_status=$? at_failed=false
47470$at_check_filter
47471at_fn_diff_devnull "$at_stderr" || at_failed=:
47472$at_diff expout "$at_stdout" || at_failed=:
47473at_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"
47482at_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>&-
47487at_status=$? at_failed=false
47488$at_check_filter
47489at_fn_diff_devnull "$at_stderr" || at_failed=:
47490$at_diff expout "$at_stdout" || at_failed=:
47491at_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
47497fi
47498{ set +x
47499$as_echo "$at_srcdir/actions.at:1529: bison -o input.c input.y"
47500at_fn_check_prepare_trace "actions.at:1529"
47501( $at_check_trace; bison -o input.c input.y
47502) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47503at_status=$? at_failed=false
47504$at_check_filter
47505at_fn_diff_devnull "$at_stderr" || at_failed=:
47506at_fn_diff_devnull "$at_stdout" || at_failed=:
47507at_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"
47514at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1529"
47515( $at_check_trace; $BISON_C_WORKS
47516) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47517at_status=$? at_failed=false
47518$at_check_filter
47519echo stderr:; cat "$at_stderr"
47520echo stdout:; cat "$at_stdout"
47521at_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"
47527at_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>&-
47530at_status=$? at_failed=false
47531$at_check_filter
47532echo stderr:; cat "$at_stderr"
47533echo stdout:; cat "$at_stdout"
47534at_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"
47541at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1529"
47542( $at_check_trace;  $PREPARSER ./input
47543) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47544at_status=$? at_failed=false
47545$at_check_filter
47546echo stderr:; tee stderr <"$at_stderr"
47547at_fn_diff_devnull "$at_stdout" || at_failed=:
47548at_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"
47554at_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>&-
47557at_status=$? at_failed=false
47558$at_check_filter
47559echo stderr:; tee stderr <"$at_stderr"
47560at_fn_diff_devnull "$at_stdout" || at_failed=:
47561at_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"
47573at_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>&-
47576at_status=$? at_failed=false
47577$at_check_filter
47578at_fn_diff_devnull "$at_stderr" || at_failed=:
47579echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
47580Shifting token UNTYPED (ival: 10, fval: 0.1)
47581Reading a token: Next token is token INT (ival: 20, fval: 0.2)
47582Shifting 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)
47586Cleanup: popping nterm float (ival: 30, fval: 0.3)
47587" | \
47588  $at_diff - "$at_stdout" || at_failed=:
47589at_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
47599read at_status <"$at_status_file"
47600#AT_STOP_174
47601#AT_START_175
47602at_fn_group_banner 175 'actions.at:1530' \
47603  "Qualified \$\$ in actions: glr.c" "                 " 9
47604at_xfail=no
47605(
47606  $as_echo "175. $at_setup_line: testing $at_desc ..."
47607  $at_traceon
47608
47609
47610
47611
47612cat >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%%
47665float: 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.  */
47673static
47674void 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>
47681static
47682int 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}
47695int
47696main (void)
47697{
47698  yydebug = 1;
47699  return yyparse ();
47700}
47701_ATEOF
47702
47703
47704
47705if 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"
47713at_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>&-
47717at_status=$? at_failed=false
47718$at_check_filter
47719echo stderr:; cat "$at_stderr"
47720echo stdout:; cat "$at_stdout"
47721at_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"
47727at_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>&-
47730at_status=$? at_failed=false
47731$at_check_filter
47732echo stderr:; cat "$at_stderr"
47733echo stdout:; cat "$at_stdout"
47734at_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"
47743at_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>&-
47748at_status=$? at_failed=false
47749$at_check_filter
47750at_fn_diff_devnull "$at_stderr" || at_failed=:
47751$at_diff expout "$at_stdout" || at_failed=:
47752at_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"
47761at_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>&-
47766at_status=$? at_failed=false
47767$at_check_filter
47768at_fn_diff_devnull "$at_stderr" || at_failed=:
47769$at_diff expout "$at_stdout" || at_failed=:
47770at_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
47776fi
47777{ set +x
47778$as_echo "$at_srcdir/actions.at:1530: bison -o input.c input.y"
47779at_fn_check_prepare_trace "actions.at:1530"
47780( $at_check_trace; bison -o input.c input.y
47781) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47782at_status=$? at_failed=false
47783$at_check_filter
47784at_fn_diff_devnull "$at_stderr" || at_failed=:
47785at_fn_diff_devnull "$at_stdout" || at_failed=:
47786at_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"
47793at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1530"
47794( $at_check_trace; $BISON_C_WORKS
47795) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47796at_status=$? at_failed=false
47797$at_check_filter
47798echo stderr:; cat "$at_stderr"
47799echo stdout:; cat "$at_stdout"
47800at_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"
47806at_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>&-
47809at_status=$? at_failed=false
47810$at_check_filter
47811echo stderr:; cat "$at_stderr"
47812echo stdout:; cat "$at_stdout"
47813at_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"
47820at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1530"
47821( $at_check_trace;  $PREPARSER ./input
47822) >>"$at_stdout" 2>>"$at_stderr" 5>&-
47823at_status=$? at_failed=false
47824$at_check_filter
47825echo stderr:; tee stderr <"$at_stderr"
47826at_fn_diff_devnull "$at_stdout" || at_failed=:
47827at_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"
47833at_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>&-
47836at_status=$? at_failed=false
47837$at_check_filter
47838echo stderr:; tee stderr <"$at_stderr"
47839at_fn_diff_devnull "$at_stdout" || at_failed=:
47840at_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"
47852at_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>&-
47855at_status=$? at_failed=false
47856$at_check_filter
47857at_fn_diff_devnull "$at_stderr" || at_failed=:
47858echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
47859Shifting token UNTYPED (ival: 10, fval: 0.1)
47860Reading a token: Next token is token INT (ival: 20, fval: 0.2)
47861Shifting 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)
47865Cleanup: popping nterm float (ival: 30, fval: 0.3)
47866" | \
47867  $at_diff - "$at_stdout" || at_failed=:
47868at_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
47878read at_status <"$at_status_file"
47879#AT_STOP_175
47880#AT_START_176
47881at_fn_group_banner 176 'actions.at:1531' \
47882  "Qualified \$\$ in actions: lalr1.cc" "              " 9
47883at_xfail=no
47884(
47885  $as_echo "176. $at_setup_line: testing $at_desc ..."
47886  $at_traceon
47887
47888
47889
47890
47891cat >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%%
47944float: UNTYPED INT
47945{
47946  $$       = $<fval>1 + $<fval>2;
47947  $<ival>$ = $<ival>1 + $2;
47948};
47949%%
47950/* A C++ error reporting function.  */
47951void
47952yy::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>
47958static
47959int 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}
47974int
47975main (void)
47976{
47977  yy::parser p;
47978  p.set_debug_level(1);
47979  return p.parse ();
47980}
47981_ATEOF
47982
47983
47984
47985if 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"
47993at_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>&-
47997at_status=$? at_failed=false
47998$at_check_filter
47999echo stderr:; cat "$at_stderr"
48000echo stdout:; cat "$at_stdout"
48001at_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"
48007at_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>&-
48010at_status=$? at_failed=false
48011$at_check_filter
48012echo stderr:; cat "$at_stderr"
48013echo stdout:; cat "$at_stdout"
48014at_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"
48023at_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>&-
48028at_status=$? at_failed=false
48029$at_check_filter
48030at_fn_diff_devnull "$at_stderr" || at_failed=:
48031$at_diff expout "$at_stdout" || at_failed=:
48032at_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"
48041at_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>&-
48046at_status=$? at_failed=false
48047$at_check_filter
48048at_fn_diff_devnull "$at_stderr" || at_failed=:
48049$at_diff expout "$at_stdout" || at_failed=:
48050at_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
48056fi
48057{ set +x
48058$as_echo "$at_srcdir/actions.at:1531: bison -o input.cc input.y"
48059at_fn_check_prepare_trace "actions.at:1531"
48060( $at_check_trace; bison -o input.cc input.y
48061) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48062at_status=$? at_failed=false
48063$at_check_filter
48064at_fn_diff_devnull "$at_stderr" || at_failed=:
48065at_fn_diff_devnull "$at_stdout" || at_failed=:
48066at_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"
48074at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1531"
48075( $at_check_trace; $BISON_CXX_WORKS
48076) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48077at_status=$? at_failed=false
48078$at_check_filter
48079echo stderr:; cat "$at_stderr"
48080echo stdout:; cat "$at_stdout"
48081at_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"
48087at_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>&-
48090at_status=$? at_failed=false
48091$at_check_filter
48092echo stderr:; cat "$at_stderr"
48093echo stdout:; cat "$at_stdout"
48094at_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"
48101at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1531"
48102( $at_check_trace;  $PREPARSER ./input
48103) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48104at_status=$? at_failed=false
48105$at_check_filter
48106echo stderr:; tee stderr <"$at_stderr"
48107at_fn_diff_devnull "$at_stdout" || at_failed=:
48108at_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"
48114at_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>&-
48117at_status=$? at_failed=false
48118$at_check_filter
48119echo stderr:; tee stderr <"$at_stderr"
48120at_fn_diff_devnull "$at_stdout" || at_failed=:
48121at_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"
48133at_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>&-
48136at_status=$? at_failed=false
48137$at_check_filter
48138at_fn_diff_devnull "$at_stderr" || at_failed=:
48139echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
48140Shifting token UNTYPED (ival: 10, fval: 0.1)
48141Reading a token: Next token is token INT (ival: 20, fval: 0.2)
48142Shifting 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)
48146Cleanup: popping nterm float (ival: 30, fval: 0.3)
48147" | \
48148  $at_diff - "$at_stdout" || at_failed=:
48149at_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
48159read at_status <"$at_status_file"
48160#AT_STOP_176
48161#AT_START_177
48162at_fn_group_banner 177 'actions.at:1532' \
48163  "Qualified \$\$ in actions: glr.cc" "                " 9
48164at_xfail=no
48165(
48166  $as_echo "177. $at_setup_line: testing $at_desc ..."
48167  $at_traceon
48168
48169
48170
48171
48172cat >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%%
48225float: UNTYPED INT
48226{
48227  $$       = $<fval>1 + $<fval>2;
48228  $<ival>$ = $<ival>1 + $2;
48229};
48230%%
48231/* A C++ error reporting function.  */
48232void
48233yy::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>
48239static
48240int 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}
48255int
48256main (void)
48257{
48258  yy::parser p;
48259  p.set_debug_level(1);
48260  return p.parse ();
48261}
48262_ATEOF
48263
48264
48265
48266if 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"
48274at_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>&-
48278at_status=$? at_failed=false
48279$at_check_filter
48280echo stderr:; cat "$at_stderr"
48281echo stdout:; cat "$at_stdout"
48282at_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"
48288at_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>&-
48291at_status=$? at_failed=false
48292$at_check_filter
48293echo stderr:; cat "$at_stderr"
48294echo stdout:; cat "$at_stdout"
48295at_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"
48304at_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>&-
48309at_status=$? at_failed=false
48310$at_check_filter
48311at_fn_diff_devnull "$at_stderr" || at_failed=:
48312$at_diff expout "$at_stdout" || at_failed=:
48313at_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"
48322at_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>&-
48327at_status=$? at_failed=false
48328$at_check_filter
48329at_fn_diff_devnull "$at_stderr" || at_failed=:
48330$at_diff expout "$at_stdout" || at_failed=:
48331at_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
48337fi
48338{ set +x
48339$as_echo "$at_srcdir/actions.at:1532: bison -o input.cc input.y"
48340at_fn_check_prepare_trace "actions.at:1532"
48341( $at_check_trace; bison -o input.cc input.y
48342) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48343at_status=$? at_failed=false
48344$at_check_filter
48345at_fn_diff_devnull "$at_stderr" || at_failed=:
48346at_fn_diff_devnull "$at_stdout" || at_failed=:
48347at_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"
48355at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1532"
48356( $at_check_trace; $BISON_CXX_WORKS
48357) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48358at_status=$? at_failed=false
48359$at_check_filter
48360echo stderr:; cat "$at_stderr"
48361echo stdout:; cat "$at_stdout"
48362at_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"
48368at_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>&-
48371at_status=$? at_failed=false
48372$at_check_filter
48373echo stderr:; cat "$at_stderr"
48374echo stdout:; cat "$at_stdout"
48375at_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"
48382at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1532"
48383( $at_check_trace;  $PREPARSER ./input
48384) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48385at_status=$? at_failed=false
48386$at_check_filter
48387echo stderr:; tee stderr <"$at_stderr"
48388at_fn_diff_devnull "$at_stdout" || at_failed=:
48389at_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"
48395at_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>&-
48398at_status=$? at_failed=false
48399$at_check_filter
48400echo stderr:; tee stderr <"$at_stderr"
48401at_fn_diff_devnull "$at_stdout" || at_failed=:
48402at_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"
48414at_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>&-
48417at_status=$? at_failed=false
48418$at_check_filter
48419at_fn_diff_devnull "$at_stderr" || at_failed=:
48420echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
48421Shifting token UNTYPED (ival: 10, fval: 0.1)
48422Reading a token: Next token is token INT (ival: 20, fval: 0.2)
48423Shifting 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)
48427Cleanup: popping nterm float (ival: 30, fval: 0.3)
48428" | \
48429  $at_diff - "$at_stdout" || at_failed=:
48430at_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
48440read at_status <"$at_status_file"
48441#AT_STOP_177
48442#AT_START_178
48443at_fn_group_banner 178 'actions.at:1540' \
48444  "Fix user actions without a trailing semicolon" "  " 9
48445at_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
48455cat >input.y <<'_ATEOF'
48456%%
48457start: test2 test1 test0 testc;
48458
48459test2
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;
48470test1
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} ;
48481test0
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
48493testc
48494: 'a' {
48495#define TEST_MACRO_N \
48496[]"broken\" $ @ $$ @$ [];\
48497string;"}
48498| 'b' {
48499no_semi
48500#define TEST_MACRO_N \
48501[]"broken\" $ @ $$ @$ [];\
48502string;"}
48503_ATEOF
48504
48505
48506
48507if 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"
48515at_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>&-
48519at_status=$? at_failed=false
48520$at_check_filter
48521echo stderr:; cat "$at_stderr"
48522echo stdout:; cat "$at_stdout"
48523at_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"
48529at_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>&-
48532at_status=$? at_failed=false
48533$at_check_filter
48534echo stderr:; cat "$at_stderr"
48535echo stdout:; cat "$at_stdout"
48536at_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"
48545at_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>&-
48550at_status=$? at_failed=false
48551$at_check_filter
48552at_fn_diff_devnull "$at_stderr" || at_failed=:
48553$at_diff expout "$at_stdout" || at_failed=:
48554at_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"
48563at_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>&-
48568at_status=$? at_failed=false
48569$at_check_filter
48570at_fn_diff_devnull "$at_stderr" || at_failed=:
48571$at_diff expout "$at_stdout" || at_failed=:
48572at_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
48578fi
48579{ set +x
48580$as_echo "$at_srcdir/actions.at:1597: bison -o input.c input.y"
48581at_fn_check_prepare_trace "actions.at:1597"
48582( $at_check_trace; bison -o input.c input.y
48583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48584at_status=$? at_failed=false
48585$at_check_filter
48586echo >>"$at_stderr"; $as_echo "input.y:8.48: warning: a ';' might be needed at the end of action code
48587input.y:8.48:     future versions of Bison will not add the ';'
48588input.y:9.48: warning: a ';' might be needed at the end of action code
48589input.y:9.48:     future versions of Bison will not add the ';'
48590input.y:10.48: warning: a ';' might be needed at the end of action code
48591input.y:10.48:     future versions of Bison will not add the ';'
48592input.y:11.48: warning: a ';' might be needed at the end of action code
48593input.y:11.48:     future versions of Bison will not add the ';'
48594input.y:12.48: warning: a ';' might be needed at the end of action code
48595input.y:12.48:     future versions of Bison will not add the ';'
48596input.y:13.48: warning: a ';' might be needed at the end of action code
48597input.y:13.48:     future versions of Bison will not add the ';'
48598input.y:20.1: warning: a ';' might be needed at the end of action code
48599input.y:20.1:     future versions of Bison will not add the ';'
48600input.y:21.1: warning: a ';' might be needed at the end of action code
48601input.y:21.1:     future versions of Bison will not add the ';'
48602input.y:22.1: warning: a ';' might be needed at the end of action code
48603input.y:22.1:     future versions of Bison will not add the ';'
48604input.y:23.1: warning: a ';' might be needed at the end of action code
48605input.y:23.1:     future versions of Bison will not add the ';'
48606input.y:24.1: warning: a ';' might be needed at the end of action code
48607input.y:24.1:     future versions of Bison will not add the ';'
48608input.y:25.1: warning: a ';' might be needed at the end of action code
48609input.y:25.1:     future versions of Bison will not add the ';'
48610input.y:31.1: warning: a ';' might be needed at the end of action code
48611input.y:31.1:     future versions of Bison will not add the ';'
48612input.y:32.1: warning: a ';' might be needed at the end of action code
48613input.y:32.1:     future versions of Bison will not add the ';'
48614input.y:33.1: warning: a ';' might be needed at the end of action code
48615input.y:33.1:     future versions of Bison will not add the ';'
48616input.y:34.1: warning: a ';' might be needed at the end of action code
48617input.y:34.1:     future versions of Bison will not add the ';'
48618input.y:35.1: warning: a ';' might be needed at the end of action code
48619input.y:35.1:     future versions of Bison will not add the ';'
48620input.y:36.1: warning: a ';' might be needed at the end of action code
48621input.y:36.1:     future versions of Bison will not add the ';'
48622" | \
48623  $at_diff - "$at_stderr" || at_failed=:
48624at_fn_diff_devnull "$at_stdout" || at_failed=:
48625at_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.
48632if 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"
48641at_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>&-
48644at_status=$? at_failed=false
48645$at_check_filter
48646echo stderr:; tee stderr <"$at_stderr"
48647$at_diff expout "$at_stdout" || at_failed=:
48648at_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'
48656input.y:8.48: warning: a ';' might be needed at the end of action code
48657input.y:8.48:     future versions of Bison will not add the ';'
48658input.y:9.48: warning: a ';' might be needed at the end of action code
48659input.y:9.48:     future versions of Bison will not add the ';'
48660input.y:10.48: warning: a ';' might be needed at the end of action code
48661input.y:10.48:     future versions of Bison will not add the ';'
48662input.y:11.48: warning: a ';' might be needed at the end of action code
48663input.y:11.48:     future versions of Bison will not add the ';'
48664input.y:12.48: warning: a ';' might be needed at the end of action code
48665input.y:12.48:     future versions of Bison will not add the ';'
48666input.y:13.48: warning: a ';' might be needed at the end of action code
48667input.y:13.48:     future versions of Bison will not add the ';'
48668input.y:20.1: warning: a ';' might be needed at the end of action code
48669input.y:20.1:     future versions of Bison will not add the ';'
48670input.y:21.1: warning: a ';' might be needed at the end of action code
48671input.y:21.1:     future versions of Bison will not add the ';'
48672input.y:22.1: warning: a ';' might be needed at the end of action code
48673input.y:22.1:     future versions of Bison will not add the ';'
48674input.y:23.1: warning: a ';' might be needed at the end of action code
48675input.y:23.1:     future versions of Bison will not add the ';'
48676input.y:24.1: warning: a ';' might be needed at the end of action code
48677input.y:24.1:     future versions of Bison will not add the ';'
48678input.y:25.1: warning: a ';' might be needed at the end of action code
48679input.y:25.1:     future versions of Bison will not add the ';'
48680input.y:31.1: warning: a ';' might be needed at the end of action code
48681input.y:31.1:     future versions of Bison will not add the ';'
48682input.y:32.1: warning: a ';' might be needed at the end of action code
48683input.y:32.1:     future versions of Bison will not add the ';'
48684input.y:33.1: warning: a ';' might be needed at the end of action code
48685input.y:33.1:     future versions of Bison will not add the ';'
48686input.y:34.1: warning: a ';' might be needed at the end of action code
48687input.y:34.1:     future versions of Bison will not add the ';'
48688input.y:35.1: warning: a ';' might be needed at the end of action code
48689input.y:35.1:     future versions of Bison will not add the ';'
48690input.y:36.1: warning: a ';' might be needed at the end of action code
48691input.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"
48721at_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>&-
48725at_status=$? at_failed=false
48726$at_check_filter
48727$at_diff experr "$at_stderr" || at_failed=:
48728at_fn_diff_devnull "$at_stdout" || at_failed=:
48729at_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"
48738at_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>&-
48741at_status=$? at_failed=false
48742$at_check_filter
48743$at_diff experr "$at_stderr" || at_failed=:
48744$at_diff expout "$at_stdout" || at_failed=:
48745at_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"
48755at_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>&-
48758at_status=$? at_failed=false
48759$at_check_filter
48760at_fn_diff_devnull "$at_stderr" || at_failed=:
48761$at_diff expout "$at_stdout" || at_failed=:
48762at_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"
48768at_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>&-
48771at_status=$? at_failed=false
48772$at_check_filter
48773at_fn_diff_devnull "$at_stderr" || at_failed=:
48774$at_diff expout "$at_stdout" || at_failed=:
48775at_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
48781fi
48782
48783{ set +x
48784$as_echo "$at_srcdir/actions.at:1636: \$PERL -0777 -ne '
48785my \$count = 0;
48786s{/\\* TEST:N:2 \\*/ \\}\$}{ ++\$count; \"\" }gem;
48787printf \"\$count\\n\";' input.c"
48788at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1636"
48789( $at_check_trace; $PERL -0777 -ne '
48790my $count = 0;
48791s{/\* TEST:N:2 \*/ \}$}{ ++$count; "" }gem;
48792printf "$count\n";' input.c
48793) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48794at_status=$? at_failed=false
48795$at_check_filter
48796at_fn_diff_devnull "$at_stderr" || at_failed=:
48797echo >>"$at_stdout"; $as_echo "3
48798" | \
48799  $at_diff - "$at_stdout" || at_failed=:
48800at_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 '
48806my \$count = 0;
48807s{/\\* TEST:Y:2 \\*/ ;\\}\$}{ ++\$count; \"\" }gem;
48808printf \"\$count\\n\";' input.c"
48809at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1637"
48810( $at_check_trace; $PERL -0777 -ne '
48811my $count = 0;
48812s{/\* TEST:Y:2 \*/ ;\}$}{ ++$count; "" }gem;
48813printf "$count\n";' input.c
48814) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48815at_status=$? at_failed=false
48816$at_check_filter
48817at_fn_diff_devnull "$at_stderr" || at_failed=:
48818echo >>"$at_stdout"; $as_echo "6
48819" | \
48820  $at_diff - "$at_stdout" || at_failed=:
48821at_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 '
48827my \$count = 0;
48828s{// TEST:N:1 [;{}]*\\n\\}\$}{ ++\$count; \"\" }gem;
48829printf \"\$count\\n\";' input.c"
48830at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1638"
48831( $at_check_trace; $PERL -0777 -ne '
48832my $count = 0;
48833s{// TEST:N:1 [;{}]*\n\}$}{ ++$count; "" }gem;
48834printf "$count\n";' input.c
48835) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48836at_status=$? at_failed=false
48837$at_check_filter
48838at_fn_diff_devnull "$at_stderr" || at_failed=:
48839echo >>"$at_stdout"; $as_echo "6
48840" | \
48841  $at_diff - "$at_stdout" || at_failed=:
48842at_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 '
48848my \$count = 0;
48849s{// TEST:Y:1 [;{}]*\\n;\\}\$}{ ++\$count; \"\" }gem;
48850printf \"\$count\\n\";' input.c"
48851at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1639"
48852( $at_check_trace; $PERL -0777 -ne '
48853my $count = 0;
48854s{// TEST:Y:1 [;{}]*\n;\}$}{ ++$count; "" }gem;
48855printf "$count\n";' input.c
48856) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48857at_status=$? at_failed=false
48858$at_check_filter
48859at_fn_diff_devnull "$at_stderr" || at_failed=:
48860echo >>"$at_stdout"; $as_echo "12
48861" | \
48862  $at_diff - "$at_stdout" || at_failed=:
48863at_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 '
48869my \$count = 0;
48870s{#define TEST_MACRO_N \\\\\\n\\[\\]\"broken\\\\\" \\\$ \\@ \\\$\\\$ \\@\\\$ \\[\\];\\\\\\nstring;\"\\}}{ ++\$count; \"\" }gem;
48871printf \"\$count\\n\";' input.c"
48872at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1640"
48873( $at_check_trace; $PERL -0777 -ne '
48874my $count = 0;
48875s{#define TEST_MACRO_N \\\n\[\]"broken\\" \$ \@ \$\$ \@\$ \[\];\\\nstring;"\}}{ ++$count; "" }gem;
48876printf "$count\n";' input.c
48877) >>"$at_stdout" 2>>"$at_stderr" 5>&-
48878at_status=$? at_failed=false
48879$at_check_filter
48880at_fn_diff_devnull "$at_stderr" || at_failed=:
48881echo >>"$at_stdout"; $as_echo "2
48882" | \
48883  $at_diff - "$at_stdout" || at_failed=:
48884at_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
48892read at_status <"$at_status_file"
48893#AT_STOP_178
48894#AT_START_179
48895at_fn_group_banner 179 'actions.at:1649' \
48896  "Destroying lookahead assigned by semantic action" "" 9
48897at_xfail=no
48898(
48899  $as_echo "179. $at_setup_line: testing $at_desc ..."
48900  $at_traceon
48901
48902
48903
48904cat >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>
48917static void yyerror ( const char *msg);
48918static 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.
48938start: 'a' accept { USE($1); } ;
48939accept: /*empty*/ {
48940  assert (yychar == YYEMPTY);
48941  yychar = 'b';
48942  YYACCEPT;
48943} ;
48944
48945%%
48946#include <stdio.h>
48947/* A C error reporting function.  */
48948static
48949void yyerror ( const char *msg)
48950{
48951  fprintf (stderr, "%s\n", msg);
48952}
48953#include <assert.h>
48954static
48955int 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}
48966int
48967main (void)
48968{
48969  return yyparse ();
48970}
48971_ATEOF
48972
48973
48974
48975if 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"
48983at_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>&-
48987at_status=$? at_failed=false
48988$at_check_filter
48989echo stderr:; cat "$at_stderr"
48990echo stdout:; cat "$at_stdout"
48991at_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"
48997at_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>&-
49000at_status=$? at_failed=false
49001$at_check_filter
49002echo stderr:; cat "$at_stderr"
49003echo stdout:; cat "$at_stdout"
49004at_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"
49013at_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>&-
49018at_status=$? at_failed=false
49019$at_check_filter
49020at_fn_diff_devnull "$at_stderr" || at_failed=:
49021$at_diff expout "$at_stdout" || at_failed=:
49022at_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"
49031at_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>&-
49036at_status=$? at_failed=false
49037$at_check_filter
49038at_fn_diff_devnull "$at_stderr" || at_failed=:
49039$at_diff expout "$at_stdout" || at_failed=:
49040at_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
49046fi
49047{ set +x
49048$as_echo "$at_srcdir/actions.at:1695: bison -o input.c input.y"
49049at_fn_check_prepare_trace "actions.at:1695"
49050( $at_check_trace; bison -o input.c input.y
49051) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49052at_status=$? at_failed=false
49053$at_check_filter
49054at_fn_diff_devnull "$at_stderr" || at_failed=:
49055at_fn_diff_devnull "$at_stdout" || at_failed=:
49056at_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"
49063at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1696"
49064( $at_check_trace; $BISON_C_WORKS
49065) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49066at_status=$? at_failed=false
49067$at_check_filter
49068echo stderr:; cat "$at_stderr"
49069echo stdout:; cat "$at_stdout"
49070at_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"
49076at_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>&-
49079at_status=$? at_failed=false
49080$at_check_filter
49081echo stderr:; cat "$at_stderr"
49082echo stdout:; cat "$at_stdout"
49083at_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"
49089at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1697"
49090( $at_check_trace;  $PREPARSER ./input
49091) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49092at_status=$? at_failed=false
49093$at_check_filter
49094echo stderr:; tee stderr <"$at_stderr"
49095at_fn_diff_devnull "$at_stdout" || at_failed=:
49096at_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"
49102at_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>&-
49105at_status=$? at_failed=false
49106$at_check_filter
49107echo >>"$at_stderr"; $as_echo "'b' destructor
49108'a' destructor
49109" | \
49110  $at_diff - "$at_stderr" || at_failed=:
49111at_fn_diff_devnull "$at_stdout" || at_failed=:
49112at_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
49121read at_status <"$at_status_file"
49122#AT_STOP_179
49123#AT_START_180
49124at_fn_group_banner 180 'actions.at:1708' \
49125  "YYBACKUP" "                                       " 9
49126at_xfail=no
49127(
49128  $as_echo "180. $at_setup_line: testing $at_desc ..."
49129  $at_traceon
49130
49131
49132
49133
49134cat >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%%
49156input:
49157  exp exp {}
49158;
49159
49160exp:
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.  */
49169static
49170void yyerror ( const char *msg)
49171{
49172  fprintf (stderr, "%s\n", msg);
49173}
49174#include <assert.h>
49175static
49176int 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
49188int
49189main (void)
49190{
49191  yydebug = !!getenv("YYDEBUG");
49192  return yyparse ();
49193}
49194_ATEOF
49195
49196
49197
49198
49199if 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"
49207at_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>&-
49211at_status=$? at_failed=false
49212$at_check_filter
49213echo stderr:; cat "$at_stderr"
49214echo stdout:; cat "$at_stdout"
49215at_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"
49221at_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>&-
49224at_status=$? at_failed=false
49225$at_check_filter
49226echo stderr:; cat "$at_stderr"
49227echo stdout:; cat "$at_stdout"
49228at_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"
49237at_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>&-
49242at_status=$? at_failed=false
49243$at_check_filter
49244at_fn_diff_devnull "$at_stderr" || at_failed=:
49245$at_diff expout "$at_stdout" || at_failed=:
49246at_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"
49255at_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>&-
49260at_status=$? at_failed=false
49261$at_check_filter
49262at_fn_diff_devnull "$at_stderr" || at_failed=:
49263$at_diff expout "$at_stdout" || at_failed=:
49264at_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
49270fi
49271{ set +x
49272$as_echo "$at_srcdir/actions.at:1749: bison -o input.c input.y"
49273at_fn_check_prepare_trace "actions.at:1749"
49274( $at_check_trace; bison -o input.c input.y
49275) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49276at_status=$? at_failed=false
49277$at_check_filter
49278at_fn_diff_devnull "$at_stderr" || at_failed=:
49279at_fn_diff_devnull "$at_stdout" || at_failed=:
49280at_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"
49287at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1750"
49288( $at_check_trace; $BISON_C_WORKS
49289) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49290at_status=$? at_failed=false
49291$at_check_filter
49292echo stderr:; cat "$at_stderr"
49293echo stdout:; cat "$at_stdout"
49294at_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"
49300at_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>&-
49303at_status=$? at_failed=false
49304$at_check_filter
49305echo stderr:; cat "$at_stderr"
49306echo stdout:; cat "$at_stdout"
49307at_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"
49313at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1751"
49314( $at_check_trace;  $PREPARSER ./input
49315) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49316at_status=$? at_failed=false
49317$at_check_filter
49318echo stderr:; tee stderr <"$at_stderr"
49319echo >>"$at_stdout"; $as_echo "a: 123
49320a: 456
49321" | \
49322  $at_diff - "$at_stdout" || at_failed=:
49323at_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"
49329at_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>&-
49332at_status=$? at_failed=false
49333$at_check_filter
49334at_fn_diff_devnull "$at_stderr" || at_failed=:
49335at_fn_diff_devnull "$at_stdout" || at_failed=:
49336at_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
49345read at_status <"$at_status_file"
49346#AT_STOP_180
49347#AT_START_181
49348at_fn_group_banner 181 'conflicts.at:31' \
49349  "S/R in initial" "                                 " 10
49350at_xfail=no
49351(
49352  $as_echo "181. $at_setup_line: testing $at_desc ..."
49353  $at_traceon
49354
49355
49356cat >input.y <<'_ATEOF'
49357%expect 1
49358%%
49359exp: e 'e';
49360e: 'e' | /* Nothing. */;
49361_ATEOF
49362
49363
49364if 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"
49372at_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>&-
49376at_status=$? at_failed=false
49377$at_check_filter
49378echo stderr:; cat "$at_stderr"
49379echo stdout:; cat "$at_stdout"
49380at_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"
49386at_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>&-
49389at_status=$? at_failed=false
49390$at_check_filter
49391echo stderr:; cat "$at_stderr"
49392echo stdout:; cat "$at_stdout"
49393at_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"
49402at_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>&-
49407at_status=$? at_failed=false
49408$at_check_filter
49409at_fn_diff_devnull "$at_stderr" || at_failed=:
49410$at_diff expout "$at_stdout" || at_failed=:
49411at_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"
49420at_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>&-
49425at_status=$? at_failed=false
49426$at_check_filter
49427at_fn_diff_devnull "$at_stderr" || at_failed=:
49428$at_diff expout "$at_stdout" || at_failed=:
49429at_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
49435fi
49436{ set +x
49437$as_echo "$at_srcdir/conflicts.at:40: bison -o input.c input.y"
49438at_fn_check_prepare_trace "conflicts.at:40"
49439( $at_check_trace; bison -o input.c input.y
49440) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49441at_status=$? at_failed=false
49442$at_check_filter
49443echo >>"$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=:
49446at_fn_diff_devnull "$at_stdout" || at_failed=:
49447at_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.
49454if 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"
49463at_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>&-
49466at_status=$? at_failed=false
49467$at_check_filter
49468echo stderr:; tee stderr <"$at_stderr"
49469$at_diff expout "$at_stdout" || at_failed=:
49470at_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'
49478input.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"
49508at_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>&-
49512at_status=$? at_failed=false
49513$at_check_filter
49514$at_diff experr "$at_stderr" || at_failed=:
49515at_fn_diff_devnull "$at_stdout" || at_failed=:
49516at_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"
49525at_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>&-
49528at_status=$? at_failed=false
49529$at_check_filter
49530$at_diff experr "$at_stderr" || at_failed=:
49531$at_diff expout "$at_stdout" || at_failed=:
49532at_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"
49542at_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>&-
49545at_status=$? at_failed=false
49546$at_check_filter
49547at_fn_diff_devnull "$at_stderr" || at_failed=:
49548$at_diff expout "$at_stdout" || at_failed=:
49549at_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"
49555at_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>&-
49558at_status=$? at_failed=false
49559$at_check_filter
49560at_fn_diff_devnull "$at_stderr" || at_failed=:
49561$at_diff expout "$at_stdout" || at_failed=:
49562at_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
49568fi
49569
49570if 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"
49578at_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>&-
49582at_status=$? at_failed=false
49583$at_check_filter
49584echo stderr:; cat "$at_stderr"
49585echo stdout:; cat "$at_stdout"
49586at_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"
49592at_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>&-
49595at_status=$? at_failed=false
49596$at_check_filter
49597echo stderr:; cat "$at_stderr"
49598echo stdout:; cat "$at_stdout"
49599at_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"
49608at_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>&-
49613at_status=$? at_failed=false
49614$at_check_filter
49615at_fn_diff_devnull "$at_stderr" || at_failed=:
49616$at_diff expout "$at_stdout" || at_failed=:
49617at_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"
49626at_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>&-
49631at_status=$? at_failed=false
49632$at_check_filter
49633at_fn_diff_devnull "$at_stderr" || at_failed=:
49634$at_diff expout "$at_stdout" || at_failed=:
49635at_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
49641fi
49642{ set +x
49643$as_echo "$at_srcdir/conflicts.at:44: bison -fcaret -o input.c input.y"
49644at_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>&-
49647at_status=$? at_failed=false
49648$at_check_filter
49649echo >>"$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=:
49654at_fn_diff_devnull "$at_stdout" || at_failed=:
49655at_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.
49662if 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"
49671at_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>&-
49674at_status=$? at_failed=false
49675$at_check_filter
49676echo stderr:; tee stderr <"$at_stderr"
49677$at_diff expout "$at_stdout" || at_failed=:
49678at_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'
49686input.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"
49718at_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>&-
49722at_status=$? at_failed=false
49723$at_check_filter
49724$at_diff experr "$at_stderr" || at_failed=:
49725at_fn_diff_devnull "$at_stdout" || at_failed=:
49726at_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"
49735at_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>&-
49738at_status=$? at_failed=false
49739$at_check_filter
49740$at_diff experr "$at_stderr" || at_failed=:
49741$at_diff expout "$at_stdout" || at_failed=:
49742at_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"
49752at_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>&-
49755at_status=$? at_failed=false
49756$at_check_filter
49757at_fn_diff_devnull "$at_stderr" || at_failed=:
49758$at_diff expout "$at_stdout" || at_failed=:
49759at_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"
49765at_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>&-
49768at_status=$? at_failed=false
49769$at_check_filter
49770at_fn_diff_devnull "$at_stderr" || at_failed=:
49771$at_diff expout "$at_stdout" || at_failed=:
49772at_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
49778fi
49779
49780  set +x
49781  $at_times_p && times >"$at_times_file"
49782) 5>&1 2>&1 7>&- | eval $at_tee_pipe
49783read at_status <"$at_status_file"
49784#AT_STOP_181
49785#AT_START_182
49786at_fn_group_banner 182 'conflicts.at:57' \
49787  "%nonassoc and eof" "                              " 10
49788at_xfail=no
49789(
49790  $as_echo "182. $at_setup_line: testing $at_desc ..."
49791  $at_traceon
49792
49793
49794
49795cat >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.  */
49814static
49815void yyerror ( const char *msg)
49816{
49817  fprintf (stderr, "%s\n", msg);
49818}
49819/* The current argument. */
49820static const char *input;
49821
49822static int
49823yylex (void)
49824{
49825  static size_t toknum;
49826  assert (toknum <= strlen (input));
49827  return input[toknum++];
49828}
49829
49830%}
49831
49832%nonassoc '<' '>'
49833
49834%%
49835expr: expr '<' expr
49836    | expr '>' expr
49837    | '0'
49838    ;
49839%%
49840int
49841main (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.
49854if 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"
49862at_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>&-
49866at_status=$? at_failed=false
49867$at_check_filter
49868echo stderr:; cat "$at_stderr"
49869echo stdout:; cat "$at_stdout"
49870at_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"
49876at_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>&-
49879at_status=$? at_failed=false
49880$at_check_filter
49881echo stderr:; cat "$at_stderr"
49882echo stdout:; cat "$at_stdout"
49883at_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"
49892at_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>&-
49897at_status=$? at_failed=false
49898$at_check_filter
49899at_fn_diff_devnull "$at_stderr" || at_failed=:
49900$at_diff expout "$at_stdout" || at_failed=:
49901at_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"
49910at_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>&-
49915at_status=$? at_failed=false
49916$at_check_filter
49917at_fn_diff_devnull "$at_stderr" || at_failed=:
49918$at_diff expout "$at_stdout" || at_failed=:
49919at_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
49925fi
49926{ set +x
49927$as_echo "$at_srcdir/conflicts.at:123: bison  -o input.c input.y"
49928at_fn_check_prepare_trace "conflicts.at:123"
49929( $at_check_trace; bison  -o input.c input.y
49930) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49931at_status=$? at_failed=false
49932$at_check_filter
49933at_fn_diff_devnull "$at_stderr" || at_failed=:
49934at_fn_diff_devnull "$at_stdout" || at_failed=:
49935at_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"
49942at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:123"
49943( $at_check_trace; $BISON_C_WORKS
49944) >>"$at_stdout" 2>>"$at_stderr" 5>&-
49945at_status=$? at_failed=false
49946$at_check_filter
49947echo stderr:; cat "$at_stderr"
49948echo stdout:; cat "$at_stdout"
49949at_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"
49955at_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>&-
49958at_status=$? at_failed=false
49959$at_check_filter
49960echo stderr:; cat "$at_stderr"
49961echo stdout:; cat "$at_stdout"
49962at_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'"
49971at_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>&-
49974at_status=$? at_failed=false
49975$at_check_filter
49976echo stderr:; tee stderr <"$at_stderr"
49977at_fn_diff_devnull "$at_stdout" || at_failed=:
49978at_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"
49984at_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>&-
49987at_status=$? at_failed=false
49988$at_check_filter
49989at_fn_diff_devnull "$at_stderr" || at_failed=:
49990at_fn_diff_devnull "$at_stdout" || at_failed=:
49991at_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'"
49998at_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>&-
50001at_status=$? at_failed=false
50002$at_check_filter
50003echo stderr:; tee stderr <"$at_stderr"
50004at_fn_diff_devnull "$at_stdout" || at_failed=:
50005at_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"
50011at_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>&-
50014at_status=$? at_failed=false
50015$at_check_filter
50016echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<'
50017" | \
50018  $at_diff - "$at_stderr" || at_failed=:
50019at_fn_diff_devnull "$at_stdout" || at_failed=:
50020at_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'"
50028at_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>&-
50031at_status=$? at_failed=false
50032$at_check_filter
50033echo stderr:; tee stderr <"$at_stderr"
50034at_fn_diff_devnull "$at_stdout" || at_failed=:
50035at_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"
50041at_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>&-
50044at_status=$? at_failed=false
50045$at_check_filter
50046at_fn_diff_devnull "$at_stderr" || at_failed=:
50047at_fn_diff_devnull "$at_stdout" || at_failed=:
50048at_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'"
50055at_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>&-
50058at_status=$? at_failed=false
50059$at_check_filter
50060echo stderr:; tee stderr <"$at_stderr"
50061at_fn_diff_devnull "$at_stdout" || at_failed=:
50062at_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"
50068at_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>&-
50071at_status=$? at_failed=false
50072$at_check_filter
50073echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>'
50074" | \
50075  $at_diff - "$at_stderr" || at_failed=:
50076at_fn_diff_devnull "$at_stdout" || at_failed=:
50077at_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'"
50085at_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>&-
50088at_status=$? at_failed=false
50089$at_check_filter
50090echo stderr:; tee stderr <"$at_stderr"
50091at_fn_diff_devnull "$at_stdout" || at_failed=:
50092at_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"
50098at_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>&-
50101at_status=$? at_failed=false
50102$at_check_filter
50103echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>'
50104" | \
50105  $at_diff - "$at_stderr" || at_failed=:
50106at_fn_diff_devnull "$at_stdout" || at_failed=:
50107at_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.
50117if 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"
50125at_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>&-
50129at_status=$? at_failed=false
50130$at_check_filter
50131echo stderr:; cat "$at_stderr"
50132echo stdout:; cat "$at_stdout"
50133at_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"
50139at_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>&-
50142at_status=$? at_failed=false
50143$at_check_filter
50144echo stderr:; cat "$at_stderr"
50145echo stdout:; cat "$at_stdout"
50146at_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"
50155at_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>&-
50160at_status=$? at_failed=false
50161$at_check_filter
50162at_fn_diff_devnull "$at_stderr" || at_failed=:
50163$at_diff expout "$at_stdout" || at_failed=:
50164at_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"
50173at_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>&-
50178at_status=$? at_failed=false
50179$at_check_filter
50180at_fn_diff_devnull "$at_stderr" || at_failed=:
50181$at_diff expout "$at_stdout" || at_failed=:
50182at_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
50188fi
50189{ set +x
50190$as_echo "$at_srcdir/conflicts.at:127: bison -Dlr.default-reductions=consistent -o input.c input.y"
50191at_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>&-
50194at_status=$? at_failed=false
50195$at_check_filter
50196at_fn_diff_devnull "$at_stderr" || at_failed=:
50197at_fn_diff_devnull "$at_stdout" || at_failed=:
50198at_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"
50205at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:127"
50206( $at_check_trace; $BISON_C_WORKS
50207) >>"$at_stdout" 2>>"$at_stderr" 5>&-
50208at_status=$? at_failed=false
50209$at_check_filter
50210echo stderr:; cat "$at_stderr"
50211echo stdout:; cat "$at_stdout"
50212at_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"
50218at_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>&-
50221at_status=$? at_failed=false
50222$at_check_filter
50223echo stderr:; cat "$at_stderr"
50224echo stdout:; cat "$at_stdout"
50225at_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'"
50234at_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>&-
50237at_status=$? at_failed=false
50238$at_check_filter
50239echo stderr:; tee stderr <"$at_stderr"
50240at_fn_diff_devnull "$at_stdout" || at_failed=:
50241at_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"
50247at_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>&-
50250at_status=$? at_failed=false
50251$at_check_filter
50252at_fn_diff_devnull "$at_stderr" || at_failed=:
50253at_fn_diff_devnull "$at_stdout" || at_failed=:
50254at_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'"
50261at_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>&-
50264at_status=$? at_failed=false
50265$at_check_filter
50266echo stderr:; tee stderr <"$at_stderr"
50267at_fn_diff_devnull "$at_stdout" || at_failed=:
50268at_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"
50274at_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>&-
50277at_status=$? at_failed=false
50278$at_check_filter
50279echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
50280" | \
50281  $at_diff - "$at_stderr" || at_failed=:
50282at_fn_diff_devnull "$at_stdout" || at_failed=:
50283at_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'"
50291at_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>&-
50294at_status=$? at_failed=false
50295$at_check_filter
50296echo stderr:; tee stderr <"$at_stderr"
50297at_fn_diff_devnull "$at_stdout" || at_failed=:
50298at_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"
50304at_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>&-
50307at_status=$? at_failed=false
50308$at_check_filter
50309at_fn_diff_devnull "$at_stderr" || at_failed=:
50310at_fn_diff_devnull "$at_stdout" || at_failed=:
50311at_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'"
50318at_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>&-
50321at_status=$? at_failed=false
50322$at_check_filter
50323echo stderr:; tee stderr <"$at_stderr"
50324at_fn_diff_devnull "$at_stdout" || at_failed=:
50325at_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"
50331at_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>&-
50334at_status=$? at_failed=false
50335$at_check_filter
50336echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50337" | \
50338  $at_diff - "$at_stderr" || at_failed=:
50339at_fn_diff_devnull "$at_stdout" || at_failed=:
50340at_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'"
50348at_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>&-
50351at_status=$? at_failed=false
50352$at_check_filter
50353echo stderr:; tee stderr <"$at_stderr"
50354at_fn_diff_devnull "$at_stdout" || at_failed=:
50355at_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"
50361at_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>&-
50364at_status=$? at_failed=false
50365$at_check_filter
50366echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50367" | \
50368  $at_diff - "$at_stderr" || at_failed=:
50369at_fn_diff_devnull "$at_stdout" || at_failed=:
50370at_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.
50384if 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"
50392at_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>&-
50396at_status=$? at_failed=false
50397$at_check_filter
50398echo stderr:; cat "$at_stderr"
50399echo stdout:; cat "$at_stdout"
50400at_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"
50406at_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>&-
50409at_status=$? at_failed=false
50410$at_check_filter
50411echo stderr:; cat "$at_stderr"
50412echo stdout:; cat "$at_stdout"
50413at_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"
50422at_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>&-
50427at_status=$? at_failed=false
50428$at_check_filter
50429at_fn_diff_devnull "$at_stderr" || at_failed=:
50430$at_diff expout "$at_stdout" || at_failed=:
50431at_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"
50440at_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>&-
50445at_status=$? at_failed=false
50446$at_check_filter
50447at_fn_diff_devnull "$at_stderr" || at_failed=:
50448$at_diff expout "$at_stdout" || at_failed=:
50449at_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
50455fi
50456{ set +x
50457$as_echo "$at_srcdir/conflicts.at:136: bison -Dlr.type=canonical-lr -o input.c input.y"
50458at_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>&-
50461at_status=$? at_failed=false
50462$at_check_filter
50463at_fn_diff_devnull "$at_stderr" || at_failed=:
50464at_fn_diff_devnull "$at_stdout" || at_failed=:
50465at_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"
50472at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:136"
50473( $at_check_trace; $BISON_C_WORKS
50474) >>"$at_stdout" 2>>"$at_stderr" 5>&-
50475at_status=$? at_failed=false
50476$at_check_filter
50477echo stderr:; cat "$at_stderr"
50478echo stdout:; cat "$at_stdout"
50479at_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"
50485at_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>&-
50488at_status=$? at_failed=false
50489$at_check_filter
50490echo stderr:; cat "$at_stderr"
50491echo stdout:; cat "$at_stdout"
50492at_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'"
50501at_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>&-
50504at_status=$? at_failed=false
50505$at_check_filter
50506echo stderr:; tee stderr <"$at_stderr"
50507at_fn_diff_devnull "$at_stdout" || at_failed=:
50508at_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"
50514at_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>&-
50517at_status=$? at_failed=false
50518$at_check_filter
50519at_fn_diff_devnull "$at_stderr" || at_failed=:
50520at_fn_diff_devnull "$at_stdout" || at_failed=:
50521at_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'"
50528at_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>&-
50531at_status=$? at_failed=false
50532$at_check_filter
50533echo stderr:; tee stderr <"$at_stderr"
50534at_fn_diff_devnull "$at_stdout" || at_failed=:
50535at_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"
50541at_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>&-
50544at_status=$? at_failed=false
50545$at_check_filter
50546echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
50547" | \
50548  $at_diff - "$at_stderr" || at_failed=:
50549at_fn_diff_devnull "$at_stdout" || at_failed=:
50550at_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'"
50558at_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>&-
50561at_status=$? at_failed=false
50562$at_check_filter
50563echo stderr:; tee stderr <"$at_stderr"
50564at_fn_diff_devnull "$at_stdout" || at_failed=:
50565at_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"
50571at_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>&-
50574at_status=$? at_failed=false
50575$at_check_filter
50576at_fn_diff_devnull "$at_stderr" || at_failed=:
50577at_fn_diff_devnull "$at_stdout" || at_failed=:
50578at_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'"
50585at_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>&-
50588at_status=$? at_failed=false
50589$at_check_filter
50590echo stderr:; tee stderr <"$at_stderr"
50591at_fn_diff_devnull "$at_stdout" || at_failed=:
50592at_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"
50598at_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>&-
50601at_status=$? at_failed=false
50602$at_check_filter
50603echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50604" | \
50605  $at_diff - "$at_stderr" || at_failed=:
50606at_fn_diff_devnull "$at_stdout" || at_failed=:
50607at_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'"
50615at_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>&-
50618at_status=$? at_failed=false
50619$at_check_filter
50620echo stderr:; tee stderr <"$at_stderr"
50621at_fn_diff_devnull "$at_stdout" || at_failed=:
50622at_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"
50628at_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>&-
50631at_status=$? at_failed=false
50632$at_check_filter
50633echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50634" | \
50635  $at_diff - "$at_stderr" || at_failed=:
50636at_fn_diff_devnull "$at_stdout" || at_failed=:
50637at_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.
50650if 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"
50658at_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>&-
50662at_status=$? at_failed=false
50663$at_check_filter
50664echo stderr:; cat "$at_stderr"
50665echo stdout:; cat "$at_stdout"
50666at_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"
50672at_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>&-
50675at_status=$? at_failed=false
50676$at_check_filter
50677echo stderr:; cat "$at_stderr"
50678echo stdout:; cat "$at_stdout"
50679at_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"
50688at_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>&-
50693at_status=$? at_failed=false
50694$at_check_filter
50695at_fn_diff_devnull "$at_stderr" || at_failed=:
50696$at_diff expout "$at_stdout" || at_failed=:
50697at_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"
50706at_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>&-
50711at_status=$? at_failed=false
50712$at_check_filter
50713at_fn_diff_devnull "$at_stderr" || at_failed=:
50714$at_diff expout "$at_stdout" || at_failed=:
50715at_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
50721fi
50722{ set +x
50723$as_echo "$at_srcdir/conflicts.at:143: bison -Dparse.lac=full -o input.c input.y"
50724at_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>&-
50727at_status=$? at_failed=false
50728$at_check_filter
50729at_fn_diff_devnull "$at_stderr" || at_failed=:
50730at_fn_diff_devnull "$at_stdout" || at_failed=:
50731at_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"
50738at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:143"
50739( $at_check_trace; $BISON_C_WORKS
50740) >>"$at_stdout" 2>>"$at_stderr" 5>&-
50741at_status=$? at_failed=false
50742$at_check_filter
50743echo stderr:; cat "$at_stderr"
50744echo stdout:; cat "$at_stdout"
50745at_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"
50751at_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>&-
50754at_status=$? at_failed=false
50755$at_check_filter
50756echo stderr:; cat "$at_stderr"
50757echo stdout:; cat "$at_stdout"
50758at_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'"
50767at_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>&-
50770at_status=$? at_failed=false
50771$at_check_filter
50772echo stderr:; tee stderr <"$at_stderr"
50773at_fn_diff_devnull "$at_stdout" || at_failed=:
50774at_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"
50780at_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>&-
50783at_status=$? at_failed=false
50784$at_check_filter
50785at_fn_diff_devnull "$at_stderr" || at_failed=:
50786at_fn_diff_devnull "$at_stdout" || at_failed=:
50787at_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'"
50794at_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>&-
50797at_status=$? at_failed=false
50798$at_check_filter
50799echo stderr:; tee stderr <"$at_stderr"
50800at_fn_diff_devnull "$at_stdout" || at_failed=:
50801at_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"
50807at_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>&-
50810at_status=$? at_failed=false
50811$at_check_filter
50812echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
50813" | \
50814  $at_diff - "$at_stderr" || at_failed=:
50815at_fn_diff_devnull "$at_stdout" || at_failed=:
50816at_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'"
50824at_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>&-
50827at_status=$? at_failed=false
50828$at_check_filter
50829echo stderr:; tee stderr <"$at_stderr"
50830at_fn_diff_devnull "$at_stdout" || at_failed=:
50831at_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"
50837at_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>&-
50840at_status=$? at_failed=false
50841$at_check_filter
50842at_fn_diff_devnull "$at_stderr" || at_failed=:
50843at_fn_diff_devnull "$at_stdout" || at_failed=:
50844at_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'"
50851at_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>&-
50854at_status=$? at_failed=false
50855$at_check_filter
50856echo stderr:; tee stderr <"$at_stderr"
50857at_fn_diff_devnull "$at_stdout" || at_failed=:
50858at_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"
50864at_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>&-
50867at_status=$? at_failed=false
50868$at_check_filter
50869echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50870" | \
50871  $at_diff - "$at_stderr" || at_failed=:
50872at_fn_diff_devnull "$at_stdout" || at_failed=:
50873at_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'"
50881at_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>&-
50884at_status=$? at_failed=false
50885$at_check_filter
50886echo stderr:; tee stderr <"$at_stderr"
50887at_fn_diff_devnull "$at_stdout" || at_failed=:
50888at_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"
50894at_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>&-
50897at_status=$? at_failed=false
50898$at_check_filter
50899echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
50900" | \
50901  $at_diff - "$at_stderr" || at_failed=:
50902at_fn_diff_devnull "$at_stdout" || at_failed=:
50903at_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
50916read at_status <"$at_status_file"
50917#AT_STOP_182
50918#AT_START_183
50919at_fn_group_banner 183 'conflicts.at:155' \
50920  "%error-verbose and consistent errors" "           " 10
50921at_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
50948cat >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
50977start: consistent-error-on-a-a 'a' ;
50978
50979consistent-error-on-a-a:
50980    'a' default-reduction
50981  | 'a' default-reduction 'a'
50982  | 'a' shift
50983  ;
50984
50985default-reduction: /*empty*/ ;
50986shift: 'b' ;
50987
50988// Provide another context in which all rules are useful so that this
50989// test case looks a little more realistic.
50990start: 'b' consistent-error-on-a-a 'c' ;
50991
50992
50993%%
50994
50995/*--------.
50996| yylex.  |
50997`--------*/
50998
50999int 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.  */
51007static
51008void yyerror ( const char *msg)
51009{
51010  fprintf (stderr, "%s\n", msg);
51011}
51012
51013
51014/*-------.
51015| main.  |
51016`-------*/
51017
51018int
51019main (void)
51020{
51021  return yyparse ();
51022}
51023_ATEOF
51024
51025
51026
51027if 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"
51035at_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>&-
51039at_status=$? at_failed=false
51040$at_check_filter
51041echo stderr:; cat "$at_stderr"
51042echo stdout:; cat "$at_stdout"
51043at_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"
51049at_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>&-
51052at_status=$? at_failed=false
51053$at_check_filter
51054echo stderr:; cat "$at_stderr"
51055echo stdout:; cat "$at_stdout"
51056at_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"
51065at_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>&-
51070at_status=$? at_failed=false
51071$at_check_filter
51072at_fn_diff_devnull "$at_stderr" || at_failed=:
51073$at_diff expout "$at_stdout" || at_failed=:
51074at_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"
51083at_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>&-
51088at_status=$? at_failed=false
51089$at_check_filter
51090at_fn_diff_devnull "$at_stderr" || at_failed=:
51091$at_diff expout "$at_stdout" || at_failed=:
51092at_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
51098fi
51099{ set +x
51100$as_echo "$at_srcdir/conflicts.at:299: bison -o input.c input.y"
51101at_fn_check_prepare_trace "conflicts.at:299"
51102( $at_check_trace; bison -o input.c input.y
51103) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51104at_status=$? at_failed=false
51105$at_check_filter
51106at_fn_diff_devnull "$at_stderr" || at_failed=:
51107at_fn_diff_devnull "$at_stdout" || at_failed=:
51108at_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"
51115at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:299"
51116( $at_check_trace; $BISON_C_WORKS
51117) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51118at_status=$? at_failed=false
51119$at_check_filter
51120echo stderr:; cat "$at_stderr"
51121echo stdout:; cat "$at_stdout"
51122at_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"
51128at_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>&-
51131at_status=$? at_failed=false
51132$at_check_filter
51133echo stderr:; cat "$at_stderr"
51134echo stdout:; cat "$at_stdout"
51135at_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"
51145at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:299"
51146( $at_check_trace;  $PREPARSER ./input
51147) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51148at_status=$? at_failed=false
51149$at_check_filter
51150echo stderr:; tee stderr <"$at_stderr"
51151at_fn_diff_devnull "$at_stdout" || at_failed=:
51152at_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"
51158at_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>&-
51161at_status=$? at_failed=false
51162$at_check_filter
51163echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
51164" | \
51165  $at_diff - "$at_stderr" || at_failed=:
51166at_fn_diff_devnull "$at_stdout" || at_failed=:
51167at_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
51184cat >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
51214start: consistent-error-on-a-a 'a' ;
51215
51216consistent-error-on-a-a:
51217    'a' default-reduction
51218  | 'a' default-reduction 'a'
51219  | 'a' shift
51220  ;
51221
51222default-reduction: /*empty*/ ;
51223shift: 'b' ;
51224
51225// Provide another context in which all rules are useful so that this
51226// test case looks a little more realistic.
51227start: 'b' consistent-error-on-a-a 'c' ;
51228
51229
51230%%
51231
51232/*--------.
51233| yylex.  |
51234`--------*/
51235
51236int 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.  */
51244static
51245void yyerror ( const char *msg)
51246{
51247  fprintf (stderr, "%s\n", msg);
51248}
51249
51250
51251/*-------.
51252| main.  |
51253`-------*/
51254
51255int
51256main (void)
51257{
51258  return yyparse ();
51259}
51260_ATEOF
51261
51262
51263
51264if 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"
51272at_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>&-
51276at_status=$? at_failed=false
51277$at_check_filter
51278echo stderr:; cat "$at_stderr"
51279echo stdout:; cat "$at_stdout"
51280at_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"
51286at_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>&-
51289at_status=$? at_failed=false
51290$at_check_filter
51291echo stderr:; cat "$at_stderr"
51292echo stdout:; cat "$at_stdout"
51293at_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"
51302at_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>&-
51307at_status=$? at_failed=false
51308$at_check_filter
51309at_fn_diff_devnull "$at_stderr" || at_failed=:
51310$at_diff expout "$at_stdout" || at_failed=:
51311at_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"
51320at_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>&-
51325at_status=$? at_failed=false
51326$at_check_filter
51327at_fn_diff_devnull "$at_stderr" || at_failed=:
51328$at_diff expout "$at_stdout" || at_failed=:
51329at_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
51335fi
51336{ set +x
51337$as_echo "$at_srcdir/conflicts.at:303: bison -o input.c input.y"
51338at_fn_check_prepare_trace "conflicts.at:303"
51339( $at_check_trace; bison -o input.c input.y
51340) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51341at_status=$? at_failed=false
51342$at_check_filter
51343at_fn_diff_devnull "$at_stderr" || at_failed=:
51344at_fn_diff_devnull "$at_stdout" || at_failed=:
51345at_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"
51352at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:303"
51353( $at_check_trace; $BISON_C_WORKS
51354) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51355at_status=$? at_failed=false
51356$at_check_filter
51357echo stderr:; cat "$at_stderr"
51358echo stdout:; cat "$at_stdout"
51359at_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"
51365at_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>&-
51368at_status=$? at_failed=false
51369$at_check_filter
51370echo stderr:; cat "$at_stderr"
51371echo stdout:; cat "$at_stdout"
51372at_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"
51382at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:303"
51383( $at_check_trace;  $PREPARSER ./input
51384) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51385at_status=$? at_failed=false
51386$at_check_filter
51387echo stderr:; tee stderr <"$at_stderr"
51388at_fn_diff_devnull "$at_stdout" || at_failed=:
51389at_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"
51395at_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>&-
51398at_status=$? at_failed=false
51399$at_check_filter
51400echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
51401" | \
51402  $at_diff - "$at_stderr" || at_failed=:
51403at_fn_diff_devnull "$at_stdout" || at_failed=:
51404at_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
51421cat >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
51450start: consistent-error-on-a-a 'a' ;
51451
51452consistent-error-on-a-a:
51453    'a' default-reduction
51454  | 'a' default-reduction 'a'
51455  | 'a' shift
51456  ;
51457
51458default-reduction: /*empty*/ ;
51459shift: 'b' ;
51460
51461// Provide another context in which all rules are useful so that this
51462// test case looks a little more realistic.
51463start: 'b' consistent-error-on-a-a 'c' ;
51464
51465
51466%%
51467
51468/*--------.
51469| yylex.  |
51470`--------*/
51471
51472int 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.  */
51479void
51480yy::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
51491int
51492main (void)
51493{
51494  yy::parser parser;
51495  return parser.parse ();
51496}
51497_ATEOF
51498
51499
51500
51501if 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"
51509at_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>&-
51513at_status=$? at_failed=false
51514$at_check_filter
51515echo stderr:; cat "$at_stderr"
51516echo stdout:; cat "$at_stdout"
51517at_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"
51523at_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>&-
51526at_status=$? at_failed=false
51527$at_check_filter
51528echo stderr:; cat "$at_stderr"
51529echo stdout:; cat "$at_stdout"
51530at_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"
51539at_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>&-
51544at_status=$? at_failed=false
51545$at_check_filter
51546at_fn_diff_devnull "$at_stderr" || at_failed=:
51547$at_diff expout "$at_stdout" || at_failed=:
51548at_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"
51557at_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>&-
51562at_status=$? at_failed=false
51563$at_check_filter
51564at_fn_diff_devnull "$at_stderr" || at_failed=:
51565$at_diff expout "$at_stdout" || at_failed=:
51566at_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
51572fi
51573{ set +x
51574$as_echo "$at_srcdir/conflicts.at:308: bison -o input.cc input.y"
51575at_fn_check_prepare_trace "conflicts.at:308"
51576( $at_check_trace; bison -o input.cc input.y
51577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51578at_status=$? at_failed=false
51579$at_check_filter
51580at_fn_diff_devnull "$at_stderr" || at_failed=:
51581at_fn_diff_devnull "$at_stdout" || at_failed=:
51582at_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"
51590at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:308"
51591( $at_check_trace; $BISON_CXX_WORKS
51592) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51593at_status=$? at_failed=false
51594$at_check_filter
51595echo stderr:; cat "$at_stderr"
51596echo stdout:; cat "$at_stdout"
51597at_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"
51603at_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>&-
51606at_status=$? at_failed=false
51607$at_check_filter
51608echo stderr:; cat "$at_stderr"
51609echo stdout:; cat "$at_stdout"
51610at_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"
51620at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:308"
51621( $at_check_trace;  $PREPARSER ./input
51622) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51623at_status=$? at_failed=false
51624$at_check_filter
51625echo stderr:; tee stderr <"$at_stderr"
51626at_fn_diff_devnull "$at_stdout" || at_failed=:
51627at_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"
51633at_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>&-
51636at_status=$? at_failed=false
51637$at_check_filter
51638echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
51639" | \
51640  $at_diff - "$at_stderr" || at_failed=:
51641at_fn_diff_devnull "$at_stdout" || at_failed=:
51642at_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
51659cat >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
51675start: consistent-error-on-a-a 'a' ;
51676
51677consistent-error-on-a-a:
51678    'a' default-reduction
51679  | 'a' default-reduction 'a'
51680  | 'a' shift
51681  ;
51682
51683default-reduction: /*empty*/ ;
51684shift: 'b' ;
51685
51686// Provide another context in which all rules are useful so that this
51687// test case looks a little more realistic.
51688start: 'b' consistent-error-on-a-a 'c' ;
51689
51690
51691%code lexer {
51692
51693/*--------.
51694| yylex.  |
51695`--------*/
51696
51697public String input = "a";
51698public int index = 0;
51699public int yylex ()
51700{
51701  if (index < input.length ())
51702    return input.charAt (index++);
51703  else
51704    return 0;
51705}
51706public 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
51724class 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
51735if 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"
51743at_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>&-
51747at_status=$? at_failed=false
51748$at_check_filter
51749echo stderr:; cat "$at_stderr"
51750echo stdout:; cat "$at_stdout"
51751at_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"
51757at_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>&-
51760at_status=$? at_failed=false
51761$at_check_filter
51762echo stderr:; cat "$at_stderr"
51763echo stdout:; cat "$at_stdout"
51764at_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"
51773at_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>&-
51778at_status=$? at_failed=false
51779$at_check_filter
51780at_fn_diff_devnull "$at_stderr" || at_failed=:
51781$at_diff expout "$at_stdout" || at_failed=:
51782at_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"
51791at_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>&-
51796at_status=$? at_failed=false
51797$at_check_filter
51798at_fn_diff_devnull "$at_stderr" || at_failed=:
51799$at_diff expout "$at_stdout" || at_failed=:
51800at_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
51806fi
51807{ set +x
51808$as_echo "$at_srcdir/conflicts.at:313: bison -o input.java input.y"
51809at_fn_check_prepare_trace "conflicts.at:313"
51810( $at_check_trace; bison -o input.java input.y
51811) >>"$at_stdout" 2>>"$at_stderr" 5>&-
51812at_status=$? at_failed=false
51813$at_check_filter
51814at_fn_diff_devnull "$at_stderr" || at_failed=:
51815at_fn_diff_devnull "$at_stdout" || at_failed=:
51816at_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"
51830at_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>&-
51833at_status=$? at_failed=false
51834$at_check_filter
51835echo stderr:; cat "$at_stderr"
51836echo stdout:; cat "$at_stdout"
51837at_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"
51847at_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>&-
51850at_status=$? at_failed=false
51851$at_check_filter
51852echo >>"$at_stderr"; $as_echo "syntax error, unexpected end of input
51853" | \
51854  $at_diff - "$at_stderr" || at_failed=:
51855at_fn_diff_devnull "$at_stdout" || at_failed=:
51856at_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
51874cat >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
51904start: consistent-error-on-a-a 'a' ;
51905
51906consistent-error-on-a-a:
51907    'a' default-reduction
51908  | 'a' default-reduction 'a'
51909  | 'a' shift
51910  ;
51911
51912default-reduction: /*empty*/ ;
51913shift: 'b' ;
51914
51915// Provide another context in which all rules are useful so that this
51916// test case looks a little more realistic.
51917start: 'b' consistent-error-on-a-a 'c' ;
51918
51919
51920%%
51921
51922/*--------.
51923| yylex.  |
51924`--------*/
51925
51926int 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.  */
51934static
51935void yyerror ( const char *msg)
51936{
51937  fprintf (stderr, "%s\n", msg);
51938}
51939
51940
51941/*-------.
51942| main.  |
51943`-------*/
51944
51945int
51946main (void)
51947{
51948  return yyparse ();
51949}
51950_ATEOF
51951
51952
51953
51954if 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"
51962at_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>&-
51966at_status=$? at_failed=false
51967$at_check_filter
51968echo stderr:; cat "$at_stderr"
51969echo stdout:; cat "$at_stdout"
51970at_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"
51976at_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>&-
51979at_status=$? at_failed=false
51980$at_check_filter
51981echo stderr:; cat "$at_stderr"
51982echo stdout:; cat "$at_stdout"
51983at_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"
51992at_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>&-
51997at_status=$? at_failed=false
51998$at_check_filter
51999at_fn_diff_devnull "$at_stderr" || at_failed=:
52000$at_diff expout "$at_stdout" || at_failed=:
52001at_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"
52010at_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>&-
52015at_status=$? at_failed=false
52016$at_check_filter
52017at_fn_diff_devnull "$at_stderr" || at_failed=:
52018$at_diff expout "$at_stdout" || at_failed=:
52019at_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
52025fi
52026{ set +x
52027$as_echo "$at_srcdir/conflicts.at:320: bison -o input.c input.y"
52028at_fn_check_prepare_trace "conflicts.at:320"
52029( $at_check_trace; bison -o input.c input.y
52030) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52031at_status=$? at_failed=false
52032$at_check_filter
52033at_fn_diff_devnull "$at_stderr" || at_failed=:
52034at_fn_diff_devnull "$at_stdout" || at_failed=:
52035at_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"
52042at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:320"
52043( $at_check_trace; $BISON_C_WORKS
52044) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52045at_status=$? at_failed=false
52046$at_check_filter
52047echo stderr:; cat "$at_stderr"
52048echo stdout:; cat "$at_stdout"
52049at_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"
52055at_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>&-
52058at_status=$? at_failed=false
52059$at_check_filter
52060echo stderr:; cat "$at_stderr"
52061echo stdout:; cat "$at_stdout"
52062at_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"
52072at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:320"
52073( $at_check_trace;  $PREPARSER ./input
52074) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52075at_status=$? at_failed=false
52076$at_check_filter
52077echo stderr:; tee stderr <"$at_stderr"
52078at_fn_diff_devnull "$at_stdout" || at_failed=:
52079at_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"
52085at_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>&-
52088at_status=$? at_failed=false
52089$at_check_filter
52090echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
52091" | \
52092  $at_diff - "$at_stderr" || at_failed=:
52093at_fn_diff_devnull "$at_stdout" || at_failed=:
52094at_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
52111cat >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
52141start: consistent-error-on-a-a 'a' ;
52142
52143consistent-error-on-a-a:
52144    'a' default-reduction
52145  | 'a' default-reduction 'a'
52146  | 'a' shift
52147  ;
52148
52149default-reduction: /*empty*/ ;
52150shift: 'b' ;
52151
52152// Provide another context in which all rules are useful so that this
52153// test case looks a little more realistic.
52154start: 'b' consistent-error-on-a-a 'c' ;
52155
52156
52157%%
52158
52159/*--------.
52160| yylex.  |
52161`--------*/
52162
52163int 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.  */
52171static
52172void yyerror ( const char *msg)
52173{
52174  fprintf (stderr, "%s\n", msg);
52175}
52176
52177
52178/*-------.
52179| main.  |
52180`-------*/
52181
52182int
52183main (void)
52184{
52185  return yyparse ();
52186}
52187_ATEOF
52188
52189
52190
52191if 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"
52199at_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>&-
52203at_status=$? at_failed=false
52204$at_check_filter
52205echo stderr:; cat "$at_stderr"
52206echo stdout:; cat "$at_stdout"
52207at_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"
52213at_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>&-
52216at_status=$? at_failed=false
52217$at_check_filter
52218echo stderr:; cat "$at_stderr"
52219echo stdout:; cat "$at_stdout"
52220at_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"
52229at_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>&-
52234at_status=$? at_failed=false
52235$at_check_filter
52236at_fn_diff_devnull "$at_stderr" || at_failed=:
52237$at_diff expout "$at_stdout" || at_failed=:
52238at_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"
52247at_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>&-
52252at_status=$? at_failed=false
52253$at_check_filter
52254at_fn_diff_devnull "$at_stderr" || at_failed=:
52255$at_diff expout "$at_stdout" || at_failed=:
52256at_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
52262fi
52263{ set +x
52264$as_echo "$at_srcdir/conflicts.at:325: bison -o input.c input.y"
52265at_fn_check_prepare_trace "conflicts.at:325"
52266( $at_check_trace; bison -o input.c input.y
52267) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52268at_status=$? at_failed=false
52269$at_check_filter
52270at_fn_diff_devnull "$at_stderr" || at_failed=:
52271at_fn_diff_devnull "$at_stdout" || at_failed=:
52272at_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"
52279at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:325"
52280( $at_check_trace; $BISON_C_WORKS
52281) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52282at_status=$? at_failed=false
52283$at_check_filter
52284echo stderr:; cat "$at_stderr"
52285echo stdout:; cat "$at_stdout"
52286at_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"
52292at_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>&-
52295at_status=$? at_failed=false
52296$at_check_filter
52297echo stderr:; cat "$at_stderr"
52298echo stdout:; cat "$at_stdout"
52299at_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"
52309at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:325"
52310( $at_check_trace;  $PREPARSER ./input
52311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52312at_status=$? at_failed=false
52313$at_check_filter
52314echo stderr:; tee stderr <"$at_stderr"
52315at_fn_diff_devnull "$at_stdout" || at_failed=:
52316at_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"
52322at_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>&-
52325at_status=$? at_failed=false
52326$at_check_filter
52327echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
52328" | \
52329  $at_diff - "$at_stderr" || at_failed=:
52330at_fn_diff_devnull "$at_stdout" || at_failed=:
52331at_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
52348cat >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
52377start: consistent-error-on-a-a 'a' ;
52378
52379consistent-error-on-a-a:
52380    'a' default-reduction
52381  | 'a' default-reduction 'a'
52382  | 'a' shift
52383  ;
52384
52385default-reduction: /*empty*/ ;
52386shift: 'b' ;
52387
52388// Provide another context in which all rules are useful so that this
52389// test case looks a little more realistic.
52390start: 'b' consistent-error-on-a-a 'c' ;
52391
52392
52393%%
52394
52395/*--------.
52396| yylex.  |
52397`--------*/
52398
52399int 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.  */
52407static
52408void yyerror ( const char *msg)
52409{
52410  fprintf (stderr, "%s\n", msg);
52411}
52412
52413
52414/*-------.
52415| main.  |
52416`-------*/
52417
52418int
52419main (void)
52420{
52421  return yyparse ();
52422}
52423_ATEOF
52424
52425
52426
52427if 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"
52435at_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>&-
52439at_status=$? at_failed=false
52440$at_check_filter
52441echo stderr:; cat "$at_stderr"
52442echo stdout:; cat "$at_stdout"
52443at_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"
52449at_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>&-
52452at_status=$? at_failed=false
52453$at_check_filter
52454echo stderr:; cat "$at_stderr"
52455echo stdout:; cat "$at_stdout"
52456at_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"
52465at_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>&-
52470at_status=$? at_failed=false
52471$at_check_filter
52472at_fn_diff_devnull "$at_stderr" || at_failed=:
52473$at_diff expout "$at_stdout" || at_failed=:
52474at_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"
52483at_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>&-
52488at_status=$? at_failed=false
52489$at_check_filter
52490at_fn_diff_devnull "$at_stderr" || at_failed=:
52491$at_diff expout "$at_stdout" || at_failed=:
52492at_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
52498fi
52499{ set +x
52500$as_echo "$at_srcdir/conflicts.at:330: bison -o input.c input.y"
52501at_fn_check_prepare_trace "conflicts.at:330"
52502( $at_check_trace; bison -o input.c input.y
52503) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52504at_status=$? at_failed=false
52505$at_check_filter
52506at_fn_diff_devnull "$at_stderr" || at_failed=:
52507at_fn_diff_devnull "$at_stdout" || at_failed=:
52508at_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"
52515at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:330"
52516( $at_check_trace; $BISON_C_WORKS
52517) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52518at_status=$? at_failed=false
52519$at_check_filter
52520echo stderr:; cat "$at_stderr"
52521echo stdout:; cat "$at_stdout"
52522at_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"
52528at_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>&-
52531at_status=$? at_failed=false
52532$at_check_filter
52533echo stderr:; cat "$at_stderr"
52534echo stdout:; cat "$at_stdout"
52535at_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"
52545at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:330"
52546( $at_check_trace;  $PREPARSER ./input
52547) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52548at_status=$? at_failed=false
52549$at_check_filter
52550echo stderr:; tee stderr <"$at_stderr"
52551at_fn_diff_devnull "$at_stdout" || at_failed=:
52552at_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"
52558at_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>&-
52561at_status=$? at_failed=false
52562$at_check_filter
52563echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
52564" | \
52565  $at_diff - "$at_stderr" || at_failed=:
52566at_fn_diff_devnull "$at_stdout" || at_failed=:
52567at_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
52586cat >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
52616start: consistent-error-on-a-a 'a' ;
52617
52618consistent-error-on-a-a:
52619    'a' default-reduction
52620  | 'a' default-reduction 'a'
52621  | 'a' shift
52622  ;
52623
52624default-reduction: /*empty*/ ;
52625shift: 'b' ;
52626
52627// Provide another context in which all rules are useful so that this
52628// test case looks a little more realistic.
52629start: 'b' consistent-error-on-a-a 'c' ;
52630
52631
52632%%
52633
52634/*--------.
52635| yylex.  |
52636`--------*/
52637
52638int 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.  */
52646static
52647void yyerror ( const char *msg)
52648{
52649  fprintf (stderr, "%s\n", msg);
52650}
52651
52652
52653/*-------.
52654| main.  |
52655`-------*/
52656
52657int
52658main (void)
52659{
52660  return yyparse ();
52661}
52662_ATEOF
52663
52664
52665
52666if 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"
52674at_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>&-
52678at_status=$? at_failed=false
52679$at_check_filter
52680echo stderr:; cat "$at_stderr"
52681echo stdout:; cat "$at_stdout"
52682at_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"
52688at_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>&-
52691at_status=$? at_failed=false
52692$at_check_filter
52693echo stderr:; cat "$at_stderr"
52694echo stdout:; cat "$at_stdout"
52695at_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"
52704at_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>&-
52709at_status=$? at_failed=false
52710$at_check_filter
52711at_fn_diff_devnull "$at_stderr" || at_failed=:
52712$at_diff expout "$at_stdout" || at_failed=:
52713at_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"
52722at_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>&-
52727at_status=$? at_failed=false
52728$at_check_filter
52729at_fn_diff_devnull "$at_stderr" || at_failed=:
52730$at_diff expout "$at_stdout" || at_failed=:
52731at_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
52737fi
52738{ set +x
52739$as_echo "$at_srcdir/conflicts.at:336: bison -o input.c input.y"
52740at_fn_check_prepare_trace "conflicts.at:336"
52741( $at_check_trace; bison -o input.c input.y
52742) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52743at_status=$? at_failed=false
52744$at_check_filter
52745at_fn_diff_devnull "$at_stderr" || at_failed=:
52746at_fn_diff_devnull "$at_stdout" || at_failed=:
52747at_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"
52754at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:336"
52755( $at_check_trace; $BISON_C_WORKS
52756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52757at_status=$? at_failed=false
52758$at_check_filter
52759echo stderr:; cat "$at_stderr"
52760echo stdout:; cat "$at_stdout"
52761at_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"
52767at_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>&-
52770at_status=$? at_failed=false
52771$at_check_filter
52772echo stderr:; cat "$at_stderr"
52773echo stdout:; cat "$at_stdout"
52774at_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"
52784at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:336"
52785( $at_check_trace;  $PREPARSER ./input
52786) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52787at_status=$? at_failed=false
52788$at_check_filter
52789echo stderr:; tee stderr <"$at_stderr"
52790at_fn_diff_devnull "$at_stdout" || at_failed=:
52791at_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"
52797at_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>&-
52800at_status=$? at_failed=false
52801$at_check_filter
52802echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b'
52803" | \
52804  $at_diff - "$at_stderr" || at_failed=:
52805at_fn_diff_devnull "$at_stdout" || at_failed=:
52806at_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
52823cat >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
52853start: consistent-error-on-a-a 'a' ;
52854
52855consistent-error-on-a-a:
52856    'a' default-reduction
52857  | 'a' default-reduction 'a'
52858  | 'a' shift
52859  ;
52860
52861default-reduction: /*empty*/ ;
52862shift: 'b' ;
52863
52864// Provide another context in which all rules are useful so that this
52865// test case looks a little more realistic.
52866start: 'b' consistent-error-on-a-a 'c' ;
52867
52868
52869%%
52870
52871/*--------.
52872| yylex.  |
52873`--------*/
52874
52875int 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.  */
52883static
52884void yyerror ( const char *msg)
52885{
52886  fprintf (stderr, "%s\n", msg);
52887}
52888
52889
52890/*-------.
52891| main.  |
52892`-------*/
52893
52894int
52895main (void)
52896{
52897  return yyparse ();
52898}
52899_ATEOF
52900
52901
52902
52903if 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"
52911at_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>&-
52915at_status=$? at_failed=false
52916$at_check_filter
52917echo stderr:; cat "$at_stderr"
52918echo stdout:; cat "$at_stdout"
52919at_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"
52925at_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>&-
52928at_status=$? at_failed=false
52929$at_check_filter
52930echo stderr:; cat "$at_stderr"
52931echo stdout:; cat "$at_stdout"
52932at_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"
52941at_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>&-
52946at_status=$? at_failed=false
52947$at_check_filter
52948at_fn_diff_devnull "$at_stderr" || at_failed=:
52949$at_diff expout "$at_stdout" || at_failed=:
52950at_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"
52959at_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>&-
52964at_status=$? at_failed=false
52965$at_check_filter
52966at_fn_diff_devnull "$at_stderr" || at_failed=:
52967$at_diff expout "$at_stdout" || at_failed=:
52968at_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
52974fi
52975{ set +x
52976$as_echo "$at_srcdir/conflicts.at:341: bison -o input.c input.y"
52977at_fn_check_prepare_trace "conflicts.at:341"
52978( $at_check_trace; bison -o input.c input.y
52979) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52980at_status=$? at_failed=false
52981$at_check_filter
52982at_fn_diff_devnull "$at_stderr" || at_failed=:
52983at_fn_diff_devnull "$at_stdout" || at_failed=:
52984at_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"
52991at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:341"
52992( $at_check_trace; $BISON_C_WORKS
52993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
52994at_status=$? at_failed=false
52995$at_check_filter
52996echo stderr:; cat "$at_stderr"
52997echo stdout:; cat "$at_stdout"
52998at_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"
53004at_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>&-
53007at_status=$? at_failed=false
53008$at_check_filter
53009echo stderr:; cat "$at_stderr"
53010echo stdout:; cat "$at_stdout"
53011at_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"
53021at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:341"
53022( $at_check_trace;  $PREPARSER ./input
53023) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53024at_status=$? at_failed=false
53025$at_check_filter
53026echo stderr:; tee stderr <"$at_stderr"
53027at_fn_diff_devnull "$at_stdout" || at_failed=:
53028at_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"
53034at_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>&-
53037at_status=$? at_failed=false
53038$at_check_filter
53039echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b'
53040" | \
53041  $at_diff - "$at_stderr" || at_failed=:
53042at_fn_diff_devnull "$at_stdout" || at_failed=:
53043at_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
53067cat >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.
53114start: error-reduce consistent-error 'a' { USE ($3); } ;
53115
53116error-reduce:
53117  'a' 'a' consistent-reduction consistent-error 'a'
53118  { USE (($1, $2, $5)); }
53119| 'a' error
53120  { USE ($1); }
53121;
53122
53123consistent-reduction: /*empty*/ {
53124  assert (yychar == YYEMPTY);
53125  yylval = 0;
53126  yychar = 'b';
53127} ;
53128
53129consistent-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.
53136start: 'b' consistent-error 'b' ;
53137
53138
53139%%
53140
53141/*--------.
53142| yylex.  |
53143`--------*/
53144
53145int 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.  */
53153static
53154void yyerror ( const char *msg)
53155{
53156  fprintf (stderr, "%s\n", msg);
53157}
53158
53159
53160/*-------.
53161| main.  |
53162`-------*/
53163
53164int
53165main (void)
53166{
53167  return yyparse ();
53168}
53169_ATEOF
53170
53171
53172
53173if 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"
53181at_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>&-
53185at_status=$? at_failed=false
53186$at_check_filter
53187echo stderr:; cat "$at_stderr"
53188echo stdout:; cat "$at_stdout"
53189at_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"
53195at_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>&-
53198at_status=$? at_failed=false
53199$at_check_filter
53200echo stderr:; cat "$at_stderr"
53201echo stdout:; cat "$at_stdout"
53202at_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"
53211at_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>&-
53216at_status=$? at_failed=false
53217$at_check_filter
53218at_fn_diff_devnull "$at_stderr" || at_failed=:
53219$at_diff expout "$at_stdout" || at_failed=:
53220at_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"
53229at_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>&-
53234at_status=$? at_failed=false
53235$at_check_filter
53236at_fn_diff_devnull "$at_stderr" || at_failed=:
53237$at_diff expout "$at_stdout" || at_failed=:
53238at_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
53244fi
53245{ set +x
53246$as_echo "$at_srcdir/conflicts.at:397: bison -o input.c input.y"
53247at_fn_check_prepare_trace "conflicts.at:397"
53248( $at_check_trace; bison -o input.c input.y
53249) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53250at_status=$? at_failed=false
53251$at_check_filter
53252at_fn_diff_devnull "$at_stderr" || at_failed=:
53253at_fn_diff_devnull "$at_stdout" || at_failed=:
53254at_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"
53261at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:397"
53262( $at_check_trace; $BISON_C_WORKS
53263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53264at_status=$? at_failed=false
53265$at_check_filter
53266echo stderr:; cat "$at_stderr"
53267echo stdout:; cat "$at_stdout"
53268at_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"
53274at_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>&-
53277at_status=$? at_failed=false
53278$at_check_filter
53279echo stderr:; cat "$at_stderr"
53280echo stdout:; cat "$at_stdout"
53281at_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"
53291at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:397"
53292( $at_check_trace;  $PREPARSER ./input
53293) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53294at_status=$? at_failed=false
53295$at_check_filter
53296echo stderr:; tee stderr <"$at_stderr"
53297at_fn_diff_devnull "$at_stdout" || at_failed=:
53298at_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"
53304at_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>&-
53307at_status=$? at_failed=false
53308$at_check_filter
53309echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
53310" | \
53311  $at_diff - "$at_stderr" || at_failed=:
53312at_fn_diff_devnull "$at_stdout" || at_failed=:
53313at_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
53330cat >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.
53377start: error-reduce consistent-error 'a' { USE ($3); } ;
53378
53379error-reduce:
53380  'a' 'a' consistent-reduction consistent-error 'a'
53381  { USE (($1, $2, $5)); }
53382| 'a' error
53383  { USE ($1); }
53384;
53385
53386consistent-reduction: /*empty*/ {
53387  assert (yychar == YYEMPTY);
53388  yylval = 0;
53389  yychar = 'b';
53390} ;
53391
53392consistent-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.
53399start: 'b' consistent-error 'b' ;
53400
53401
53402%%
53403
53404/*--------.
53405| yylex.  |
53406`--------*/
53407
53408int 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.  */
53416static
53417void yyerror ( const char *msg)
53418{
53419  fprintf (stderr, "%s\n", msg);
53420}
53421
53422
53423/*-------.
53424| main.  |
53425`-------*/
53426
53427int
53428main (void)
53429{
53430  return yyparse ();
53431}
53432_ATEOF
53433
53434
53435
53436if 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"
53444at_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>&-
53448at_status=$? at_failed=false
53449$at_check_filter
53450echo stderr:; cat "$at_stderr"
53451echo stdout:; cat "$at_stdout"
53452at_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"
53458at_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>&-
53461at_status=$? at_failed=false
53462$at_check_filter
53463echo stderr:; cat "$at_stderr"
53464echo stdout:; cat "$at_stdout"
53465at_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"
53474at_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>&-
53479at_status=$? at_failed=false
53480$at_check_filter
53481at_fn_diff_devnull "$at_stderr" || at_failed=:
53482$at_diff expout "$at_stdout" || at_failed=:
53483at_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"
53492at_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>&-
53497at_status=$? at_failed=false
53498$at_check_filter
53499at_fn_diff_devnull "$at_stderr" || at_failed=:
53500$at_diff expout "$at_stdout" || at_failed=:
53501at_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
53507fi
53508{ set +x
53509$as_echo "$at_srcdir/conflicts.at:401: bison -o input.c input.y"
53510at_fn_check_prepare_trace "conflicts.at:401"
53511( $at_check_trace; bison -o input.c input.y
53512) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53513at_status=$? at_failed=false
53514$at_check_filter
53515at_fn_diff_devnull "$at_stderr" || at_failed=:
53516at_fn_diff_devnull "$at_stdout" || at_failed=:
53517at_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"
53524at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:401"
53525( $at_check_trace; $BISON_C_WORKS
53526) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53527at_status=$? at_failed=false
53528$at_check_filter
53529echo stderr:; cat "$at_stderr"
53530echo stdout:; cat "$at_stdout"
53531at_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"
53537at_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>&-
53540at_status=$? at_failed=false
53541$at_check_filter
53542echo stderr:; cat "$at_stderr"
53543echo stdout:; cat "$at_stdout"
53544at_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"
53554at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:401"
53555( $at_check_trace;  $PREPARSER ./input
53556) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53557at_status=$? at_failed=false
53558$at_check_filter
53559echo stderr:; tee stderr <"$at_stderr"
53560at_fn_diff_devnull "$at_stdout" || at_failed=:
53561at_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"
53567at_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>&-
53570at_status=$? at_failed=false
53571$at_check_filter
53572echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
53573" | \
53574  $at_diff - "$at_stderr" || at_failed=:
53575at_fn_diff_devnull "$at_stdout" || at_failed=:
53576at_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
53593cat >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.
53639start: error-reduce consistent-error 'a' { USE ($3); } ;
53640
53641error-reduce:
53642  'a' 'a' consistent-reduction consistent-error 'a'
53643  { USE (($1, $2, $5)); }
53644| 'a' error
53645  { USE ($1); }
53646;
53647
53648consistent-reduction: /*empty*/ {
53649  assert (yychar == yyempty_);
53650  yylval = 0;
53651  yychar = 'b';
53652} ;
53653
53654consistent-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.
53661start: 'b' consistent-error 'b' ;
53662
53663
53664%%
53665
53666/*--------.
53667| yylex.  |
53668`--------*/
53669
53670int 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.  */
53677void
53678yy::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
53689int
53690main (void)
53691{
53692  yy::parser parser;
53693  return parser.parse ();
53694}
53695_ATEOF
53696
53697
53698
53699if 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"
53707at_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>&-
53711at_status=$? at_failed=false
53712$at_check_filter
53713echo stderr:; cat "$at_stderr"
53714echo stdout:; cat "$at_stdout"
53715at_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"
53721at_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>&-
53724at_status=$? at_failed=false
53725$at_check_filter
53726echo stderr:; cat "$at_stderr"
53727echo stdout:; cat "$at_stdout"
53728at_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"
53737at_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>&-
53742at_status=$? at_failed=false
53743$at_check_filter
53744at_fn_diff_devnull "$at_stderr" || at_failed=:
53745$at_diff expout "$at_stdout" || at_failed=:
53746at_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"
53755at_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>&-
53760at_status=$? at_failed=false
53761$at_check_filter
53762at_fn_diff_devnull "$at_stderr" || at_failed=:
53763$at_diff expout "$at_stdout" || at_failed=:
53764at_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
53770fi
53771{ set +x
53772$as_echo "$at_srcdir/conflicts.at:405: bison -o input.cc input.y"
53773at_fn_check_prepare_trace "conflicts.at:405"
53774( $at_check_trace; bison -o input.cc input.y
53775) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53776at_status=$? at_failed=false
53777$at_check_filter
53778at_fn_diff_devnull "$at_stderr" || at_failed=:
53779at_fn_diff_devnull "$at_stdout" || at_failed=:
53780at_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"
53788at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:405"
53789( $at_check_trace; $BISON_CXX_WORKS
53790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53791at_status=$? at_failed=false
53792$at_check_filter
53793echo stderr:; cat "$at_stderr"
53794echo stdout:; cat "$at_stdout"
53795at_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"
53801at_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>&-
53804at_status=$? at_failed=false
53805$at_check_filter
53806echo stderr:; cat "$at_stderr"
53807echo stdout:; cat "$at_stdout"
53808at_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"
53818at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:405"
53819( $at_check_trace;  $PREPARSER ./input
53820) >>"$at_stdout" 2>>"$at_stderr" 5>&-
53821at_status=$? at_failed=false
53822$at_check_filter
53823echo stderr:; tee stderr <"$at_stderr"
53824at_fn_diff_devnull "$at_stdout" || at_failed=:
53825at_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"
53831at_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>&-
53834at_status=$? at_failed=false
53835$at_check_filter
53836echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
53837" | \
53838  $at_diff - "$at_stderr" || at_failed=:
53839at_fn_diff_devnull "$at_stdout" || at_failed=:
53840at_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
53859cat >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.
53906start: error-reduce consistent-error 'a' { USE ($3); } ;
53907
53908error-reduce:
53909  'a' 'a' consistent-reduction consistent-error 'a'
53910  { USE (($1, $2, $5)); }
53911| 'a' error
53912  { USE ($1); }
53913;
53914
53915consistent-reduction: /*empty*/ {
53916  assert (yychar == YYEMPTY);
53917  yylval = 0;
53918  yychar = 'b';
53919} ;
53920
53921consistent-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.
53928start: 'b' consistent-error 'b' ;
53929
53930
53931%%
53932
53933/*--------.
53934| yylex.  |
53935`--------*/
53936
53937int 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.  */
53945static
53946void yyerror ( const char *msg)
53947{
53948  fprintf (stderr, "%s\n", msg);
53949}
53950
53951
53952/*-------.
53953| main.  |
53954`-------*/
53955
53956int
53957main (void)
53958{
53959  return yyparse ();
53960}
53961_ATEOF
53962
53963
53964
53965if 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"
53973at_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>&-
53977at_status=$? at_failed=false
53978$at_check_filter
53979echo stderr:; cat "$at_stderr"
53980echo stdout:; cat "$at_stdout"
53981at_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"
53987at_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>&-
53990at_status=$? at_failed=false
53991$at_check_filter
53992echo stderr:; cat "$at_stderr"
53993echo stdout:; cat "$at_stdout"
53994at_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"
54003at_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>&-
54008at_status=$? at_failed=false
54009$at_check_filter
54010at_fn_diff_devnull "$at_stderr" || at_failed=:
54011$at_diff expout "$at_stdout" || at_failed=:
54012at_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"
54021at_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>&-
54026at_status=$? at_failed=false
54027$at_check_filter
54028at_fn_diff_devnull "$at_stderr" || at_failed=:
54029$at_diff expout "$at_stdout" || at_failed=:
54030at_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
54036fi
54037{ set +x
54038$as_echo "$at_srcdir/conflicts.at:411: bison -o input.c input.y"
54039at_fn_check_prepare_trace "conflicts.at:411"
54040( $at_check_trace; bison -o input.c input.y
54041) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54042at_status=$? at_failed=false
54043$at_check_filter
54044at_fn_diff_devnull "$at_stderr" || at_failed=:
54045at_fn_diff_devnull "$at_stdout" || at_failed=:
54046at_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"
54053at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:411"
54054( $at_check_trace; $BISON_C_WORKS
54055) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54056at_status=$? at_failed=false
54057$at_check_filter
54058echo stderr:; cat "$at_stderr"
54059echo stdout:; cat "$at_stdout"
54060at_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"
54066at_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>&-
54069at_status=$? at_failed=false
54070$at_check_filter
54071echo stderr:; cat "$at_stderr"
54072echo stdout:; cat "$at_stdout"
54073at_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"
54083at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:411"
54084( $at_check_trace;  $PREPARSER ./input
54085) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54086at_status=$? at_failed=false
54087$at_check_filter
54088echo stderr:; tee stderr <"$at_stderr"
54089at_fn_diff_devnull "$at_stdout" || at_failed=:
54090at_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"
54096at_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>&-
54099at_status=$? at_failed=false
54100$at_check_filter
54101echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
54102" | \
54103  $at_diff - "$at_stderr" || at_failed=:
54104at_fn_diff_devnull "$at_stdout" || at_failed=:
54105at_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
54124cat >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.
54171start: error-reduce consistent-error 'a' { USE ($3); } ;
54172
54173error-reduce:
54174  'a' 'a' consistent-reduction consistent-error 'a'
54175  { USE (($1, $2, $5)); }
54176| 'a' error
54177  { USE ($1); }
54178;
54179
54180consistent-reduction: /*empty*/ {
54181  assert (yychar == YYEMPTY);
54182  yylval = 0;
54183  yychar = 'b';
54184} ;
54185
54186consistent-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.
54193start: 'b' consistent-error 'b' ;
54194
54195
54196%%
54197
54198/*--------.
54199| yylex.  |
54200`--------*/
54201
54202int 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.  */
54210static
54211void yyerror ( const char *msg)
54212{
54213  fprintf (stderr, "%s\n", msg);
54214}
54215
54216
54217/*-------.
54218| main.  |
54219`-------*/
54220
54221int
54222main (void)
54223{
54224  return yyparse ();
54225}
54226_ATEOF
54227
54228
54229
54230if 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"
54238at_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>&-
54242at_status=$? at_failed=false
54243$at_check_filter
54244echo stderr:; cat "$at_stderr"
54245echo stdout:; cat "$at_stdout"
54246at_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"
54252at_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>&-
54255at_status=$? at_failed=false
54256$at_check_filter
54257echo stderr:; cat "$at_stderr"
54258echo stdout:; cat "$at_stdout"
54259at_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"
54268at_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>&-
54273at_status=$? at_failed=false
54274$at_check_filter
54275at_fn_diff_devnull "$at_stderr" || at_failed=:
54276$at_diff expout "$at_stdout" || at_failed=:
54277at_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"
54286at_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>&-
54291at_status=$? at_failed=false
54292$at_check_filter
54293at_fn_diff_devnull "$at_stderr" || at_failed=:
54294$at_diff expout "$at_stdout" || at_failed=:
54295at_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
54301fi
54302{ set +x
54303$as_echo "$at_srcdir/conflicts.at:417: bison -o input.c input.y"
54304at_fn_check_prepare_trace "conflicts.at:417"
54305( $at_check_trace; bison -o input.c input.y
54306) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54307at_status=$? at_failed=false
54308$at_check_filter
54309at_fn_diff_devnull "$at_stderr" || at_failed=:
54310at_fn_diff_devnull "$at_stdout" || at_failed=:
54311at_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"
54318at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:417"
54319( $at_check_trace; $BISON_C_WORKS
54320) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54321at_status=$? at_failed=false
54322$at_check_filter
54323echo stderr:; cat "$at_stderr"
54324echo stdout:; cat "$at_stdout"
54325at_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"
54331at_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>&-
54334at_status=$? at_failed=false
54335$at_check_filter
54336echo stderr:; cat "$at_stderr"
54337echo stdout:; cat "$at_stdout"
54338at_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"
54348at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:417"
54349( $at_check_trace;  $PREPARSER ./input
54350) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54351at_status=$? at_failed=false
54352$at_check_filter
54353echo stderr:; tee stderr <"$at_stderr"
54354at_fn_diff_devnull "$at_stdout" || at_failed=:
54355at_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"
54361at_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>&-
54364at_status=$? at_failed=false
54365$at_check_filter
54366echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a'
54367" | \
54368  $at_diff - "$at_stderr" || at_failed=:
54369at_fn_diff_devnull "$at_stdout" || at_failed=:
54370at_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
54387cat >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.
54434start: error-reduce consistent-error 'a' { USE ($3); } ;
54435
54436error-reduce:
54437  'a' 'a' consistent-reduction consistent-error 'a'
54438  { USE (($1, $2, $5)); }
54439| 'a' error
54440  { USE ($1); }
54441;
54442
54443consistent-reduction: /*empty*/ {
54444  assert (yychar == YYEMPTY);
54445  yylval = 0;
54446  yychar = 'b';
54447} ;
54448
54449consistent-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.
54456start: 'b' consistent-error 'b' ;
54457
54458
54459%%
54460
54461/*--------.
54462| yylex.  |
54463`--------*/
54464
54465int 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.  */
54473static
54474void yyerror ( const char *msg)
54475{
54476  fprintf (stderr, "%s\n", msg);
54477}
54478
54479
54480/*-------.
54481| main.  |
54482`-------*/
54483
54484int
54485main (void)
54486{
54487  return yyparse ();
54488}
54489_ATEOF
54490
54491
54492
54493if 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"
54501at_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>&-
54505at_status=$? at_failed=false
54506$at_check_filter
54507echo stderr:; cat "$at_stderr"
54508echo stdout:; cat "$at_stdout"
54509at_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"
54515at_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>&-
54518at_status=$? at_failed=false
54519$at_check_filter
54520echo stderr:; cat "$at_stderr"
54521echo stdout:; cat "$at_stdout"
54522at_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"
54531at_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>&-
54536at_status=$? at_failed=false
54537$at_check_filter
54538at_fn_diff_devnull "$at_stderr" || at_failed=:
54539$at_diff expout "$at_stdout" || at_failed=:
54540at_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"
54549at_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>&-
54554at_status=$? at_failed=false
54555$at_check_filter
54556at_fn_diff_devnull "$at_stderr" || at_failed=:
54557$at_diff expout "$at_stdout" || at_failed=:
54558at_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
54564fi
54565{ set +x
54566$as_echo "$at_srcdir/conflicts.at:421: bison -o input.c input.y"
54567at_fn_check_prepare_trace "conflicts.at:421"
54568( $at_check_trace; bison -o input.c input.y
54569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54570at_status=$? at_failed=false
54571$at_check_filter
54572at_fn_diff_devnull "$at_stderr" || at_failed=:
54573at_fn_diff_devnull "$at_stdout" || at_failed=:
54574at_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"
54581at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:421"
54582( $at_check_trace; $BISON_C_WORKS
54583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54584at_status=$? at_failed=false
54585$at_check_filter
54586echo stderr:; cat "$at_stderr"
54587echo stdout:; cat "$at_stdout"
54588at_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"
54594at_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>&-
54597at_status=$? at_failed=false
54598$at_check_filter
54599echo stderr:; cat "$at_stderr"
54600echo stdout:; cat "$at_stdout"
54601at_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"
54611at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:421"
54612( $at_check_trace;  $PREPARSER ./input
54613) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54614at_status=$? at_failed=false
54615$at_check_filter
54616echo stderr:; tee stderr <"$at_stderr"
54617at_fn_diff_devnull "$at_stdout" || at_failed=:
54618at_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"
54624at_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>&-
54627at_status=$? at_failed=false
54628$at_check_filter
54629echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a'
54630" | \
54631  $at_diff - "$at_stderr" || at_failed=:
54632at_fn_diff_devnull "$at_stdout" || at_failed=:
54633at_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
54651cat >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.
54698start: error-reduce consistent-error 'a' { USE ($3); } ;
54699
54700error-reduce:
54701  'a' 'a' consistent-reduction consistent-error 'a'
54702  { USE (($1, $2, $5)); }
54703| 'a' error
54704  { USE ($1); }
54705;
54706
54707consistent-reduction: /*empty*/ {
54708  assert (yychar == YYEMPTY);
54709  yylval = 0;
54710  yychar = 'b';
54711} ;
54712
54713consistent-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.
54720start: 'b' consistent-error 'b' ;
54721
54722
54723%%
54724
54725/*--------.
54726| yylex.  |
54727`--------*/
54728
54729int 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.  */
54737static
54738void yyerror ( const char *msg)
54739{
54740  fprintf (stderr, "%s\n", msg);
54741}
54742
54743
54744/*-------.
54745| main.  |
54746`-------*/
54747
54748int
54749main (void)
54750{
54751  return yyparse ();
54752}
54753_ATEOF
54754
54755
54756
54757if 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"
54765at_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>&-
54769at_status=$? at_failed=false
54770$at_check_filter
54771echo stderr:; cat "$at_stderr"
54772echo stdout:; cat "$at_stdout"
54773at_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"
54779at_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>&-
54782at_status=$? at_failed=false
54783$at_check_filter
54784echo stderr:; cat "$at_stderr"
54785echo stdout:; cat "$at_stdout"
54786at_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"
54795at_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>&-
54800at_status=$? at_failed=false
54801$at_check_filter
54802at_fn_diff_devnull "$at_stderr" || at_failed=:
54803$at_diff expout "$at_stdout" || at_failed=:
54804at_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"
54813at_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>&-
54818at_status=$? at_failed=false
54819$at_check_filter
54820at_fn_diff_devnull "$at_stderr" || at_failed=:
54821$at_diff expout "$at_stdout" || at_failed=:
54822at_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
54828fi
54829{ set +x
54830$as_echo "$at_srcdir/conflicts.at:426: bison -o input.c input.y"
54831at_fn_check_prepare_trace "conflicts.at:426"
54832( $at_check_trace; bison -o input.c input.y
54833) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54834at_status=$? at_failed=false
54835$at_check_filter
54836at_fn_diff_devnull "$at_stderr" || at_failed=:
54837at_fn_diff_devnull "$at_stdout" || at_failed=:
54838at_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"
54845at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:426"
54846( $at_check_trace; $BISON_C_WORKS
54847) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54848at_status=$? at_failed=false
54849$at_check_filter
54850echo stderr:; cat "$at_stderr"
54851echo stdout:; cat "$at_stdout"
54852at_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"
54858at_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>&-
54861at_status=$? at_failed=false
54862$at_check_filter
54863echo stderr:; cat "$at_stderr"
54864echo stdout:; cat "$at_stdout"
54865at_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"
54875at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:426"
54876( $at_check_trace;  $PREPARSER ./input
54877) >>"$at_stdout" 2>>"$at_stderr" 5>&-
54878at_status=$? at_failed=false
54879$at_check_filter
54880echo stderr:; tee stderr <"$at_stderr"
54881at_fn_diff_devnull "$at_stdout" || at_failed=:
54882at_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"
54888at_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>&-
54891at_status=$? at_failed=false
54892$at_check_filter
54893echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
54894" | \
54895  $at_diff - "$at_stderr" || at_failed=:
54896at_fn_diff_devnull "$at_stdout" || at_failed=:
54897at_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
54914cat >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.
54962start: error-reduce consistent-error 'a' { USE ($3); } ;
54963
54964error-reduce:
54965  'a' 'a' consistent-reduction consistent-error 'a'
54966  { USE (($1, $2, $5)); }
54967| 'a' error
54968  { USE ($1); }
54969;
54970
54971consistent-reduction: /*empty*/ {
54972  assert (yychar == YYEMPTY);
54973  yylval = 0;
54974  yychar = 'b';
54975} ;
54976
54977consistent-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.
54984start: 'b' consistent-error 'b' ;
54985
54986
54987%%
54988
54989/*--------.
54990| yylex.  |
54991`--------*/
54992
54993int 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.  */
55001static
55002void yyerror ( const char *msg)
55003{
55004  fprintf (stderr, "%s\n", msg);
55005}
55006
55007
55008/*-------.
55009| main.  |
55010`-------*/
55011
55012int
55013main (void)
55014{
55015  return yyparse ();
55016}
55017_ATEOF
55018
55019
55020
55021if 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"
55029at_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>&-
55033at_status=$? at_failed=false
55034$at_check_filter
55035echo stderr:; cat "$at_stderr"
55036echo stdout:; cat "$at_stdout"
55037at_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"
55043at_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>&-
55046at_status=$? at_failed=false
55047$at_check_filter
55048echo stderr:; cat "$at_stderr"
55049echo stdout:; cat "$at_stdout"
55050at_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"
55059at_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>&-
55064at_status=$? at_failed=false
55065$at_check_filter
55066at_fn_diff_devnull "$at_stderr" || at_failed=:
55067$at_diff expout "$at_stdout" || at_failed=:
55068at_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"
55077at_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>&-
55082at_status=$? at_failed=false
55083$at_check_filter
55084at_fn_diff_devnull "$at_stderr" || at_failed=:
55085$at_diff expout "$at_stdout" || at_failed=:
55086at_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
55092fi
55093{ set +x
55094$as_echo "$at_srcdir/conflicts.at:430: bison -o input.c input.y"
55095at_fn_check_prepare_trace "conflicts.at:430"
55096( $at_check_trace; bison -o input.c input.y
55097) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55098at_status=$? at_failed=false
55099$at_check_filter
55100at_fn_diff_devnull "$at_stderr" || at_failed=:
55101at_fn_diff_devnull "$at_stdout" || at_failed=:
55102at_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"
55109at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:430"
55110( $at_check_trace; $BISON_C_WORKS
55111) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55112at_status=$? at_failed=false
55113$at_check_filter
55114echo stderr:; cat "$at_stderr"
55115echo stdout:; cat "$at_stdout"
55116at_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"
55122at_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>&-
55125at_status=$? at_failed=false
55126$at_check_filter
55127echo stderr:; cat "$at_stderr"
55128echo stdout:; cat "$at_stdout"
55129at_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"
55139at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:430"
55140( $at_check_trace;  $PREPARSER ./input
55141) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55142at_status=$? at_failed=false
55143$at_check_filter
55144echo stderr:; tee stderr <"$at_stderr"
55145at_fn_diff_devnull "$at_stdout" || at_failed=:
55146at_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"
55152at_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>&-
55155at_status=$? at_failed=false
55156$at_check_filter
55157echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
55158" | \
55159  $at_diff - "$at_stderr" || at_failed=:
55160at_fn_diff_devnull "$at_stdout" || at_failed=:
55161at_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
55181read at_status <"$at_status_file"
55182#AT_STOP_183
55183#AT_START_184
55184at_fn_group_banner 184 'conflicts.at:456' \
55185  "LAC: %nonassoc requires splitting canonical LR states" "" 10
55186at_xfail=no
55187(
55188  $as_echo "184. $at_setup_line: testing $at_desc ..."
55189  $at_traceon
55190
55191
55192cat >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
55212start:
55213  'a' problem 'a' // First context.
55214| 'b' problem 'b' // Second context.
55215| 'c' reduce-nonassoc // Just makes reduce-nonassoc useful.
55216;
55217
55218problem:
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.
55232look:
55233  'a' // Reduction lookahead set is always ['a', 'b'].
55234| 'a' 'b'
55235| 'a' 'c' // 'c' is forgotten as an expected token.
55236;
55237
55238reduce-nonassoc: %prec 'a';
55239
55240%%
55241#include <stdio.h>
55242/* A C error reporting function.  */
55243static
55244void yyerror ( const char *msg)
55245{
55246  fprintf (stderr, "%s\n", msg);
55247}
55248#include <assert.h>
55249static
55250int 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
55262int
55263main (void)
55264{
55265  return yyparse ();
55266}
55267_ATEOF
55268
55269
55270
55271
55272# Show canonical LR's failure.
55273if 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"
55281at_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>&-
55285at_status=$? at_failed=false
55286$at_check_filter
55287echo stderr:; cat "$at_stderr"
55288echo stdout:; cat "$at_stdout"
55289at_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"
55295at_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>&-
55298at_status=$? at_failed=false
55299$at_check_filter
55300echo stderr:; cat "$at_stderr"
55301echo stdout:; cat "$at_stdout"
55302at_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"
55311at_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>&-
55316at_status=$? at_failed=false
55317$at_check_filter
55318at_fn_diff_devnull "$at_stderr" || at_failed=:
55319$at_diff expout "$at_stdout" || at_failed=:
55320at_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"
55329at_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>&-
55334at_status=$? at_failed=false
55335$at_check_filter
55336at_fn_diff_devnull "$at_stderr" || at_failed=:
55337$at_diff expout "$at_stdout" || at_failed=:
55338at_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
55344fi
55345{ set +x
55346$as_echo "$at_srcdir/conflicts.at:511: bison -Dlr.type=canonical-lr -o input.c input.y"
55347at_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>&-
55350at_status=$? at_failed=false
55351$at_check_filter
55352echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
55353" | \
55354  $at_diff - "$at_stderr" || at_failed=:
55355at_fn_diff_devnull "$at_stdout" || at_failed=:
55356at_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"
55363at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:515"
55364( $at_check_trace; $BISON_C_WORKS
55365) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55366at_status=$? at_failed=false
55367$at_check_filter
55368echo stderr:; cat "$at_stderr"
55369echo stdout:; cat "$at_stdout"
55370at_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"
55376at_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>&-
55379at_status=$? at_failed=false
55380$at_check_filter
55381echo stderr:; cat "$at_stderr"
55382echo stdout:; cat "$at_stdout"
55383at_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"
55389at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:516"
55390( $at_check_trace;  $PREPARSER ./input
55391) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55392at_status=$? at_failed=false
55393$at_check_filter
55394echo stderr:; tee stderr <"$at_stderr"
55395at_fn_diff_devnull "$at_stdout" || at_failed=:
55396at_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"
55402at_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>&-
55405at_status=$? at_failed=false
55406$at_check_filter
55407echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b'
55408" | \
55409  $at_diff - "$at_stderr" || at_failed=:
55410at_fn_diff_devnull "$at_stdout" || at_failed=:
55411at_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.
55418if 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"
55427at_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>&-
55432at_status=$? at_failed=false
55433$at_check_filter
55434echo stderr:; cat "$at_stderr"
55435echo stdout:; cat "$at_stdout"
55436at_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"
55443at_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>&-
55447at_status=$? at_failed=false
55448$at_check_filter
55449echo stderr:; cat "$at_stderr"
55450echo stdout:; cat "$at_stdout"
55451at_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"
55460at_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>&-
55465at_status=$? at_failed=false
55466$at_check_filter
55467at_fn_diff_devnull "$at_stderr" || at_failed=:
55468$at_diff expout "$at_stdout" || at_failed=:
55469at_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"
55478at_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>&-
55483at_status=$? at_failed=false
55484$at_check_filter
55485at_fn_diff_devnull "$at_stderr" || at_failed=:
55486$at_diff expout "$at_stdout" || at_failed=:
55487at_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
55493fi
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"
55497at_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>&-
55501at_status=$? at_failed=false
55502$at_check_filter
55503echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
55504" | \
55505  $at_diff - "$at_stderr" || at_failed=:
55506at_fn_diff_devnull "$at_stdout" || at_failed=:
55507at_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"
55514at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:525"
55515( $at_check_trace; $BISON_C_WORKS
55516) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55517at_status=$? at_failed=false
55518$at_check_filter
55519echo stderr:; cat "$at_stderr"
55520echo stdout:; cat "$at_stdout"
55521at_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"
55527at_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>&-
55530at_status=$? at_failed=false
55531$at_check_filter
55532echo stderr:; cat "$at_stderr"
55533echo stdout:; cat "$at_stdout"
55534at_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"
55540at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:526"
55541( $at_check_trace;  $PREPARSER ./input
55542) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55543at_status=$? at_failed=false
55544$at_check_filter
55545echo stderr:; tee stderr <"$at_stderr"
55546at_fn_diff_devnull "$at_stdout" || at_failed=:
55547at_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"
55553at_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>&-
55556at_status=$? at_failed=false
55557$at_check_filter
55558echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c'
55559" | \
55560  $at_diff - "$at_stderr" || at_failed=:
55561at_fn_diff_devnull "$at_stdout" || at_failed=:
55562at_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.
55569if 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"
55577at_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>&-
55581at_status=$? at_failed=false
55582$at_check_filter
55583echo stderr:; cat "$at_stderr"
55584echo stdout:; cat "$at_stdout"
55585at_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"
55591at_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>&-
55594at_status=$? at_failed=false
55595$at_check_filter
55596echo stderr:; cat "$at_stderr"
55597echo stdout:; cat "$at_stdout"
55598at_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"
55607at_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>&-
55612at_status=$? at_failed=false
55613$at_check_filter
55614at_fn_diff_devnull "$at_stderr" || at_failed=:
55615$at_diff expout "$at_stdout" || at_failed=:
55616at_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"
55625at_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>&-
55630at_status=$? at_failed=false
55631$at_check_filter
55632at_fn_diff_devnull "$at_stderr" || at_failed=:
55633$at_diff expout "$at_stdout" || at_failed=:
55634at_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
55640fi
55641{ set +x
55642$as_echo "$at_srcdir/conflicts.at:531: bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
55643at_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>&-
55646at_status=$? at_failed=false
55647$at_check_filter
55648echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
55649" | \
55650  $at_diff - "$at_stderr" || at_failed=:
55651at_fn_diff_devnull "$at_stdout" || at_failed=:
55652at_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"
55659at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:535"
55660( $at_check_trace; $BISON_C_WORKS
55661) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55662at_status=$? at_failed=false
55663$at_check_filter
55664echo stderr:; cat "$at_stderr"
55665echo stdout:; cat "$at_stdout"
55666at_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"
55672at_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>&-
55675at_status=$? at_failed=false
55676$at_check_filter
55677echo stderr:; cat "$at_stderr"
55678echo stdout:; cat "$at_stdout"
55679at_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"
55685at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:536"
55686( $at_check_trace;  $PREPARSER ./input
55687) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55688at_status=$? at_failed=false
55689$at_check_filter
55690echo stderr:; tee stderr <"$at_stderr"
55691at_fn_diff_devnull "$at_stdout" || at_failed=:
55692at_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"
55698at_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>&-
55701at_status=$? at_failed=false
55702$at_check_filter
55703echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c'
55704" | \
55705  $at_diff - "$at_stderr" || at_failed=:
55706at_fn_diff_devnull "$at_stdout" || at_failed=:
55707at_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
55716read at_status <"$at_status_file"
55717#AT_STOP_184
55718#AT_START_185
55719at_fn_group_banner 185 'conflicts.at:546' \
55720  "Unresolved SR Conflicts" "                        " 10
55721at_xfail=no
55722(
55723  $as_echo "185. $at_setup_line: testing $at_desc ..."
55724  $at_traceon
55725
55726
55727
55728
55729cat >input.y <<'_ATEOF'
55730%token NUM OP
55731%%
55732exp: exp OP exp | NUM;
55733_ATEOF
55734
55735
55736if 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"
55744at_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>&-
55748at_status=$? at_failed=false
55749$at_check_filter
55750echo stderr:; cat "$at_stderr"
55751echo stdout:; cat "$at_stdout"
55752at_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"
55758at_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>&-
55761at_status=$? at_failed=false
55762$at_check_filter
55763echo stderr:; cat "$at_stderr"
55764echo stdout:; cat "$at_stdout"
55765at_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"
55774at_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>&-
55779at_status=$? at_failed=false
55780$at_check_filter
55781at_fn_diff_devnull "$at_stderr" || at_failed=:
55782$at_diff expout "$at_stdout" || at_failed=:
55783at_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"
55792at_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>&-
55797at_status=$? at_failed=false
55798$at_check_filter
55799at_fn_diff_devnull "$at_stderr" || at_failed=:
55800$at_diff expout "$at_stdout" || at_failed=:
55801at_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
55807fi
55808{ set +x
55809$as_echo "$at_srcdir/conflicts.at:556: bison -o input.c --report=all input.y"
55810at_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>&-
55813at_status=$? at_failed=false
55814$at_check_filter
55815echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
55816" | \
55817  $at_diff - "$at_stderr" || at_failed=:
55818at_fn_diff_devnull "$at_stdout" || at_failed=:
55819at_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"
55828at_fn_check_prepare_trace "conflicts.at:561"
55829( $at_check_trace; cat input.output
55830) >>"$at_stdout" 2>>"$at_stderr" 5>&-
55831at_status=$? at_failed=false
55832$at_check_filter
55833at_fn_diff_devnull "$at_stderr" || at_failed=:
55834echo >>"$at_stdout"; $as_echo "State 5 conflicts: 1 shift/reduce
55835
55836
55837Grammar
55838
55839    0 \$accept: exp \$end
55840
55841    1 exp: exp OP exp
55842    2    | NUM
55843
55844
55845Terminals, with rules where they appear
55846
55847\$end (0) 0
55848error (256)
55849NUM (258) 2
55850OP (259) 1
55851
55852
55853Nonterminals, with rules where they appear
55854
55855\$accept (5)
55856    on left: 0
55857exp (6)
55858    on left: 1 2, on right: 0 1
55859
55860
55861State 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
55872State 1
55873
55874    2 exp: NUM .
55875
55876    \$default  reduce using rule 2 (exp)
55877
55878
55879State 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
55888State 3
55889
55890    0 \$accept: exp \$end .
55891
55892    \$default  accept
55893
55894
55895State 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
55906State 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=:
55917at_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
55925read at_status <"$at_status_file"
55926#AT_STOP_185
55927#AT_START_186
55928at_fn_group_banner 186 'conflicts.at:653' \
55929  "Resolved SR Conflicts" "                          " 10
55930at_xfail=no
55931(
55932  $as_echo "186. $at_setup_line: testing $at_desc ..."
55933  $at_traceon
55934
55935
55936
55937
55938cat >input.y <<'_ATEOF'
55939%token NUM OP
55940%left OP
55941%%
55942exp: exp OP exp | NUM;
55943_ATEOF
55944
55945
55946if 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"
55954at_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>&-
55958at_status=$? at_failed=false
55959$at_check_filter
55960echo stderr:; cat "$at_stderr"
55961echo stdout:; cat "$at_stdout"
55962at_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"
55968at_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>&-
55971at_status=$? at_failed=false
55972$at_check_filter
55973echo stderr:; cat "$at_stderr"
55974echo stdout:; cat "$at_stdout"
55975at_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"
55984at_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>&-
55989at_status=$? at_failed=false
55990$at_check_filter
55991at_fn_diff_devnull "$at_stderr" || at_failed=:
55992$at_diff expout "$at_stdout" || at_failed=:
55993at_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"
56002at_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>&-
56007at_status=$? at_failed=false
56008$at_check_filter
56009at_fn_diff_devnull "$at_stderr" || at_failed=:
56010$at_diff expout "$at_stdout" || at_failed=:
56011at_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
56017fi
56018{ set +x
56019$as_echo "$at_srcdir/conflicts.at:664: bison -o input.c --report=all input.y"
56020at_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>&-
56023at_status=$? at_failed=false
56024$at_check_filter
56025at_fn_diff_devnull "$at_stderr" || at_failed=:
56026at_fn_diff_devnull "$at_stdout" || at_failed=:
56027at_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"
56036at_fn_check_prepare_trace "conflicts.at:667"
56037( $at_check_trace; cat input.output
56038) >>"$at_stdout" 2>>"$at_stderr" 5>&-
56039at_status=$? at_failed=false
56040$at_check_filter
56041at_fn_diff_devnull "$at_stderr" || at_failed=:
56042echo >>"$at_stdout"; $as_echo "Grammar
56043
56044    0 \$accept: exp \$end
56045
56046    1 exp: exp OP exp
56047    2    | NUM
56048
56049
56050Terminals, with rules where they appear
56051
56052\$end (0) 0
56053error (256)
56054NUM (258) 2
56055OP (259) 1
56056
56057
56058Nonterminals, with rules where they appear
56059
56060\$accept (5)
56061    on left: 0
56062exp (6)
56063    on left: 1 2, on right: 0 1
56064
56065
56066State 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
56077State 1
56078
56079    2 exp: NUM .
56080
56081    \$default  reduce using rule 2 (exp)
56082
56083
56084State 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
56093State 3
56094
56095    0 \$accept: exp \$end .
56096
56097    \$default  accept
56098
56099
56100State 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
56111State 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=:
56121at_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
56129read at_status <"$at_status_file"
56130#AT_STOP_186
56131#AT_START_187
56132at_fn_group_banner 187 'conflicts.at:775' \
56133  "Defaulted Conflicted Reduction" "                 " 10
56134at_xfail=no
56135(
56136  $as_echo "187. $at_setup_line: testing $at_desc ..."
56137  $at_traceon
56138
56139
56140
56141cat >input.y <<'_ATEOF'
56142%%
56143exp: num | id;
56144num: '0';
56145id : '0';
56146%%
56147_ATEOF
56148
56149
56150if 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"
56158at_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>&-
56162at_status=$? at_failed=false
56163$at_check_filter
56164echo stderr:; cat "$at_stderr"
56165echo stdout:; cat "$at_stdout"
56166at_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"
56172at_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>&-
56175at_status=$? at_failed=false
56176$at_check_filter
56177echo stderr:; cat "$at_stderr"
56178echo stdout:; cat "$at_stdout"
56179at_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"
56188at_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>&-
56193at_status=$? at_failed=false
56194$at_check_filter
56195at_fn_diff_devnull "$at_stderr" || at_failed=:
56196$at_diff expout "$at_stdout" || at_failed=:
56197at_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"
56206at_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>&-
56211at_status=$? at_failed=false
56212$at_check_filter
56213at_fn_diff_devnull "$at_stderr" || at_failed=:
56214$at_diff expout "$at_stdout" || at_failed=:
56215at_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
56221fi
56222{ set +x
56223$as_echo "$at_srcdir/conflicts.at:786: bison -o input.c --report=all input.y"
56224at_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>&-
56227at_status=$? at_failed=false
56228$at_check_filter
56229echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
56230input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
56231" | \
56232  $at_diff - "$at_stderr" || at_failed=:
56233at_fn_diff_devnull "$at_stdout" || at_failed=:
56234at_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.
56241if 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"
56250at_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>&-
56253at_status=$? at_failed=false
56254$at_check_filter
56255echo stderr:; tee stderr <"$at_stderr"
56256$at_diff expout "$at_stdout" || at_failed=:
56257at_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'
56265input.y: conflicts: 1 reduce/reduce
56266input.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"
56296at_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>&-
56300at_status=$? at_failed=false
56301$at_check_filter
56302$at_diff experr "$at_stderr" || at_failed=:
56303at_fn_diff_devnull "$at_stdout" || at_failed=:
56304at_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"
56313at_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>&-
56316at_status=$? at_failed=false
56317$at_check_filter
56318$at_diff experr "$at_stderr" || at_failed=:
56319$at_diff expout "$at_stdout" || at_failed=:
56320at_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"
56330at_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>&-
56333at_status=$? at_failed=false
56334$at_check_filter
56335at_fn_diff_devnull "$at_stderr" || at_failed=:
56336$at_diff expout "$at_stdout" || at_failed=:
56337at_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"
56343at_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>&-
56346at_status=$? at_failed=false
56347$at_check_filter
56348at_fn_diff_devnull "$at_stderr" || at_failed=:
56349$at_diff expout "$at_stdout" || at_failed=:
56350at_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
56356fi
56357
56358# Check the contents of the report.
56359{ set +x
56360$as_echo "$at_srcdir/conflicts.at:792: cat input.output"
56361at_fn_check_prepare_trace "conflicts.at:792"
56362( $at_check_trace; cat input.output
56363) >>"$at_stdout" 2>>"$at_stderr" 5>&-
56364at_status=$? at_failed=false
56365$at_check_filter
56366at_fn_diff_devnull "$at_stderr" || at_failed=:
56367echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts
56368
56369    4 id: '0'
56370
56371
56372State 1 conflicts: 1 reduce/reduce
56373
56374
56375Grammar
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
56387Terminals, with rules where they appear
56388
56389\$end (0) 0
56390'0' (48) 3 4
56391error (256)
56392
56393
56394Nonterminals, with rules where they appear
56395
56396\$accept (4)
56397    on left: 0
56398exp (5)
56399    on left: 1 2, on right: 0
56400num (6)
56401    on left: 3, on right: 1
56402id (7)
56403    on left: 4, on right: 2
56404
56405
56406State 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
56421State 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
56431State 2
56432
56433    0 \$accept: exp . \$end
56434
56435    \$end  shift, and go to state 5
56436
56437
56438State 3
56439
56440    1 exp: num .
56441
56442    \$default  reduce using rule 1 (exp)
56443
56444
56445State 4
56446
56447    2 exp: id .
56448
56449    \$default  reduce using rule 2 (exp)
56450
56451
56452State 5
56453
56454    0 \$accept: exp \$end .
56455
56456    \$default  accept
56457" | \
56458  $at_diff - "$at_stdout" || at_failed=:
56459at_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
56467read at_status <"$at_status_file"
56468#AT_STOP_187
56469#AT_START_188
56470at_fn_group_banner 188 'conflicts.at:894' \
56471  "%expect not enough" "                             " 10
56472at_xfail=no
56473(
56474  $as_echo "188. $at_setup_line: testing $at_desc ..."
56475  $at_traceon
56476
56477
56478cat >input.y <<'_ATEOF'
56479%token NUM OP
56480%expect 0
56481%%
56482exp: 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"
56489at_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>&-
56492at_status=$? at_failed=false
56493$at_check_filter
56494echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
56495input.y: error: expected 0 shift/reduce conflicts
56496" | \
56497  $at_diff - "$at_stderr" || at_failed=:
56498at_fn_diff_devnull "$at_stdout" || at_failed=:
56499at_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
56507read at_status <"$at_status_file"
56508#AT_STOP_188
56509#AT_START_189
56510at_fn_group_banner 189 'conflicts.at:914' \
56511  "%expect right" "                                  " 10
56512at_xfail=no
56513(
56514  $as_echo "189. $at_setup_line: testing $at_desc ..."
56515  $at_traceon
56516
56517
56518cat >input.y <<'_ATEOF'
56519%token NUM OP
56520%expect 1
56521%%
56522exp: exp OP exp | NUM;
56523_ATEOF
56524
56525
56526if 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"
56534at_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>&-
56538at_status=$? at_failed=false
56539$at_check_filter
56540echo stderr:; cat "$at_stderr"
56541echo stdout:; cat "$at_stdout"
56542at_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"
56548at_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>&-
56551at_status=$? at_failed=false
56552$at_check_filter
56553echo stderr:; cat "$at_stderr"
56554echo stdout:; cat "$at_stdout"
56555at_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"
56564at_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>&-
56569at_status=$? at_failed=false
56570$at_check_filter
56571at_fn_diff_devnull "$at_stderr" || at_failed=:
56572$at_diff expout "$at_stdout" || at_failed=:
56573at_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"
56582at_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>&-
56587at_status=$? at_failed=false
56588$at_check_filter
56589at_fn_diff_devnull "$at_stderr" || at_failed=:
56590$at_diff expout "$at_stdout" || at_failed=:
56591at_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
56597fi
56598{ set +x
56599$as_echo "$at_srcdir/conflicts.at:923: bison -o input.c input.y"
56600at_fn_check_prepare_trace "conflicts.at:923"
56601( $at_check_trace; bison -o input.c input.y
56602) >>"$at_stdout" 2>>"$at_stderr" 5>&-
56603at_status=$? at_failed=false
56604$at_check_filter
56605at_fn_diff_devnull "$at_stderr" || at_failed=:
56606at_fn_diff_devnull "$at_stdout" || at_failed=:
56607at_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
56615read at_status <"$at_status_file"
56616#AT_STOP_189
56617#AT_START_190
56618at_fn_group_banner 190 'conflicts.at:931' \
56619  "%expect too much" "                               " 10
56620at_xfail=no
56621(
56622  $as_echo "190. $at_setup_line: testing $at_desc ..."
56623  $at_traceon
56624
56625
56626cat >input.y <<'_ATEOF'
56627%token NUM OP
56628%expect 2
56629%%
56630exp: 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"
56637at_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>&-
56640at_status=$? at_failed=false
56641$at_check_filter
56642echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
56643input.y: error: expected 2 shift/reduce conflicts
56644" | \
56645  $at_diff - "$at_stderr" || at_failed=:
56646at_fn_diff_devnull "$at_stdout" || at_failed=:
56647at_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
56655read at_status <"$at_status_file"
56656#AT_STOP_190
56657#AT_START_191
56658at_fn_group_banner 191 'conflicts.at:951' \
56659  "%expect with reduce conflicts" "                  " 10
56660at_xfail=no
56661(
56662  $as_echo "191. $at_setup_line: testing $at_desc ..."
56663  $at_traceon
56664
56665
56666cat >input.y <<'_ATEOF'
56667%expect 0
56668%%
56669program: a 'a' | a a;
56670a: '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"
56677at_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>&-
56680at_status=$? at_failed=false
56681$at_check_filter
56682echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
56683input.y: error: expected 0 reduce/reduce conflicts
56684" | \
56685  $at_diff - "$at_stderr" || at_failed=:
56686at_fn_diff_devnull "$at_stdout" || at_failed=:
56687at_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
56695read at_status <"$at_status_file"
56696#AT_STOP_191
56697#AT_START_192
56698at_fn_group_banner 192 'conflicts.at:971' \
56699  "%prec with user string" "                         " 10
56700at_xfail=no
56701(
56702  $as_echo "192. $at_setup_line: testing $at_desc ..."
56703  $at_traceon
56704
56705
56706cat >input.y <<'_ATEOF'
56707%%
56708exp:
56709  "foo" %prec "foo"
56710;
56711_ATEOF
56712
56713
56714if 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"
56722at_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>&-
56726at_status=$? at_failed=false
56727$at_check_filter
56728echo stderr:; cat "$at_stderr"
56729echo stdout:; cat "$at_stdout"
56730at_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"
56736at_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>&-
56739at_status=$? at_failed=false
56740$at_check_filter
56741echo stderr:; cat "$at_stderr"
56742echo stdout:; cat "$at_stdout"
56743at_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"
56752at_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>&-
56757at_status=$? at_failed=false
56758$at_check_filter
56759at_fn_diff_devnull "$at_stderr" || at_failed=:
56760$at_diff expout "$at_stdout" || at_failed=:
56761at_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"
56770at_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>&-
56775at_status=$? at_failed=false
56776$at_check_filter
56777at_fn_diff_devnull "$at_stderr" || at_failed=:
56778$at_diff expout "$at_stdout" || at_failed=:
56779at_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
56785fi
56786{ set +x
56787$as_echo "$at_srcdir/conflicts.at:980: bison -o input.c input.y"
56788at_fn_check_prepare_trace "conflicts.at:980"
56789( $at_check_trace; bison -o input.c input.y
56790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
56791at_status=$? at_failed=false
56792$at_check_filter
56793at_fn_diff_devnull "$at_stderr" || at_failed=:
56794at_fn_diff_devnull "$at_stdout" || at_failed=:
56795at_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
56803read at_status <"$at_status_file"
56804#AT_STOP_192
56805#AT_START_193
56806at_fn_group_banner 193 'conflicts.at:988' \
56807  "%no-default-prec without %prec" "                 " 10
56808at_xfail=no
56809(
56810  $as_echo "193. $at_setup_line: testing $at_desc ..."
56811  $at_traceon
56812
56813
56814cat >input.y <<'_ATEOF'
56815%left '+'
56816%left '*'
56817
56818%%
56819
56820%no-default-prec;
56821
56822e:   e '+' e
56823   | e '*' e
56824   | '0'
56825   ;
56826_ATEOF
56827
56828
56829if 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"
56837at_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>&-
56841at_status=$? at_failed=false
56842$at_check_filter
56843echo stderr:; cat "$at_stderr"
56844echo stdout:; cat "$at_stdout"
56845at_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"
56851at_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>&-
56854at_status=$? at_failed=false
56855$at_check_filter
56856echo stderr:; cat "$at_stderr"
56857echo stdout:; cat "$at_stdout"
56858at_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"
56867at_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>&-
56872at_status=$? at_failed=false
56873$at_check_filter
56874at_fn_diff_devnull "$at_stderr" || at_failed=:
56875$at_diff expout "$at_stdout" || at_failed=:
56876at_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"
56885at_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>&-
56890at_status=$? at_failed=false
56891$at_check_filter
56892at_fn_diff_devnull "$at_stderr" || at_failed=:
56893$at_diff expout "$at_stdout" || at_failed=:
56894at_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
56900fi
56901{ set +x
56902$as_echo "$at_srcdir/conflicts.at:1004: bison -o input.c input.y"
56903at_fn_check_prepare_trace "conflicts.at:1004"
56904( $at_check_trace; bison -o input.c input.y
56905) >>"$at_stdout" 2>>"$at_stderr" 5>&-
56906at_status=$? at_failed=false
56907$at_check_filter
56908echo >>"$at_stderr"; $as_echo "input.y: conflicts: 4 shift/reduce
56909" | \
56910  $at_diff - "$at_stderr" || at_failed=:
56911at_fn_diff_devnull "$at_stdout" || at_failed=:
56912at_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
56920read at_status <"$at_status_file"
56921#AT_STOP_193
56922#AT_START_194
56923at_fn_group_banner 194 'conflicts.at:1014' \
56924  "%no-default-prec with %prec" "                    " 10
56925at_xfail=no
56926(
56927  $as_echo "194. $at_setup_line: testing $at_desc ..."
56928  $at_traceon
56929
56930
56931cat >input.y <<'_ATEOF'
56932%left '+'
56933%left '*'
56934
56935%%
56936
56937%no-default-prec;
56938
56939e:   e '+' e %prec '+'
56940   | e '*' e %prec '*'
56941   | '0'
56942   ;
56943_ATEOF
56944
56945
56946if 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"
56954at_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>&-
56958at_status=$? at_failed=false
56959$at_check_filter
56960echo stderr:; cat "$at_stderr"
56961echo stdout:; cat "$at_stdout"
56962at_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"
56968at_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>&-
56971at_status=$? at_failed=false
56972$at_check_filter
56973echo stderr:; cat "$at_stderr"
56974echo stdout:; cat "$at_stdout"
56975at_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"
56984at_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>&-
56989at_status=$? at_failed=false
56990$at_check_filter
56991at_fn_diff_devnull "$at_stderr" || at_failed=:
56992$at_diff expout "$at_stdout" || at_failed=:
56993at_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"
57002at_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>&-
57007at_status=$? at_failed=false
57008$at_check_filter
57009at_fn_diff_devnull "$at_stderr" || at_failed=:
57010$at_diff expout "$at_stdout" || at_failed=:
57011at_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
57017fi
57018{ set +x
57019$as_echo "$at_srcdir/conflicts.at:1030: bison -o input.c input.y"
57020at_fn_check_prepare_trace "conflicts.at:1030"
57021( $at_check_trace; bison -o input.c input.y
57022) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57023at_status=$? at_failed=false
57024$at_check_filter
57025at_fn_diff_devnull "$at_stderr" || at_failed=:
57026at_fn_diff_devnull "$at_stdout" || at_failed=:
57027at_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
57035read at_status <"$at_status_file"
57036#AT_STOP_194
57037#AT_START_195
57038at_fn_group_banner 195 'conflicts.at:1038' \
57039  "%default-prec" "                                  " 10
57040at_xfail=no
57041(
57042  $as_echo "195. $at_setup_line: testing $at_desc ..."
57043  $at_traceon
57044
57045
57046cat >input.y <<'_ATEOF'
57047%left '+'
57048%left '*'
57049
57050%%
57051
57052%default-prec;
57053
57054e:   e '+' e
57055   | e '*' e
57056   | '0'
57057   ;
57058_ATEOF
57059
57060
57061if 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"
57069at_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>&-
57073at_status=$? at_failed=false
57074$at_check_filter
57075echo stderr:; cat "$at_stderr"
57076echo stdout:; cat "$at_stdout"
57077at_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"
57083at_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>&-
57086at_status=$? at_failed=false
57087$at_check_filter
57088echo stderr:; cat "$at_stderr"
57089echo stdout:; cat "$at_stdout"
57090at_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"
57099at_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>&-
57104at_status=$? at_failed=false
57105$at_check_filter
57106at_fn_diff_devnull "$at_stderr" || at_failed=:
57107$at_diff expout "$at_stdout" || at_failed=:
57108at_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"
57117at_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>&-
57122at_status=$? at_failed=false
57123$at_check_filter
57124at_fn_diff_devnull "$at_stderr" || at_failed=:
57125$at_diff expout "$at_stdout" || at_failed=:
57126at_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
57132fi
57133{ set +x
57134$as_echo "$at_srcdir/conflicts.at:1054: bison -o input.c input.y"
57135at_fn_check_prepare_trace "conflicts.at:1054"
57136( $at_check_trace; bison -o input.c input.y
57137) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57138at_status=$? at_failed=false
57139$at_check_filter
57140at_fn_diff_devnull "$at_stderr" || at_failed=:
57141at_fn_diff_devnull "$at_stdout" || at_failed=:
57142at_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
57150read at_status <"$at_status_file"
57151#AT_STOP_195
57152#AT_START_196
57153at_fn_group_banner 196 'conflicts.at:1062' \
57154  "Unreachable States After Conflict Resolution" "   " 10
57155at_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
57166cat >input.y <<'_ATEOF'
57167%output "input.c"
57168%left 'a'
57169
57170%%
57171
57172start: 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.  */
57177resolved_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.  */
57185unreachable1:
57186    'a' unreachable2
57187  |
57188  ;
57189
57190/* Likewise for a R/R conflict and nonterminal unreachable2.  */
57191unreachable2: | ;
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.  */
57195reported_conflicts:
57196    'a'
57197  | 'a'
57198  |
57199  ;
57200
57201_ATEOF
57202
57203
57204if 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"
57212at_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>&-
57216at_status=$? at_failed=false
57217$at_check_filter
57218echo stderr:; cat "$at_stderr"
57219echo stdout:; cat "$at_stdout"
57220at_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"
57226at_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>&-
57229at_status=$? at_failed=false
57230$at_check_filter
57231echo stderr:; cat "$at_stderr"
57232echo stdout:; cat "$at_stdout"
57233at_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"
57242at_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>&-
57247at_status=$? at_failed=false
57248$at_check_filter
57249at_fn_diff_devnull "$at_stderr" || at_failed=:
57250$at_diff expout "$at_stdout" || at_failed=:
57251at_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"
57260at_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>&-
57265at_status=$? at_failed=false
57266$at_check_filter
57267at_fn_diff_devnull "$at_stderr" || at_failed=:
57268$at_diff expout "$at_stdout" || at_failed=:
57269at_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
57275fi
57276{ set +x
57277$as_echo "$at_srcdir/conflicts.at:1106: bison --report=all input.y"
57278at_fn_check_prepare_trace "conflicts.at:1106"
57279( $at_check_trace; bison --report=all input.y
57280) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57281at_status=$? at_failed=false
57282$at_check_filter
57283echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
57284input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
57285input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
57286input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
57287input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57288input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57289input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
57290input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
57291" | \
57292  $at_diff - "$at_stderr" || at_failed=:
57293at_fn_diff_devnull "$at_stdout" || at_failed=:
57294at_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.
57301if 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"
57310at_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>&-
57313at_status=$? at_failed=false
57314$at_check_filter
57315echo stderr:; tee stderr <"$at_stderr"
57316$at_diff expout "$at_stdout" || at_failed=:
57317at_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'
57325input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
57326input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
57327input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
57328input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
57329input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57330input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57331input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
57332input.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"
57362at_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>&-
57366at_status=$? at_failed=false
57367$at_check_filter
57368$at_diff experr "$at_stderr" || at_failed=:
57369at_fn_diff_devnull "$at_stdout" || at_failed=:
57370at_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"
57379at_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>&-
57382at_status=$? at_failed=false
57383$at_check_filter
57384$at_diff experr "$at_stderr" || at_failed=:
57385$at_diff expout "$at_stdout" || at_failed=:
57386at_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"
57396at_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>&-
57399at_status=$? at_failed=false
57400$at_check_filter
57401at_fn_diff_devnull "$at_stderr" || at_failed=:
57402$at_diff expout "$at_stdout" || at_failed=:
57403at_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"
57409at_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>&-
57412at_status=$? at_failed=false
57413$at_check_filter
57414at_fn_diff_devnull "$at_stderr" || at_failed=:
57415$at_diff expout "$at_stdout" || at_failed=:
57416at_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
57422fi
57423
57424{ set +x
57425$as_echo "$at_srcdir/conflicts.at:1117: cat input.output"
57426at_fn_check_prepare_trace "conflicts.at:1117"
57427( $at_check_trace; cat input.output
57428) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57429at_status=$? at_failed=false
57430$at_check_filter
57431at_fn_diff_devnull "$at_stderr" || at_failed=:
57432echo >>"$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
57446State 4 conflicts: 1 shift/reduce
57447State 5 conflicts: 1 reduce/reduce
57448
57449
57450Grammar
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
57470Terminals, with rules where they appear
57471
57472\$end (0) 0
57473'a' (97) 1 2 4 8 9
57474error (256)
57475
57476
57477Nonterminals, with rules where they appear
57478
57479\$accept (4)
57480    on left: 0
57481start (5)
57482    on left: 1, on right: 0
57483resolved_conflict (6)
57484    on left: 2 3, on right: 1
57485unreachable1 (7)
57486    on left: 4 5, on right: 2
57487unreachable2 (8)
57488    on left: 6 7, on right: 4
57489reported_conflicts (9)
57490    on left: 8 9 10, on right: 1
57491
57492
57493State 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
57508State 1
57509
57510    0 \$accept: start . \$end
57511
57512    \$end  shift, and go to state 3
57513
57514
57515State 2
57516
57517    1 start: resolved_conflict . 'a' reported_conflicts 'a'
57518
57519    'a'  shift, and go to state 4
57520
57521
57522State 3
57523
57524    0 \$accept: start \$end .
57525
57526    \$default  accept
57527
57528
57529State 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
57543State 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
57553State 6
57554
57555    1 start: resolved_conflict 'a' reported_conflicts . 'a'
57556
57557    'a'  shift, and go to state 7
57558
57559
57560State 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=:
57567at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1117"
57568$at_failed && at_fn_log_failure
57569$at_traceon; }
57570
57571
57572cat >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"
57578at_fn_check_prepare_trace "conflicts.at:1256"
57579( $at_check_trace; cat input.y >> input-keep.y
57580) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57581at_status=$? at_failed=false
57582$at_check_filter
57583at_fn_diff_devnull "$at_stderr" || at_failed=:
57584at_fn_diff_devnull "$at_stdout" || at_failed=:
57585at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1256"
57586$at_failed && at_fn_log_failure
57587$at_traceon; }
57588
57589
57590if 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"
57598at_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>&-
57602at_status=$? at_failed=false
57603$at_check_filter
57604echo stderr:; cat "$at_stderr"
57605echo stdout:; cat "$at_stdout"
57606at_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"
57612at_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>&-
57615at_status=$? at_failed=false
57616$at_check_filter
57617echo stderr:; cat "$at_stderr"
57618echo stdout:; cat "$at_stdout"
57619at_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"
57628at_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>&-
57633at_status=$? at_failed=false
57634$at_check_filter
57635at_fn_diff_devnull "$at_stderr" || at_failed=:
57636$at_diff expout "$at_stdout" || at_failed=:
57637at_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"
57646at_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>&-
57651at_status=$? at_failed=false
57652$at_check_filter
57653at_fn_diff_devnull "$at_stderr" || at_failed=:
57654$at_diff expout "$at_stdout" || at_failed=:
57655at_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
57661fi
57662{ set +x
57663$as_echo "$at_srcdir/conflicts.at:1258: bison input-keep.y"
57664at_fn_check_prepare_trace "conflicts.at:1258"
57665( $at_check_trace; bison input-keep.y
57666) >>"$at_stdout" 2>>"$at_stderr" 5>&-
57667at_status=$? at_failed=false
57668$at_check_filter
57669echo >>"$at_stderr"; $as_echo "input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
57670input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
57671input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57672input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
57673input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
57674" | \
57675  $at_diff - "$at_stderr" || at_failed=:
57676at_fn_diff_devnull "$at_stdout" || at_failed=:
57677at_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.
57684if 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"
57693at_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>&-
57696at_status=$? at_failed=false
57697$at_check_filter
57698echo stderr:; tee stderr <"$at_stderr"
57699$at_diff expout "$at_stdout" || at_failed=:
57700at_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'
57708input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
57709input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
57710input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
57711input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
57712input-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"
57742at_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>&-
57746at_status=$? at_failed=false
57747$at_check_filter
57748$at_diff experr "$at_stderr" || at_failed=:
57749at_fn_diff_devnull "$at_stdout" || at_failed=:
57750at_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"
57759at_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>&-
57762at_status=$? at_failed=false
57763$at_check_filter
57764$at_diff experr "$at_stderr" || at_failed=:
57765$at_diff expout "$at_stdout" || at_failed=:
57766at_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"
57776at_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>&-
57779at_status=$? at_failed=false
57780$at_check_filter
57781at_fn_diff_devnull "$at_stderr" || at_failed=:
57782$at_diff expout "$at_stdout" || at_failed=:
57783at_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"
57789at_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>&-
57792at_status=$? at_failed=false
57793$at_check_filter
57794at_fn_diff_devnull "$at_stderr" || at_failed=:
57795$at_diff expout "$at_stdout" || at_failed=:
57796at_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
57802fi
57803
57804  set +x
57805  $at_times_p && times >"$at_times_file"
57806) 5>&1 2>&1 7>&- | eval $at_tee_pipe
57807read at_status <"$at_status_file"
57808#AT_STOP_196
57809#AT_START_197
57810at_fn_group_banner 197 'conflicts.at:1273' \
57811  "Solved conflicts report for multiple reductions in a state" "" 10
57812at_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
57820cat >input.y <<'_ATEOF'
57821%left 'a'
57822%right 'b'
57823%right 'c'
57824%right 'd'
57825%%
57826start:
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  ;
57836empty_a: %prec 'a' ;
57837empty_b: %prec 'b' ;
57838empty_c1: %prec 'c' ;
57839empty_c2: %prec 'c' ;
57840empty_c3: %prec 'd' ;
57841_ATEOF
57842
57843if 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"
57851at_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>&-
57855at_status=$? at_failed=false
57856$at_check_filter
57857echo stderr:; cat "$at_stderr"
57858echo stdout:; cat "$at_stdout"
57859at_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"
57865at_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>&-
57868at_status=$? at_failed=false
57869$at_check_filter
57870echo stderr:; cat "$at_stderr"
57871echo stdout:; cat "$at_stdout"
57872at_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"
57881at_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>&-
57886at_status=$? at_failed=false
57887$at_check_filter
57888at_fn_diff_devnull "$at_stderr" || at_failed=:
57889$at_diff expout "$at_stdout" || at_failed=:
57890at_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"
57899at_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>&-
57904at_status=$? at_failed=false
57905$at_check_filter
57906at_fn_diff_devnull "$at_stderr" || at_failed=:
57907$at_diff expout "$at_stdout" || at_failed=:
57908at_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
57914fi
57915{ set +x
57916$as_echo "$at_srcdir/conflicts.at:1299: bison --report=all -o input.c input.y"
57917at_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>&-
57920at_status=$? at_failed=false
57921$at_check_filter
57922echo stderr:; cat "$at_stderr"
57923at_fn_diff_devnull "$at_stdout" || at_failed=:
57924at_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'"
57931at_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>&-
57934at_status=$? at_failed=false
57935$at_check_filter
57936at_fn_diff_devnull "$at_stderr" || at_failed=:
57937echo >>"$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
57973State 1
57974" | \
57975  $at_diff - "$at_stdout" || at_failed=:
57976at_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
57984read at_status <"$at_status_file"
57985#AT_STOP_197
57986#AT_START_198
57987at_fn_group_banner 198 'conflicts.at:1353' \
57988  "%nonassoc error actions for multiple reductions in a state" "" 10
57989at_xfail=no
57990(
57991  $as_echo "198. $at_setup_line: testing $at_desc ..."
57992  $at_traceon
57993
57994
57995cat >input.y <<'_ATEOF'
57996%nonassoc 'a' 'b' 'c'
57997%%
57998start:
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  ;
58008empty_a: %prec 'a' ;
58009empty_b: %prec 'b' ;
58010empty_c1: %prec 'c' ;
58011empty_c2: %prec 'c' ;
58012empty_c3: %prec 'c' ;
58013_ATEOF
58014
58015
58016if 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"
58024at_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>&-
58028at_status=$? at_failed=false
58029$at_check_filter
58030echo stderr:; cat "$at_stderr"
58031echo stdout:; cat "$at_stdout"
58032at_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"
58038at_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>&-
58041at_status=$? at_failed=false
58042$at_check_filter
58043echo stderr:; cat "$at_stderr"
58044echo stdout:; cat "$at_stdout"
58045at_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"
58054at_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>&-
58059at_status=$? at_failed=false
58060$at_check_filter
58061at_fn_diff_devnull "$at_stderr" || at_failed=:
58062$at_diff expout "$at_stdout" || at_failed=:
58063at_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"
58072at_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>&-
58077at_status=$? at_failed=false
58078$at_check_filter
58079at_fn_diff_devnull "$at_stderr" || at_failed=:
58080$at_diff expout "$at_stdout" || at_failed=:
58081at_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
58087fi
58088{ set +x
58089$as_echo "$at_srcdir/conflicts.at:1375: bison --report=all -o input.c input.y"
58090at_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>&-
58093at_status=$? at_failed=false
58094$at_check_filter
58095echo stderr:; cat "$at_stderr"
58096at_fn_diff_devnull "$at_stdout" || at_failed=:
58097at_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'"
58104at_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>&-
58107at_status=$? at_failed=false
58108$at_check_filter
58109at_fn_diff_devnull "$at_stderr" || at_failed=:
58110echo >>"$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
58146State 1
58147" | \
58148  $at_diff - "$at_stdout" || at_failed=:
58149at_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
58156read at_status <"$at_status_file"
58157#AT_STOP_198
58158#AT_START_199
58159at_fn_group_banner 199 'conflicts.at:1422' \
58160  "-W versus %expect and %expect-rr" "               " 10
58161at_xfail=no
58162(
58163  $as_echo "199. $at_setup_line: testing $at_desc ..."
58164  $at_traceon
58165
58166
58167cat >sr-rr.y <<'_ATEOF'
58168%glr-parser
58169%%
58170start: 'a' | A 'a' | B 'a' ;
58171A: ;
58172B: ;
58173_ATEOF
58174
58175cat >sr.y <<'_ATEOF'
58176%glr-parser
58177%%
58178start: 'a' | A 'a' ;
58179A: ;
58180_ATEOF
58181
58182cat >rr.y <<'_ATEOF'
58183%glr-parser
58184%%
58185start: A | B ;
58186A: ;
58187B: ;
58188_ATEOF
58189
58190
58191if 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"
58199at_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>&-
58203at_status=$? at_failed=false
58204$at_check_filter
58205echo stderr:; cat "$at_stderr"
58206echo stdout:; cat "$at_stdout"
58207at_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"
58213at_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>&-
58216at_status=$? at_failed=false
58217$at_check_filter
58218echo stderr:; cat "$at_stderr"
58219echo stdout:; cat "$at_stdout"
58220at_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"
58229at_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>&-
58234at_status=$? at_failed=false
58235$at_check_filter
58236at_fn_diff_devnull "$at_stderr" || at_failed=:
58237$at_diff expout "$at_stdout" || at_failed=:
58238at_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"
58247at_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>&-
58252at_status=$? at_failed=false
58253$at_check_filter
58254at_fn_diff_devnull "$at_stderr" || at_failed=:
58255$at_diff expout "$at_stdout" || at_failed=:
58256at_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
58262fi
58263{ set +x
58264$as_echo "$at_srcdir/conflicts.at:1445: bison sr-rr.y"
58265at_fn_check_prepare_trace "conflicts.at:1445"
58266( $at_check_trace; bison sr-rr.y
58267) >>"$at_stdout" 2>>"$at_stderr" 5>&-
58268at_status=$? at_failed=false
58269$at_check_filter
58270echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce, 1 reduce/reduce
58271" | \
58272  $at_diff - "$at_stderr" || at_failed=:
58273at_fn_diff_devnull "$at_stdout" || at_failed=:
58274at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
58275$at_failed && at_fn_log_failure
58276$at_traceon; }
58277
58278
58279if 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"
58287at_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>&-
58291at_status=$? at_failed=false
58292$at_check_filter
58293echo stderr:; cat "$at_stderr"
58294echo stdout:; cat "$at_stdout"
58295at_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"
58301at_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>&-
58304at_status=$? at_failed=false
58305$at_check_filter
58306echo stderr:; cat "$at_stderr"
58307echo stdout:; cat "$at_stdout"
58308at_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"
58317at_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>&-
58322at_status=$? at_failed=false
58323$at_check_filter
58324at_fn_diff_devnull "$at_stderr" || at_failed=:
58325$at_diff expout "$at_stdout" || at_failed=:
58326at_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"
58335at_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>&-
58340at_status=$? at_failed=false
58341$at_check_filter
58342at_fn_diff_devnull "$at_stderr" || at_failed=:
58343$at_diff expout "$at_stdout" || at_failed=:
58344at_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
58350fi
58351{ set +x
58352$as_echo "$at_srcdir/conflicts.at:1448: bison -Wno-conflicts-sr sr-rr.y"
58353at_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>&-
58356at_status=$? at_failed=false
58357$at_check_filter
58358echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 reduce/reduce
58359" | \
58360  $at_diff - "$at_stderr" || at_failed=:
58361at_fn_diff_devnull "$at_stdout" || at_failed=:
58362at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
58363$at_failed && at_fn_log_failure
58364$at_traceon; }
58365
58366
58367if 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"
58375at_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>&-
58379at_status=$? at_failed=false
58380$at_check_filter
58381echo stderr:; cat "$at_stderr"
58382echo stdout:; cat "$at_stdout"
58383at_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"
58389at_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>&-
58392at_status=$? at_failed=false
58393$at_check_filter
58394echo stderr:; cat "$at_stderr"
58395echo stdout:; cat "$at_stdout"
58396at_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"
58405at_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>&-
58410at_status=$? at_failed=false
58411$at_check_filter
58412at_fn_diff_devnull "$at_stderr" || at_failed=:
58413$at_diff expout "$at_stdout" || at_failed=:
58414at_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"
58423at_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>&-
58428at_status=$? at_failed=false
58429$at_check_filter
58430at_fn_diff_devnull "$at_stderr" || at_failed=:
58431$at_diff expout "$at_stdout" || at_failed=:
58432at_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
58438fi
58439{ set +x
58440$as_echo "$at_srcdir/conflicts.at:1451: bison -Wno-conflicts-rr sr-rr.y"
58441at_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>&-
58444at_status=$? at_failed=false
58445$at_check_filter
58446echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce
58447" | \
58448  $at_diff - "$at_stderr" || at_failed=:
58449at_fn_diff_devnull "$at_stdout" || at_failed=:
58450at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
58451$at_failed && at_fn_log_failure
58452$at_traceon; }
58453
58454
58455
58456for 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"
58506at_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>&-
58510at_status=$? at_failed=false
58511$at_check_filter
58512echo stderr:; cat "$at_stderr"
58513echo stdout:; cat "$at_stdout"
58514at_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"
58520at_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>&-
58523at_status=$? at_failed=false
58524$at_check_filter
58525echo stderr:; cat "$at_stderr"
58526echo stdout:; cat "$at_stdout"
58527at_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"
58536at_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>&-
58541at_status=$? at_failed=false
58542$at_check_filter
58543at_fn_diff_devnull "$at_stderr" || at_failed=:
58544$at_diff expout "$at_stdout" || at_failed=:
58545at_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"
58554at_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>&-
58559at_status=$? at_failed=false
58560$at_check_filter
58561at_fn_diff_devnull "$at_stderr" || at_failed=:
58562$at_diff expout "$at_stdout" || at_failed=:
58563at_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
58569fi
58570{ set +x
58571$as_echo "$at_srcdir/conflicts.at:1497: bison -Wnone \$file"
58572at_fn_check_prepare_dynamic "bison -Wnone $file" "conflicts.at:1497"
58573( $at_check_trace; bison -Wnone $file
58574) >>"$at_stdout" 2>>"$at_stderr" 5>&-
58575at_status=$? at_failed=false
58576$at_check_filter
58577at_fn_diff_devnull "$at_stderr" || at_failed=:
58578at_fn_diff_devnull "$at_stdout" || at_failed=:
58579at_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"
58592at_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>&-
58596at_status=$? at_failed=false
58597$at_check_filter
58598echo stderr:; cat "$at_stderr"
58599echo stdout:; cat "$at_stdout"
58600at_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"
58606at_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>&-
58609at_status=$? at_failed=false
58610$at_check_filter
58611echo stderr:; cat "$at_stderr"
58612echo stdout:; cat "$at_stdout"
58613at_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"
58622at_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>&-
58627at_status=$? at_failed=false
58628$at_check_filter
58629at_fn_diff_devnull "$at_stderr" || at_failed=:
58630$at_diff expout "$at_stdout" || at_failed=:
58631at_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"
58640at_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>&-
58645at_status=$? at_failed=false
58646$at_check_filter
58647at_fn_diff_devnull "$at_stderr" || at_failed=:
58648$at_diff expout "$at_stdout" || at_failed=:
58649at_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
58655fi
58656{ set +x
58657$as_echo "$at_srcdir/conflicts.at:1498: bison -Werror \$file"
58658at_fn_check_prepare_dynamic "bison -Werror $file" "conflicts.at:1498"
58659( $at_check_trace; bison -Werror $file
58660) >>"$at_stdout" 2>>"$at_stderr" 5>&-
58661at_status=$? at_failed=false
58662$at_check_filter
58663at_fn_diff_devnull "$at_stderr" || at_failed=:
58664at_fn_diff_devnull "$at_stdout" || at_failed=:
58665at_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"
58683at_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>&-
58686at_status=$? at_failed=false
58687$at_check_filter
58688$at_diff experr "$at_stderr" || at_failed=:
58689at_fn_diff_devnull "$at_stdout" || at_failed=:
58690at_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"
58698at_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>&-
58701at_status=$? at_failed=false
58702$at_check_filter
58703$at_diff experr "$at_stderr" || at_failed=:
58704at_fn_diff_devnull "$at_stdout" || at_failed=:
58705at_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
58713done
58714
58715  set +x
58716  $at_times_p && times >"$at_times_file"
58717) 5>&1 2>&1 7>&- | eval $at_tee_pipe
58718read at_status <"$at_status_file"
58719#AT_STOP_199
58720#AT_START_200
58721at_fn_group_banner 200 'calc.at:597' \
58722  "Calculator " "                                    " 11
58723at_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
58737cat >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
58778FILE *input;
58779static int power (int base, int exponent);
58780
58781static void yyerror ( const char *msg);
58782int 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%%
58800input:
58801  line
58802| input line         {  }
58803;
58804
58805line:
58806  '\n'
58807| exp '\n'           { USE ($1); }
58808;
58809
58810exp:
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
58831static int
58832power (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.  */
58844static
58845void yyerror ( const char *msg)
58846{
58847  fprintf (stderr, "%s\n", msg);
58848}
58849#include <ctype.h>
58850
58851int yylex (void);
58852static int get_char (void);
58853static void unget_char ( int c);
58854
58855
58856static int
58857get_char (void)
58858{
58859  int res = getc (input);
58860  ;
58861
58862  return res;
58863}
58864
58865static void
58866unget_char ( int c)
58867{
58868  ;
58869
58870  ungetc (c, input);
58871}
58872
58873static int
58874read_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
58905int 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
58941semantic_value global_result = 0;
58942int global_count = 0;
58943
58944/* A C main function.  */
58945int
58946main (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
58985if 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"
58993at_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>&-
58997at_status=$? at_failed=false
58998$at_check_filter
58999echo stderr:; cat "$at_stderr"
59000echo stdout:; cat "$at_stdout"
59001at_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"
59007at_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>&-
59010at_status=$? at_failed=false
59011$at_check_filter
59012echo stderr:; cat "$at_stderr"
59013echo stdout:; cat "$at_stdout"
59014at_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"
59023at_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>&-
59028at_status=$? at_failed=false
59029$at_check_filter
59030at_fn_diff_devnull "$at_stderr" || at_failed=:
59031$at_diff expout "$at_stdout" || at_failed=:
59032at_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"
59041at_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>&-
59046at_status=$? at_failed=false
59047$at_check_filter
59048at_fn_diff_devnull "$at_stderr" || at_failed=:
59049$at_diff expout "$at_stdout" || at_failed=:
59050at_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
59056fi
59057{ set +x
59058$as_echo "$at_srcdir/calc.at:597: bison -o calc.c calc.y"
59059at_fn_check_prepare_trace "calc.at:597"
59060( $at_check_trace; bison -o calc.c calc.y
59061) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59062at_status=$? at_failed=false
59063$at_check_filter
59064at_fn_diff_devnull "$at_stderr" || at_failed=:
59065at_fn_diff_devnull "$at_stdout" || at_failed=:
59066at_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"
59073at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:597"
59074( $at_check_trace; $BISON_C_WORKS
59075) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59076at_status=$? at_failed=false
59077$at_check_filter
59078echo stderr:; cat "$at_stderr"
59079echo stdout:; cat "$at_stdout"
59080at_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"
59086at_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>&-
59089at_status=$? at_failed=false
59090$at_check_filter
59091echo stderr:; cat "$at_stderr"
59092echo stdout:; cat "$at_stdout"
59093at_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"
59108at_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>&-
59119at_status=$? at_failed=false
59120$at_check_filter
59121at_fn_diff_devnull "$at_stderr" || at_failed=:
59122at_fn_diff_devnull "$at_stdout" || at_failed=:
59123at_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.
59130cat >input <<'_ATEOF'
591311 + 2 * 3 = 7
591321 + 2 * -3 = -5
59133
59134-1^2 = -1
59135(-1)^2 = 1
59136
59137---1 = -1
59138
591391 - 2 - 3 = -4
591401 - (2 - 3) = 2
59141
591422^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"
59148at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59149( $at_check_trace;  $PREPARSER ./calc input
59150) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59151at_status=$? at_failed=false
59152$at_check_filter
59153echo stderr:; tee stderr <"$at_stderr"
59154at_fn_diff_devnull "$at_stdout" || at_failed=:
59155at_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"
59161at_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>&-
59164at_status=$? at_failed=false
59165$at_check_filter
59166echo stderr:; tee stderr <"$at_stderr"
59167at_fn_diff_devnull "$at_stdout" || at_failed=:
59168at_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.
59176cat >input <<'_ATEOF'
591771 2
59178_ATEOF
59179
59180{ set +x
59181$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59182at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59183( $at_check_trace;  $PREPARSER ./calc input
59184) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59185at_status=$? at_failed=false
59186$at_check_filter
59187echo stderr:; tee stderr <"$at_stderr"
59188at_fn_diff_devnull "$at_stdout" || at_failed=:
59189at_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"
59195at_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>&-
59198at_status=$? at_failed=false
59199$at_check_filter
59200echo stderr:; tee stderr <"$at_stderr"
59201at_fn_diff_devnull "$at_stdout" || at_failed=:
59202at_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.
59211sed '/^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
59226mv at-stderr stderr
59227# 2. Create the reference error message.
59228cat >expout <<'_ATEOF'
592291.3: syntax error, unexpected number
59230_ATEOF
59231
59232# 3. If locations are not used, remove them.
59233sed 's/^[-0-9.]*: //' expout >at-expout
59234mv at-expout expout
59235# 4. If error-verbose is not used, strip the`, unexpected....' part.
59236sed 's/syntax error, .*$/syntax error/' expout >at-expout
59237mv at-expout expout
59238# 5. Check
59239{ set +x
59240$as_echo "$at_srcdir/calc.at:597: cat stderr"
59241at_fn_check_prepare_trace "calc.at:597"
59242( $at_check_trace; cat stderr
59243) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59244at_status=$? at_failed=false
59245$at_check_filter
59246at_fn_diff_devnull "$at_stderr" || at_failed=:
59247$at_diff expout "$at_stdout" || at_failed=:
59248at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
59249$at_failed && at_fn_log_failure
59250$at_traceon; }
59251
59252
59253cat >input <<'_ATEOF'
592541//2
59255_ATEOF
59256
59257{ set +x
59258$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59259at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59260( $at_check_trace;  $PREPARSER ./calc input
59261) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59262at_status=$? at_failed=false
59263$at_check_filter
59264echo stderr:; tee stderr <"$at_stderr"
59265at_fn_diff_devnull "$at_stdout" || at_failed=:
59266at_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"
59272at_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>&-
59275at_status=$? at_failed=false
59276$at_check_filter
59277echo stderr:; tee stderr <"$at_stderr"
59278at_fn_diff_devnull "$at_stdout" || at_failed=:
59279at_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.
59288sed '/^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
59303mv at-stderr stderr
59304# 2. Create the reference error message.
59305cat >expout <<'_ATEOF'
593061.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
59307_ATEOF
59308
59309# 3. If locations are not used, remove them.
59310sed 's/^[-0-9.]*: //' expout >at-expout
59311mv at-expout expout
59312# 4. If error-verbose is not used, strip the`, unexpected....' part.
59313sed 's/syntax error, .*$/syntax error/' expout >at-expout
59314mv at-expout expout
59315# 5. Check
59316{ set +x
59317$as_echo "$at_srcdir/calc.at:597: cat stderr"
59318at_fn_check_prepare_trace "calc.at:597"
59319( $at_check_trace; cat stderr
59320) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59321at_status=$? at_failed=false
59322$at_check_filter
59323at_fn_diff_devnull "$at_stderr" || at_failed=:
59324$at_diff expout "$at_stdout" || at_failed=:
59325at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
59326$at_failed && at_fn_log_failure
59327$at_traceon; }
59328
59329
59330cat >input <<'_ATEOF'
59331error
59332_ATEOF
59333
59334{ set +x
59335$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59336at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59337( $at_check_trace;  $PREPARSER ./calc input
59338) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59339at_status=$? at_failed=false
59340$at_check_filter
59341echo stderr:; tee stderr <"$at_stderr"
59342at_fn_diff_devnull "$at_stdout" || at_failed=:
59343at_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"
59349at_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>&-
59352at_status=$? at_failed=false
59353$at_check_filter
59354echo stderr:; tee stderr <"$at_stderr"
59355at_fn_diff_devnull "$at_stdout" || at_failed=:
59356at_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.
59365sed '/^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
59380mv at-stderr stderr
59381# 2. Create the reference error message.
59382cat >expout <<'_ATEOF'
593831.1: syntax error, unexpected $undefined
59384_ATEOF
59385
59386# 3. If locations are not used, remove them.
59387sed 's/^[-0-9.]*: //' expout >at-expout
59388mv at-expout expout
59389# 4. If error-verbose is not used, strip the`, unexpected....' part.
59390sed 's/syntax error, .*$/syntax error/' expout >at-expout
59391mv at-expout expout
59392# 5. Check
59393{ set +x
59394$as_echo "$at_srcdir/calc.at:597: cat stderr"
59395at_fn_check_prepare_trace "calc.at:597"
59396( $at_check_trace; cat stderr
59397) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59398at_status=$? at_failed=false
59399$at_check_filter
59400at_fn_diff_devnull "$at_stderr" || at_failed=:
59401$at_diff expout "$at_stdout" || at_failed=:
59402at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
59403$at_failed && at_fn_log_failure
59404$at_traceon; }
59405
59406
59407cat >input <<'_ATEOF'
594081 = 2 = 3
59409_ATEOF
59410
59411{ set +x
59412$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59413at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59414( $at_check_trace;  $PREPARSER ./calc input
59415) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59416at_status=$? at_failed=false
59417$at_check_filter
59418echo stderr:; tee stderr <"$at_stderr"
59419at_fn_diff_devnull "$at_stdout" || at_failed=:
59420at_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"
59426at_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>&-
59429at_status=$? at_failed=false
59430$at_check_filter
59431echo stderr:; tee stderr <"$at_stderr"
59432at_fn_diff_devnull "$at_stdout" || at_failed=:
59433at_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.
59442sed '/^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
59457mv at-stderr stderr
59458# 2. Create the reference error message.
59459cat >expout <<'_ATEOF'
594601.7: syntax error, unexpected '='
59461_ATEOF
59462
59463# 3. If locations are not used, remove them.
59464sed 's/^[-0-9.]*: //' expout >at-expout
59465mv at-expout expout
59466# 4. If error-verbose is not used, strip the`, unexpected....' part.
59467sed 's/syntax error, .*$/syntax error/' expout >at-expout
59468mv at-expout expout
59469# 5. Check
59470{ set +x
59471$as_echo "$at_srcdir/calc.at:597: cat stderr"
59472at_fn_check_prepare_trace "calc.at:597"
59473( $at_check_trace; cat stderr
59474) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59475at_status=$? at_failed=false
59476$at_check_filter
59477at_fn_diff_devnull "$at_stderr" || at_failed=:
59478$at_diff expout "$at_stdout" || at_failed=:
59479at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
59480$at_failed && at_fn_log_failure
59481$at_traceon; }
59482
59483
59484cat >input <<'_ATEOF'
59485
59486+1
59487_ATEOF
59488
59489{ set +x
59490$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59491at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59492( $at_check_trace;  $PREPARSER ./calc input
59493) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59494at_status=$? at_failed=false
59495$at_check_filter
59496echo stderr:; tee stderr <"$at_stderr"
59497at_fn_diff_devnull "$at_stdout" || at_failed=:
59498at_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"
59504at_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>&-
59507at_status=$? at_failed=false
59508$at_check_filter
59509echo stderr:; tee stderr <"$at_stderr"
59510at_fn_diff_devnull "$at_stdout" || at_failed=:
59511at_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.
59520sed '/^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
59535mv at-stderr stderr
59536# 2. Create the reference error message.
59537cat >expout <<'_ATEOF'
595382.1: syntax error, unexpected '+'
59539_ATEOF
59540
59541# 3. If locations are not used, remove them.
59542sed 's/^[-0-9.]*: //' expout >at-expout
59543mv at-expout expout
59544# 4. If error-verbose is not used, strip the`, unexpected....' part.
59545sed 's/syntax error, .*$/syntax error/' expout >at-expout
59546mv at-expout expout
59547# 5. Check
59548{ set +x
59549$as_echo "$at_srcdir/calc.at:597: cat stderr"
59550at_fn_check_prepare_trace "calc.at:597"
59551( $at_check_trace; cat stderr
59552) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59553at_status=$? at_failed=false
59554$at_check_filter
59555at_fn_diff_devnull "$at_stderr" || at_failed=:
59556$at_diff expout "$at_stdout" || at_failed=:
59557at_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"
59565at_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>&-
59568at_status=$? at_failed=false
59569$at_check_filter
59570echo stderr:; tee stderr <"$at_stderr"
59571at_fn_diff_devnull "$at_stdout" || at_failed=:
59572at_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"
59578at_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>&-
59581at_status=$? at_failed=false
59582$at_check_filter
59583echo stderr:; tee stderr <"$at_stderr"
59584at_fn_diff_devnull "$at_stdout" || at_failed=:
59585at_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.
59594sed '/^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
59609mv at-stderr stderr
59610# 2. Create the reference error message.
59611cat >expout <<'_ATEOF'
596121.1: syntax error, unexpected end of input
59613_ATEOF
59614
59615# 3. If locations are not used, remove them.
59616sed 's/^[-0-9.]*: //' expout >at-expout
59617mv at-expout expout
59618# 4. If error-verbose is not used, strip the`, unexpected....' part.
59619sed 's/syntax error, .*$/syntax error/' expout >at-expout
59620mv at-expout expout
59621# 5. Check
59622{ set +x
59623$as_echo "$at_srcdir/calc.at:597: cat stderr"
59624at_fn_check_prepare_trace "calc.at:597"
59625( $at_check_trace; cat stderr
59626) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59627at_status=$? at_failed=false
59628$at_check_filter
59629at_fn_diff_devnull "$at_stderr" || at_failed=:
59630$at_diff expout "$at_stdout" || at_failed=:
59631at_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#
59653cat >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"
59659at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59660( $at_check_trace;  $PREPARSER ./calc input
59661) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59662at_status=$? at_failed=false
59663$at_check_filter
59664echo stderr:; tee stderr <"$at_stderr"
59665at_fn_diff_devnull "$at_stdout" || at_failed=:
59666at_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"
59672at_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>&-
59675at_status=$? at_failed=false
59676$at_check_filter
59677echo stderr:; tee stderr <"$at_stderr"
59678at_fn_diff_devnull "$at_stdout" || at_failed=:
59679at_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.
59688sed '/^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
59703mv at-stderr stderr
59704# 2. Create the reference error message.
59705cat >expout <<'_ATEOF'
597061.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
597071.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
597081.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
597091.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
59710calc: error: 4444 != 1
59711_ATEOF
59712
59713# 3. If locations are not used, remove them.
59714sed 's/^[-0-9.]*: //' expout >at-expout
59715mv at-expout expout
59716# 4. If error-verbose is not used, strip the`, unexpected....' part.
59717sed 's/syntax error, .*$/syntax error/' expout >at-expout
59718mv at-expout expout
59719# 5. Check
59720{ set +x
59721$as_echo "$at_srcdir/calc.at:597: cat stderr"
59722at_fn_check_prepare_trace "calc.at:597"
59723( $at_check_trace; cat stderr
59724) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59725at_status=$? at_failed=false
59726$at_check_filter
59727at_fn_diff_devnull "$at_stderr" || at_failed=:
59728$at_diff expout "$at_stdout" || at_failed=:
59729at_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.
59737cat >input <<'_ATEOF'
59738(!) + (1 2) = 1
59739_ATEOF
59740
59741{ set +x
59742$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59743at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59744( $at_check_trace;  $PREPARSER ./calc input
59745) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59746at_status=$? at_failed=false
59747$at_check_filter
59748echo stderr:; tee stderr <"$at_stderr"
59749at_fn_diff_devnull "$at_stdout" || at_failed=:
59750at_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"
59756at_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>&-
59759at_status=$? at_failed=false
59760$at_check_filter
59761echo stderr:; tee stderr <"$at_stderr"
59762at_fn_diff_devnull "$at_stdout" || at_failed=:
59763at_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.
59772sed '/^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
59787mv at-stderr stderr
59788# 2. Create the reference error message.
59789cat >expout <<'_ATEOF'
597901.10: syntax error, unexpected number
59791calc: error: 2222 != 1
59792_ATEOF
59793
59794# 3. If locations are not used, remove them.
59795sed 's/^[-0-9.]*: //' expout >at-expout
59796mv at-expout expout
59797# 4. If error-verbose is not used, strip the`, unexpected....' part.
59798sed 's/syntax error, .*$/syntax error/' expout >at-expout
59799mv at-expout expout
59800# 5. Check
59801{ set +x
59802$as_echo "$at_srcdir/calc.at:597: cat stderr"
59803at_fn_check_prepare_trace "calc.at:597"
59804( $at_check_trace; cat stderr
59805) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59806at_status=$? at_failed=false
59807$at_check_filter
59808at_fn_diff_devnull "$at_stderr" || at_failed=:
59809$at_diff expout "$at_stdout" || at_failed=:
59810at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
59811$at_failed && at_fn_log_failure
59812$at_traceon; }
59813
59814
59815cat >input <<'_ATEOF'
59816(- *) + (1 2) = 1
59817_ATEOF
59818
59819{ set +x
59820$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59821at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59822( $at_check_trace;  $PREPARSER ./calc input
59823) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59824at_status=$? at_failed=false
59825$at_check_filter
59826echo stderr:; tee stderr <"$at_stderr"
59827at_fn_diff_devnull "$at_stdout" || at_failed=:
59828at_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"
59834at_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>&-
59837at_status=$? at_failed=false
59838$at_check_filter
59839echo stderr:; tee stderr <"$at_stderr"
59840at_fn_diff_devnull "$at_stdout" || at_failed=:
59841at_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.
59850sed '/^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
59865mv at-stderr stderr
59866# 2. Create the reference error message.
59867cat >expout <<'_ATEOF'
598681.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
598691.12: syntax error, unexpected number
59870calc: error: 2222 != 1
59871_ATEOF
59872
59873# 3. If locations are not used, remove them.
59874sed 's/^[-0-9.]*: //' expout >at-expout
59875mv at-expout expout
59876# 4. If error-verbose is not used, strip the`, unexpected....' part.
59877sed 's/syntax error, .*$/syntax error/' expout >at-expout
59878mv at-expout expout
59879# 5. Check
59880{ set +x
59881$as_echo "$at_srcdir/calc.at:597: cat stderr"
59882at_fn_check_prepare_trace "calc.at:597"
59883( $at_check_trace; cat stderr
59884) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59885at_status=$? at_failed=false
59886$at_check_filter
59887at_fn_diff_devnull "$at_stderr" || at_failed=:
59888$at_diff expout "$at_stdout" || at_failed=:
59889at_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.
59897cat >input <<'_ATEOF'
59898(* *) + (*) + (*)
59899_ATEOF
59900
59901{ set +x
59902$as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
59903at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
59904( $at_check_trace;  $PREPARSER ./calc input
59905) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59906at_status=$? at_failed=false
59907$at_check_filter
59908echo stderr:; tee stderr <"$at_stderr"
59909at_fn_diff_devnull "$at_stdout" || at_failed=:
59910at_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"
59916at_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>&-
59919at_status=$? at_failed=false
59920$at_check_filter
59921echo stderr:; tee stderr <"$at_stderr"
59922at_fn_diff_devnull "$at_stdout" || at_failed=:
59923at_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.
59932sed '/^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
59947mv at-stderr stderr
59948# 2. Create the reference error message.
59949cat >expout <<'_ATEOF'
599501.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
599511.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
599521.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
59953_ATEOF
59954
59955# 3. If locations are not used, remove them.
59956sed 's/^[-0-9.]*: //' expout >at-expout
59957mv at-expout expout
59958# 4. If error-verbose is not used, strip the`, unexpected....' part.
59959sed 's/syntax error, .*$/syntax error/' expout >at-expout
59960mv at-expout expout
59961# 5. Check
59962{ set +x
59963$as_echo "$at_srcdir/calc.at:597: cat stderr"
59964at_fn_check_prepare_trace "calc.at:597"
59965( $at_check_trace; cat stderr
59966) >>"$at_stdout" 2>>"$at_stderr" 5>&-
59967at_status=$? at_failed=false
59968$at_check_filter
59969at_fn_diff_devnull "$at_stderr" || at_failed=:
59970$at_diff expout "$at_stdout" || at_failed=:
59971at_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
59982read at_status <"$at_status_file"
59983#AT_STOP_200
59984#AT_START_201
59985at_fn_group_banner 201 'calc.at:599' \
59986  "Calculator %defines" "                            " 11
59987at_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
60001cat >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
60042FILE *input;
60043static int power (int base, int exponent);
60044
60045static void yyerror ( const char *msg);
60046int 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%%
60064input:
60065  line
60066| input line         {  }
60067;
60068
60069line:
60070  '\n'
60071| exp '\n'           { USE ($1); }
60072;
60073
60074exp:
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
60095static int
60096power (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.  */
60108static
60109void yyerror ( const char *msg)
60110{
60111  fprintf (stderr, "%s\n", msg);
60112}
60113_ATEOF
60114
60115
60116
60117cat >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
60128int yylex (void);
60129static int get_char (void);
60130static void unget_char ( int c);
60131
60132
60133static int
60134get_char (void)
60135{
60136  int res = getc (input);
60137  ;
60138
60139  return res;
60140}
60141
60142static void
60143unget_char ( int c)
60144{
60145  ;
60146
60147  ungetc (c, input);
60148}
60149
60150static int
60151read_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
60182int 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
60210cat >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
60229semantic_value global_result = 0;
60230int global_count = 0;
60231
60232/* A C main function.  */
60233int
60234main (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
60272if 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"
60280at_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>&-
60284at_status=$? at_failed=false
60285$at_check_filter
60286echo stderr:; cat "$at_stderr"
60287echo stdout:; cat "$at_stdout"
60288at_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"
60294at_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>&-
60297at_status=$? at_failed=false
60298$at_check_filter
60299echo stderr:; cat "$at_stderr"
60300echo stdout:; cat "$at_stdout"
60301at_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"
60310at_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>&-
60315at_status=$? at_failed=false
60316$at_check_filter
60317at_fn_diff_devnull "$at_stderr" || at_failed=:
60318$at_diff expout "$at_stdout" || at_failed=:
60319at_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"
60328at_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>&-
60333at_status=$? at_failed=false
60334$at_check_filter
60335at_fn_diff_devnull "$at_stderr" || at_failed=:
60336$at_diff expout "$at_stdout" || at_failed=:
60337at_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
60343fi
60344{ set +x
60345$as_echo "$at_srcdir/calc.at:599: bison -o calc.c calc.y"
60346at_fn_check_prepare_trace "calc.at:599"
60347( $at_check_trace; bison -o calc.c calc.y
60348) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60349at_status=$? at_failed=false
60350$at_check_filter
60351at_fn_diff_devnull "$at_stderr" || at_failed=:
60352at_fn_diff_devnull "$at_stdout" || at_failed=:
60353at_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"
60360at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599"
60361( $at_check_trace; $BISON_C_WORKS
60362) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60363at_status=$? at_failed=false
60364$at_check_filter
60365echo stderr:; cat "$at_stderr"
60366echo stdout:; cat "$at_stdout"
60367at_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"
60373at_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>&-
60376at_status=$? at_failed=false
60377$at_check_filter
60378echo stderr:; cat "$at_stderr"
60379echo stdout:; cat "$at_stdout"
60380at_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"
60395at_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>&-
60406at_status=$? at_failed=false
60407$at_check_filter
60408at_fn_diff_devnull "$at_stderr" || at_failed=:
60409at_fn_diff_devnull "$at_stdout" || at_failed=:
60410at_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"
60424at_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>&-
60435at_status=$? at_failed=false
60436$at_check_filter
60437at_fn_diff_devnull "$at_stderr" || at_failed=:
60438at_fn_diff_devnull "$at_stdout" || at_failed=:
60439at_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.
60445cat >input <<'_ATEOF'
604461 + 2 * 3 = 7
604471 + 2 * -3 = -5
60448
60449-1^2 = -1
60450(-1)^2 = 1
60451
60452---1 = -1
60453
604541 - 2 - 3 = -4
604551 - (2 - 3) = 2
60456
604572^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"
60463at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60464( $at_check_trace;  $PREPARSER ./calc input
60465) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60466at_status=$? at_failed=false
60467$at_check_filter
60468echo stderr:; tee stderr <"$at_stderr"
60469at_fn_diff_devnull "$at_stdout" || at_failed=:
60470at_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"
60476at_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>&-
60479at_status=$? at_failed=false
60480$at_check_filter
60481echo stderr:; tee stderr <"$at_stderr"
60482at_fn_diff_devnull "$at_stdout" || at_failed=:
60483at_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.
60491cat >input <<'_ATEOF'
604921 2
60493_ATEOF
60494
60495{ set +x
60496$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
60497at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60498( $at_check_trace;  $PREPARSER ./calc input
60499) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60500at_status=$? at_failed=false
60501$at_check_filter
60502echo stderr:; tee stderr <"$at_stderr"
60503at_fn_diff_devnull "$at_stdout" || at_failed=:
60504at_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"
60510at_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>&-
60513at_status=$? at_failed=false
60514$at_check_filter
60515echo stderr:; tee stderr <"$at_stderr"
60516at_fn_diff_devnull "$at_stdout" || at_failed=:
60517at_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.
60526sed '/^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
60541mv at-stderr stderr
60542# 2. Create the reference error message.
60543cat >expout <<'_ATEOF'
605441.3: syntax error, unexpected number
60545_ATEOF
60546
60547# 3. If locations are not used, remove them.
60548sed 's/^[-0-9.]*: //' expout >at-expout
60549mv at-expout expout
60550# 4. If error-verbose is not used, strip the`, unexpected....' part.
60551sed 's/syntax error, .*$/syntax error/' expout >at-expout
60552mv at-expout expout
60553# 5. Check
60554{ set +x
60555$as_echo "$at_srcdir/calc.at:599: cat stderr"
60556at_fn_check_prepare_trace "calc.at:599"
60557( $at_check_trace; cat stderr
60558) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60559at_status=$? at_failed=false
60560$at_check_filter
60561at_fn_diff_devnull "$at_stderr" || at_failed=:
60562$at_diff expout "$at_stdout" || at_failed=:
60563at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
60564$at_failed && at_fn_log_failure
60565$at_traceon; }
60566
60567
60568cat >input <<'_ATEOF'
605691//2
60570_ATEOF
60571
60572{ set +x
60573$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
60574at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60575( $at_check_trace;  $PREPARSER ./calc input
60576) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60577at_status=$? at_failed=false
60578$at_check_filter
60579echo stderr:; tee stderr <"$at_stderr"
60580at_fn_diff_devnull "$at_stdout" || at_failed=:
60581at_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"
60587at_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>&-
60590at_status=$? at_failed=false
60591$at_check_filter
60592echo stderr:; tee stderr <"$at_stderr"
60593at_fn_diff_devnull "$at_stdout" || at_failed=:
60594at_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.
60603sed '/^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
60618mv at-stderr stderr
60619# 2. Create the reference error message.
60620cat >expout <<'_ATEOF'
606211.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
60622_ATEOF
60623
60624# 3. If locations are not used, remove them.
60625sed 's/^[-0-9.]*: //' expout >at-expout
60626mv at-expout expout
60627# 4. If error-verbose is not used, strip the`, unexpected....' part.
60628sed 's/syntax error, .*$/syntax error/' expout >at-expout
60629mv at-expout expout
60630# 5. Check
60631{ set +x
60632$as_echo "$at_srcdir/calc.at:599: cat stderr"
60633at_fn_check_prepare_trace "calc.at:599"
60634( $at_check_trace; cat stderr
60635) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60636at_status=$? at_failed=false
60637$at_check_filter
60638at_fn_diff_devnull "$at_stderr" || at_failed=:
60639$at_diff expout "$at_stdout" || at_failed=:
60640at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
60641$at_failed && at_fn_log_failure
60642$at_traceon; }
60643
60644
60645cat >input <<'_ATEOF'
60646error
60647_ATEOF
60648
60649{ set +x
60650$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
60651at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60652( $at_check_trace;  $PREPARSER ./calc input
60653) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60654at_status=$? at_failed=false
60655$at_check_filter
60656echo stderr:; tee stderr <"$at_stderr"
60657at_fn_diff_devnull "$at_stdout" || at_failed=:
60658at_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"
60664at_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>&-
60667at_status=$? at_failed=false
60668$at_check_filter
60669echo stderr:; tee stderr <"$at_stderr"
60670at_fn_diff_devnull "$at_stdout" || at_failed=:
60671at_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.
60680sed '/^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
60695mv at-stderr stderr
60696# 2. Create the reference error message.
60697cat >expout <<'_ATEOF'
606981.1: syntax error, unexpected $undefined
60699_ATEOF
60700
60701# 3. If locations are not used, remove them.
60702sed 's/^[-0-9.]*: //' expout >at-expout
60703mv at-expout expout
60704# 4. If error-verbose is not used, strip the`, unexpected....' part.
60705sed 's/syntax error, .*$/syntax error/' expout >at-expout
60706mv at-expout expout
60707# 5. Check
60708{ set +x
60709$as_echo "$at_srcdir/calc.at:599: cat stderr"
60710at_fn_check_prepare_trace "calc.at:599"
60711( $at_check_trace; cat stderr
60712) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60713at_status=$? at_failed=false
60714$at_check_filter
60715at_fn_diff_devnull "$at_stderr" || at_failed=:
60716$at_diff expout "$at_stdout" || at_failed=:
60717at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
60718$at_failed && at_fn_log_failure
60719$at_traceon; }
60720
60721
60722cat >input <<'_ATEOF'
607231 = 2 = 3
60724_ATEOF
60725
60726{ set +x
60727$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
60728at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60729( $at_check_trace;  $PREPARSER ./calc input
60730) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60731at_status=$? at_failed=false
60732$at_check_filter
60733echo stderr:; tee stderr <"$at_stderr"
60734at_fn_diff_devnull "$at_stdout" || at_failed=:
60735at_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"
60741at_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>&-
60744at_status=$? at_failed=false
60745$at_check_filter
60746echo stderr:; tee stderr <"$at_stderr"
60747at_fn_diff_devnull "$at_stdout" || at_failed=:
60748at_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.
60757sed '/^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
60772mv at-stderr stderr
60773# 2. Create the reference error message.
60774cat >expout <<'_ATEOF'
607751.7: syntax error, unexpected '='
60776_ATEOF
60777
60778# 3. If locations are not used, remove them.
60779sed 's/^[-0-9.]*: //' expout >at-expout
60780mv at-expout expout
60781# 4. If error-verbose is not used, strip the`, unexpected....' part.
60782sed 's/syntax error, .*$/syntax error/' expout >at-expout
60783mv at-expout expout
60784# 5. Check
60785{ set +x
60786$as_echo "$at_srcdir/calc.at:599: cat stderr"
60787at_fn_check_prepare_trace "calc.at:599"
60788( $at_check_trace; cat stderr
60789) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60790at_status=$? at_failed=false
60791$at_check_filter
60792at_fn_diff_devnull "$at_stderr" || at_failed=:
60793$at_diff expout "$at_stdout" || at_failed=:
60794at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
60795$at_failed && at_fn_log_failure
60796$at_traceon; }
60797
60798
60799cat >input <<'_ATEOF'
60800
60801+1
60802_ATEOF
60803
60804{ set +x
60805$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
60806at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60807( $at_check_trace;  $PREPARSER ./calc input
60808) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60809at_status=$? at_failed=false
60810$at_check_filter
60811echo stderr:; tee stderr <"$at_stderr"
60812at_fn_diff_devnull "$at_stdout" || at_failed=:
60813at_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"
60819at_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>&-
60822at_status=$? at_failed=false
60823$at_check_filter
60824echo stderr:; tee stderr <"$at_stderr"
60825at_fn_diff_devnull "$at_stdout" || at_failed=:
60826at_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.
60835sed '/^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
60850mv at-stderr stderr
60851# 2. Create the reference error message.
60852cat >expout <<'_ATEOF'
608532.1: syntax error, unexpected '+'
60854_ATEOF
60855
60856# 3. If locations are not used, remove them.
60857sed 's/^[-0-9.]*: //' expout >at-expout
60858mv at-expout expout
60859# 4. If error-verbose is not used, strip the`, unexpected....' part.
60860sed 's/syntax error, .*$/syntax error/' expout >at-expout
60861mv at-expout expout
60862# 5. Check
60863{ set +x
60864$as_echo "$at_srcdir/calc.at:599: cat stderr"
60865at_fn_check_prepare_trace "calc.at:599"
60866( $at_check_trace; cat stderr
60867) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60868at_status=$? at_failed=false
60869$at_check_filter
60870at_fn_diff_devnull "$at_stderr" || at_failed=:
60871$at_diff expout "$at_stdout" || at_failed=:
60872at_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"
60880at_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>&-
60883at_status=$? at_failed=false
60884$at_check_filter
60885echo stderr:; tee stderr <"$at_stderr"
60886at_fn_diff_devnull "$at_stdout" || at_failed=:
60887at_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"
60893at_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>&-
60896at_status=$? at_failed=false
60897$at_check_filter
60898echo stderr:; tee stderr <"$at_stderr"
60899at_fn_diff_devnull "$at_stdout" || at_failed=:
60900at_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.
60909sed '/^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
60924mv at-stderr stderr
60925# 2. Create the reference error message.
60926cat >expout <<'_ATEOF'
609271.1: syntax error, unexpected end of input
60928_ATEOF
60929
60930# 3. If locations are not used, remove them.
60931sed 's/^[-0-9.]*: //' expout >at-expout
60932mv at-expout expout
60933# 4. If error-verbose is not used, strip the`, unexpected....' part.
60934sed 's/syntax error, .*$/syntax error/' expout >at-expout
60935mv at-expout expout
60936# 5. Check
60937{ set +x
60938$as_echo "$at_srcdir/calc.at:599: cat stderr"
60939at_fn_check_prepare_trace "calc.at:599"
60940( $at_check_trace; cat stderr
60941) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60942at_status=$? at_failed=false
60943$at_check_filter
60944at_fn_diff_devnull "$at_stderr" || at_failed=:
60945$at_diff expout "$at_stdout" || at_failed=:
60946at_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#
60968cat >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"
60974at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
60975( $at_check_trace;  $PREPARSER ./calc input
60976) >>"$at_stdout" 2>>"$at_stderr" 5>&-
60977at_status=$? at_failed=false
60978$at_check_filter
60979echo stderr:; tee stderr <"$at_stderr"
60980at_fn_diff_devnull "$at_stdout" || at_failed=:
60981at_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"
60987at_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>&-
60990at_status=$? at_failed=false
60991$at_check_filter
60992echo stderr:; tee stderr <"$at_stderr"
60993at_fn_diff_devnull "$at_stdout" || at_failed=:
60994at_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.
61003sed '/^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
61018mv at-stderr stderr
61019# 2. Create the reference error message.
61020cat >expout <<'_ATEOF'
610211.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
610221.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
610231.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
610241.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
61025calc: error: 4444 != 1
61026_ATEOF
61027
61028# 3. If locations are not used, remove them.
61029sed 's/^[-0-9.]*: //' expout >at-expout
61030mv at-expout expout
61031# 4. If error-verbose is not used, strip the`, unexpected....' part.
61032sed 's/syntax error, .*$/syntax error/' expout >at-expout
61033mv at-expout expout
61034# 5. Check
61035{ set +x
61036$as_echo "$at_srcdir/calc.at:599: cat stderr"
61037at_fn_check_prepare_trace "calc.at:599"
61038( $at_check_trace; cat stderr
61039) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61040at_status=$? at_failed=false
61041$at_check_filter
61042at_fn_diff_devnull "$at_stderr" || at_failed=:
61043$at_diff expout "$at_stdout" || at_failed=:
61044at_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.
61052cat >input <<'_ATEOF'
61053(!) + (1 2) = 1
61054_ATEOF
61055
61056{ set +x
61057$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
61058at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
61059( $at_check_trace;  $PREPARSER ./calc input
61060) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61061at_status=$? at_failed=false
61062$at_check_filter
61063echo stderr:; tee stderr <"$at_stderr"
61064at_fn_diff_devnull "$at_stdout" || at_failed=:
61065at_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"
61071at_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>&-
61074at_status=$? at_failed=false
61075$at_check_filter
61076echo stderr:; tee stderr <"$at_stderr"
61077at_fn_diff_devnull "$at_stdout" || at_failed=:
61078at_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.
61087sed '/^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
61102mv at-stderr stderr
61103# 2. Create the reference error message.
61104cat >expout <<'_ATEOF'
611051.10: syntax error, unexpected number
61106calc: error: 2222 != 1
61107_ATEOF
61108
61109# 3. If locations are not used, remove them.
61110sed 's/^[-0-9.]*: //' expout >at-expout
61111mv at-expout expout
61112# 4. If error-verbose is not used, strip the`, unexpected....' part.
61113sed 's/syntax error, .*$/syntax error/' expout >at-expout
61114mv at-expout expout
61115# 5. Check
61116{ set +x
61117$as_echo "$at_srcdir/calc.at:599: cat stderr"
61118at_fn_check_prepare_trace "calc.at:599"
61119( $at_check_trace; cat stderr
61120) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61121at_status=$? at_failed=false
61122$at_check_filter
61123at_fn_diff_devnull "$at_stderr" || at_failed=:
61124$at_diff expout "$at_stdout" || at_failed=:
61125at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
61126$at_failed && at_fn_log_failure
61127$at_traceon; }
61128
61129
61130cat >input <<'_ATEOF'
61131(- *) + (1 2) = 1
61132_ATEOF
61133
61134{ set +x
61135$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
61136at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
61137( $at_check_trace;  $PREPARSER ./calc input
61138) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61139at_status=$? at_failed=false
61140$at_check_filter
61141echo stderr:; tee stderr <"$at_stderr"
61142at_fn_diff_devnull "$at_stdout" || at_failed=:
61143at_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"
61149at_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>&-
61152at_status=$? at_failed=false
61153$at_check_filter
61154echo stderr:; tee stderr <"$at_stderr"
61155at_fn_diff_devnull "$at_stdout" || at_failed=:
61156at_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.
61165sed '/^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
61180mv at-stderr stderr
61181# 2. Create the reference error message.
61182cat >expout <<'_ATEOF'
611831.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
611841.12: syntax error, unexpected number
61185calc: error: 2222 != 1
61186_ATEOF
61187
61188# 3. If locations are not used, remove them.
61189sed 's/^[-0-9.]*: //' expout >at-expout
61190mv at-expout expout
61191# 4. If error-verbose is not used, strip the`, unexpected....' part.
61192sed 's/syntax error, .*$/syntax error/' expout >at-expout
61193mv at-expout expout
61194# 5. Check
61195{ set +x
61196$as_echo "$at_srcdir/calc.at:599: cat stderr"
61197at_fn_check_prepare_trace "calc.at:599"
61198( $at_check_trace; cat stderr
61199) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61200at_status=$? at_failed=false
61201$at_check_filter
61202at_fn_diff_devnull "$at_stderr" || at_failed=:
61203$at_diff expout "$at_stdout" || at_failed=:
61204at_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.
61212cat >input <<'_ATEOF'
61213(* *) + (*) + (*)
61214_ATEOF
61215
61216{ set +x
61217$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
61218at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
61219( $at_check_trace;  $PREPARSER ./calc input
61220) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61221at_status=$? at_failed=false
61222$at_check_filter
61223echo stderr:; tee stderr <"$at_stderr"
61224at_fn_diff_devnull "$at_stdout" || at_failed=:
61225at_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"
61231at_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>&-
61234at_status=$? at_failed=false
61235$at_check_filter
61236echo stderr:; tee stderr <"$at_stderr"
61237at_fn_diff_devnull "$at_stdout" || at_failed=:
61238at_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.
61247sed '/^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
61262mv at-stderr stderr
61263# 2. Create the reference error message.
61264cat >expout <<'_ATEOF'
612651.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
612661.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
612671.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
61268_ATEOF
61269
61270# 3. If locations are not used, remove them.
61271sed 's/^[-0-9.]*: //' expout >at-expout
61272mv at-expout expout
61273# 4. If error-verbose is not used, strip the`, unexpected....' part.
61274sed 's/syntax error, .*$/syntax error/' expout >at-expout
61275mv at-expout expout
61276# 5. Check
61277{ set +x
61278$as_echo "$at_srcdir/calc.at:599: cat stderr"
61279at_fn_check_prepare_trace "calc.at:599"
61280( $at_check_trace; cat stderr
61281) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61282at_status=$? at_failed=false
61283$at_check_filter
61284at_fn_diff_devnull "$at_stderr" || at_failed=:
61285$at_diff expout "$at_stdout" || at_failed=:
61286at_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
61297read at_status <"$at_status_file"
61298#AT_STOP_201
61299#AT_START_202
61300at_fn_group_banner 202 'calc.at:600' \
61301  "Calculator %locations" "                          " 11
61302at_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
61316cat >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
61357FILE *input;
61358static int power (int base, int exponent);
61359
61360static void yyerror ( const char *msg);
61361int 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%%
61379input:
61380  line
61381| input line         {  }
61382;
61383
61384line:
61385  '\n'
61386| exp '\n'           { USE ($1); }
61387;
61388
61389exp:
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
61410static int
61411power (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.  */
61423static
61424void 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
61432int yylex (void);
61433static int get_char (void);
61434static void unget_char ( int c);
61435
61436
61437static YYLTYPE last_yylloc;
61438
61439static int
61440get_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
61457static void
61458unget_char ( int c)
61459{
61460  ;
61461
61462  /* Wrong when C == `\n'. */
61463  (yylloc) = last_yylloc;
61464
61465  ungetc (c, input);
61466}
61467
61468static int
61469read_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
61500int 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
61538semantic_value global_result = 0;
61539int global_count = 0;
61540
61541/* A C main function.  */
61542int
61543main (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
61582if 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"
61590at_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>&-
61594at_status=$? at_failed=false
61595$at_check_filter
61596echo stderr:; cat "$at_stderr"
61597echo stdout:; cat "$at_stdout"
61598at_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"
61604at_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>&-
61607at_status=$? at_failed=false
61608$at_check_filter
61609echo stderr:; cat "$at_stderr"
61610echo stdout:; cat "$at_stdout"
61611at_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"
61620at_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>&-
61625at_status=$? at_failed=false
61626$at_check_filter
61627at_fn_diff_devnull "$at_stderr" || at_failed=:
61628$at_diff expout "$at_stdout" || at_failed=:
61629at_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"
61638at_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>&-
61643at_status=$? at_failed=false
61644$at_check_filter
61645at_fn_diff_devnull "$at_stderr" || at_failed=:
61646$at_diff expout "$at_stdout" || at_failed=:
61647at_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
61653fi
61654{ set +x
61655$as_echo "$at_srcdir/calc.at:600: bison -o calc.c calc.y"
61656at_fn_check_prepare_trace "calc.at:600"
61657( $at_check_trace; bison -o calc.c calc.y
61658) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61659at_status=$? at_failed=false
61660$at_check_filter
61661at_fn_diff_devnull "$at_stderr" || at_failed=:
61662at_fn_diff_devnull "$at_stdout" || at_failed=:
61663at_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"
61670at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:600"
61671( $at_check_trace; $BISON_C_WORKS
61672) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61673at_status=$? at_failed=false
61674$at_check_filter
61675echo stderr:; cat "$at_stderr"
61676echo stdout:; cat "$at_stdout"
61677at_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"
61683at_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>&-
61686at_status=$? at_failed=false
61687$at_check_filter
61688echo stderr:; cat "$at_stderr"
61689echo stdout:; cat "$at_stdout"
61690at_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"
61705at_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>&-
61716at_status=$? at_failed=false
61717$at_check_filter
61718at_fn_diff_devnull "$at_stderr" || at_failed=:
61719at_fn_diff_devnull "$at_stdout" || at_failed=:
61720at_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.
61727cat >input <<'_ATEOF'
617281 + 2 * 3 = 7
617291 + 2 * -3 = -5
61730
61731-1^2 = -1
61732(-1)^2 = 1
61733
61734---1 = -1
61735
617361 - 2 - 3 = -4
617371 - (2 - 3) = 2
61738
617392^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"
61745at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
61746( $at_check_trace;  $PREPARSER ./calc input
61747) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61748at_status=$? at_failed=false
61749$at_check_filter
61750echo stderr:; tee stderr <"$at_stderr"
61751at_fn_diff_devnull "$at_stdout" || at_failed=:
61752at_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"
61758at_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>&-
61761at_status=$? at_failed=false
61762$at_check_filter
61763echo stderr:; tee stderr <"$at_stderr"
61764at_fn_diff_devnull "$at_stdout" || at_failed=:
61765at_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.
61773cat >input <<'_ATEOF'
617741 2
61775_ATEOF
61776
61777{ set +x
61778$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
61779at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
61780( $at_check_trace;  $PREPARSER ./calc input
61781) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61782at_status=$? at_failed=false
61783$at_check_filter
61784echo stderr:; tee stderr <"$at_stderr"
61785at_fn_diff_devnull "$at_stdout" || at_failed=:
61786at_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"
61792at_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>&-
61795at_status=$? at_failed=false
61796$at_check_filter
61797echo stderr:; tee stderr <"$at_stderr"
61798at_fn_diff_devnull "$at_stdout" || at_failed=:
61799at_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.
61808sed '/^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
61823mv at-stderr stderr
61824# 2. Create the reference error message.
61825cat >expout <<'_ATEOF'
618261.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.
61832sed 's/syntax error, .*$/syntax error/' expout >at-expout
61833mv at-expout expout
61834# 5. Check
61835{ set +x
61836$as_echo "$at_srcdir/calc.at:600: cat stderr"
61837at_fn_check_prepare_trace "calc.at:600"
61838( $at_check_trace; cat stderr
61839) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61840at_status=$? at_failed=false
61841$at_check_filter
61842at_fn_diff_devnull "$at_stderr" || at_failed=:
61843$at_diff expout "$at_stdout" || at_failed=:
61844at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
61845$at_failed && at_fn_log_failure
61846$at_traceon; }
61847
61848
61849cat >input <<'_ATEOF'
618501//2
61851_ATEOF
61852
61853{ set +x
61854$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
61855at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
61856( $at_check_trace;  $PREPARSER ./calc input
61857) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61858at_status=$? at_failed=false
61859$at_check_filter
61860echo stderr:; tee stderr <"$at_stderr"
61861at_fn_diff_devnull "$at_stdout" || at_failed=:
61862at_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"
61868at_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>&-
61871at_status=$? at_failed=false
61872$at_check_filter
61873echo stderr:; tee stderr <"$at_stderr"
61874at_fn_diff_devnull "$at_stdout" || at_failed=:
61875at_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.
61884sed '/^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
61899mv at-stderr stderr
61900# 2. Create the reference error message.
61901cat >expout <<'_ATEOF'
619021.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.
61908sed 's/syntax error, .*$/syntax error/' expout >at-expout
61909mv at-expout expout
61910# 5. Check
61911{ set +x
61912$as_echo "$at_srcdir/calc.at:600: cat stderr"
61913at_fn_check_prepare_trace "calc.at:600"
61914( $at_check_trace; cat stderr
61915) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61916at_status=$? at_failed=false
61917$at_check_filter
61918at_fn_diff_devnull "$at_stderr" || at_failed=:
61919$at_diff expout "$at_stdout" || at_failed=:
61920at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
61921$at_failed && at_fn_log_failure
61922$at_traceon; }
61923
61924
61925cat >input <<'_ATEOF'
61926error
61927_ATEOF
61928
61929{ set +x
61930$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
61931at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
61932( $at_check_trace;  $PREPARSER ./calc input
61933) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61934at_status=$? at_failed=false
61935$at_check_filter
61936echo stderr:; tee stderr <"$at_stderr"
61937at_fn_diff_devnull "$at_stdout" || at_failed=:
61938at_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"
61944at_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>&-
61947at_status=$? at_failed=false
61948$at_check_filter
61949echo stderr:; tee stderr <"$at_stderr"
61950at_fn_diff_devnull "$at_stdout" || at_failed=:
61951at_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.
61960sed '/^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
61975mv at-stderr stderr
61976# 2. Create the reference error message.
61977cat >expout <<'_ATEOF'
619781.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.
61984sed 's/syntax error, .*$/syntax error/' expout >at-expout
61985mv at-expout expout
61986# 5. Check
61987{ set +x
61988$as_echo "$at_srcdir/calc.at:600: cat stderr"
61989at_fn_check_prepare_trace "calc.at:600"
61990( $at_check_trace; cat stderr
61991) >>"$at_stdout" 2>>"$at_stderr" 5>&-
61992at_status=$? at_failed=false
61993$at_check_filter
61994at_fn_diff_devnull "$at_stderr" || at_failed=:
61995$at_diff expout "$at_stdout" || at_failed=:
61996at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
61997$at_failed && at_fn_log_failure
61998$at_traceon; }
61999
62000
62001cat >input <<'_ATEOF'
620021 = 2 = 3
62003_ATEOF
62004
62005{ set +x
62006$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
62007at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62008( $at_check_trace;  $PREPARSER ./calc input
62009) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62010at_status=$? at_failed=false
62011$at_check_filter
62012echo stderr:; tee stderr <"$at_stderr"
62013at_fn_diff_devnull "$at_stdout" || at_failed=:
62014at_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"
62020at_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>&-
62023at_status=$? at_failed=false
62024$at_check_filter
62025echo stderr:; tee stderr <"$at_stderr"
62026at_fn_diff_devnull "$at_stdout" || at_failed=:
62027at_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.
62036sed '/^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
62051mv at-stderr stderr
62052# 2. Create the reference error message.
62053cat >expout <<'_ATEOF'
620541.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.
62060sed 's/syntax error, .*$/syntax error/' expout >at-expout
62061mv at-expout expout
62062# 5. Check
62063{ set +x
62064$as_echo "$at_srcdir/calc.at:600: cat stderr"
62065at_fn_check_prepare_trace "calc.at:600"
62066( $at_check_trace; cat stderr
62067) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62068at_status=$? at_failed=false
62069$at_check_filter
62070at_fn_diff_devnull "$at_stderr" || at_failed=:
62071$at_diff expout "$at_stdout" || at_failed=:
62072at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
62073$at_failed && at_fn_log_failure
62074$at_traceon; }
62075
62076
62077cat >input <<'_ATEOF'
62078
62079+1
62080_ATEOF
62081
62082{ set +x
62083$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
62084at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62085( $at_check_trace;  $PREPARSER ./calc input
62086) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62087at_status=$? at_failed=false
62088$at_check_filter
62089echo stderr:; tee stderr <"$at_stderr"
62090at_fn_diff_devnull "$at_stdout" || at_failed=:
62091at_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"
62097at_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>&-
62100at_status=$? at_failed=false
62101$at_check_filter
62102echo stderr:; tee stderr <"$at_stderr"
62103at_fn_diff_devnull "$at_stdout" || at_failed=:
62104at_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.
62113sed '/^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
62128mv at-stderr stderr
62129# 2. Create the reference error message.
62130cat >expout <<'_ATEOF'
621312.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.
62137sed 's/syntax error, .*$/syntax error/' expout >at-expout
62138mv at-expout expout
62139# 5. Check
62140{ set +x
62141$as_echo "$at_srcdir/calc.at:600: cat stderr"
62142at_fn_check_prepare_trace "calc.at:600"
62143( $at_check_trace; cat stderr
62144) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62145at_status=$? at_failed=false
62146$at_check_filter
62147at_fn_diff_devnull "$at_stderr" || at_failed=:
62148$at_diff expout "$at_stdout" || at_failed=:
62149at_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"
62157at_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>&-
62160at_status=$? at_failed=false
62161$at_check_filter
62162echo stderr:; tee stderr <"$at_stderr"
62163at_fn_diff_devnull "$at_stdout" || at_failed=:
62164at_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"
62170at_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>&-
62173at_status=$? at_failed=false
62174$at_check_filter
62175echo stderr:; tee stderr <"$at_stderr"
62176at_fn_diff_devnull "$at_stdout" || at_failed=:
62177at_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.
62186sed '/^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
62201mv at-stderr stderr
62202# 2. Create the reference error message.
62203cat >expout <<'_ATEOF'
622041.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.
62210sed 's/syntax error, .*$/syntax error/' expout >at-expout
62211mv at-expout expout
62212# 5. Check
62213{ set +x
62214$as_echo "$at_srcdir/calc.at:600: cat stderr"
62215at_fn_check_prepare_trace "calc.at:600"
62216( $at_check_trace; cat stderr
62217) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62218at_status=$? at_failed=false
62219$at_check_filter
62220at_fn_diff_devnull "$at_stderr" || at_failed=:
62221$at_diff expout "$at_stdout" || at_failed=:
62222at_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#
62244cat >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"
62250at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62251( $at_check_trace;  $PREPARSER ./calc input
62252) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62253at_status=$? at_failed=false
62254$at_check_filter
62255echo stderr:; tee stderr <"$at_stderr"
62256at_fn_diff_devnull "$at_stdout" || at_failed=:
62257at_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"
62263at_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>&-
62266at_status=$? at_failed=false
62267$at_check_filter
62268echo stderr:; tee stderr <"$at_stderr"
62269at_fn_diff_devnull "$at_stdout" || at_failed=:
62270at_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.
62279sed '/^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
62294mv at-stderr stderr
62295# 2. Create the reference error message.
62296cat >expout <<'_ATEOF'
622971.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
622981.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
622991.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
623001.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
62301calc: 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.
62307sed 's/syntax error, .*$/syntax error/' expout >at-expout
62308mv at-expout expout
62309# 5. Check
62310{ set +x
62311$as_echo "$at_srcdir/calc.at:600: cat stderr"
62312at_fn_check_prepare_trace "calc.at:600"
62313( $at_check_trace; cat stderr
62314) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62315at_status=$? at_failed=false
62316$at_check_filter
62317at_fn_diff_devnull "$at_stderr" || at_failed=:
62318$at_diff expout "$at_stdout" || at_failed=:
62319at_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.
62327cat >input <<'_ATEOF'
62328(!) + (1 2) = 1
62329_ATEOF
62330
62331{ set +x
62332$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
62333at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62334( $at_check_trace;  $PREPARSER ./calc input
62335) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62336at_status=$? at_failed=false
62337$at_check_filter
62338echo stderr:; tee stderr <"$at_stderr"
62339at_fn_diff_devnull "$at_stdout" || at_failed=:
62340at_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"
62346at_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>&-
62349at_status=$? at_failed=false
62350$at_check_filter
62351echo stderr:; tee stderr <"$at_stderr"
62352at_fn_diff_devnull "$at_stdout" || at_failed=:
62353at_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.
62362sed '/^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
62377mv at-stderr stderr
62378# 2. Create the reference error message.
62379cat >expout <<'_ATEOF'
623801.10: syntax error, unexpected number
62381calc: 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.
62387sed 's/syntax error, .*$/syntax error/' expout >at-expout
62388mv at-expout expout
62389# 5. Check
62390{ set +x
62391$as_echo "$at_srcdir/calc.at:600: cat stderr"
62392at_fn_check_prepare_trace "calc.at:600"
62393( $at_check_trace; cat stderr
62394) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62395at_status=$? at_failed=false
62396$at_check_filter
62397at_fn_diff_devnull "$at_stderr" || at_failed=:
62398$at_diff expout "$at_stdout" || at_failed=:
62399at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
62400$at_failed && at_fn_log_failure
62401$at_traceon; }
62402
62403
62404cat >input <<'_ATEOF'
62405(- *) + (1 2) = 1
62406_ATEOF
62407
62408{ set +x
62409$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
62410at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62411( $at_check_trace;  $PREPARSER ./calc input
62412) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62413at_status=$? at_failed=false
62414$at_check_filter
62415echo stderr:; tee stderr <"$at_stderr"
62416at_fn_diff_devnull "$at_stdout" || at_failed=:
62417at_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"
62423at_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>&-
62426at_status=$? at_failed=false
62427$at_check_filter
62428echo stderr:; tee stderr <"$at_stderr"
62429at_fn_diff_devnull "$at_stdout" || at_failed=:
62430at_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.
62439sed '/^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
62454mv at-stderr stderr
62455# 2. Create the reference error message.
62456cat >expout <<'_ATEOF'
624571.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
624581.12: syntax error, unexpected number
62459calc: 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.
62465sed 's/syntax error, .*$/syntax error/' expout >at-expout
62466mv at-expout expout
62467# 5. Check
62468{ set +x
62469$as_echo "$at_srcdir/calc.at:600: cat stderr"
62470at_fn_check_prepare_trace "calc.at:600"
62471( $at_check_trace; cat stderr
62472) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62473at_status=$? at_failed=false
62474$at_check_filter
62475at_fn_diff_devnull "$at_stderr" || at_failed=:
62476$at_diff expout "$at_stdout" || at_failed=:
62477at_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.
62485cat >input <<'_ATEOF'
62486(* *) + (*) + (*)
62487_ATEOF
62488
62489{ set +x
62490$as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
62491at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
62492( $at_check_trace;  $PREPARSER ./calc input
62493) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62494at_status=$? at_failed=false
62495$at_check_filter
62496echo stderr:; tee stderr <"$at_stderr"
62497at_fn_diff_devnull "$at_stdout" || at_failed=:
62498at_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"
62504at_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>&-
62507at_status=$? at_failed=false
62508$at_check_filter
62509echo stderr:; tee stderr <"$at_stderr"
62510at_fn_diff_devnull "$at_stdout" || at_failed=:
62511at_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.
62520sed '/^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
62535mv at-stderr stderr
62536# 2. Create the reference error message.
62537cat >expout <<'_ATEOF'
625381.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
625391.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
625401.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.
62546sed 's/syntax error, .*$/syntax error/' expout >at-expout
62547mv at-expout expout
62548# 5. Check
62549{ set +x
62550$as_echo "$at_srcdir/calc.at:600: cat stderr"
62551at_fn_check_prepare_trace "calc.at:600"
62552( $at_check_trace; cat stderr
62553) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62554at_status=$? at_failed=false
62555$at_check_filter
62556at_fn_diff_devnull "$at_stderr" || at_failed=:
62557$at_diff expout "$at_stdout" || at_failed=:
62558at_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
62569read at_status <"$at_status_file"
62570#AT_STOP_202
62571#AT_START_203
62572at_fn_group_banner 203 'calc.at:602' \
62573  "Calculator %name-prefix=\"calc\"" "                 " 11
62574at_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
62588cat >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
62629FILE *input;
62630static int power (int base, int exponent);
62631
62632static void yyerror ( const char *msg);
62633int 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%%
62651input:
62652  line
62653| input line         {  }
62654;
62655
62656line:
62657  '\n'
62658| exp '\n'           { USE ($1); }
62659;
62660
62661exp:
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
62682static int
62683power (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.  */
62695static
62696void yyerror ( const char *msg)
62697{
62698  fprintf (stderr, "%s\n", msg);
62699}
62700#include <ctype.h>
62701
62702int yylex (void);
62703static int get_char (void);
62704static void unget_char ( int c);
62705
62706
62707static int
62708get_char (void)
62709{
62710  int res = getc (input);
62711  ;
62712
62713  return res;
62714}
62715
62716static void
62717unget_char ( int c)
62718{
62719  ;
62720
62721  ungetc (c, input);
62722}
62723
62724static int
62725read_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
62756int 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
62792semantic_value global_result = 0;
62793int global_count = 0;
62794
62795/* A C main function.  */
62796int
62797main (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
62836if 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"
62844at_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>&-
62848at_status=$? at_failed=false
62849$at_check_filter
62850echo stderr:; cat "$at_stderr"
62851echo stdout:; cat "$at_stdout"
62852at_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"
62858at_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>&-
62861at_status=$? at_failed=false
62862$at_check_filter
62863echo stderr:; cat "$at_stderr"
62864echo stdout:; cat "$at_stdout"
62865at_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"
62874at_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>&-
62879at_status=$? at_failed=false
62880$at_check_filter
62881at_fn_diff_devnull "$at_stderr" || at_failed=:
62882$at_diff expout "$at_stdout" || at_failed=:
62883at_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"
62892at_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>&-
62897at_status=$? at_failed=false
62898$at_check_filter
62899at_fn_diff_devnull "$at_stderr" || at_failed=:
62900$at_diff expout "$at_stdout" || at_failed=:
62901at_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
62907fi
62908{ set +x
62909$as_echo "$at_srcdir/calc.at:602: bison -o calc.c calc.y"
62910at_fn_check_prepare_trace "calc.at:602"
62911( $at_check_trace; bison -o calc.c calc.y
62912) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62913at_status=$? at_failed=false
62914$at_check_filter
62915at_fn_diff_devnull "$at_stderr" || at_failed=:
62916at_fn_diff_devnull "$at_stdout" || at_failed=:
62917at_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"
62924at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602"
62925( $at_check_trace; $BISON_C_WORKS
62926) >>"$at_stdout" 2>>"$at_stderr" 5>&-
62927at_status=$? at_failed=false
62928$at_check_filter
62929echo stderr:; cat "$at_stderr"
62930echo stdout:; cat "$at_stdout"
62931at_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"
62937at_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>&-
62940at_status=$? at_failed=false
62941$at_check_filter
62942echo stderr:; cat "$at_stderr"
62943echo stdout:; cat "$at_stdout"
62944at_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"
62959at_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>&-
62970at_status=$? at_failed=false
62971$at_check_filter
62972at_fn_diff_devnull "$at_stderr" || at_failed=:
62973at_fn_diff_devnull "$at_stdout" || at_failed=:
62974at_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.
62981cat >input <<'_ATEOF'
629821 + 2 * 3 = 7
629831 + 2 * -3 = -5
62984
62985-1^2 = -1
62986(-1)^2 = 1
62987
62988---1 = -1
62989
629901 - 2 - 3 = -4
629911 - (2 - 3) = 2
62992
629932^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"
62999at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63000( $at_check_trace;  $PREPARSER ./calc input
63001) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63002at_status=$? at_failed=false
63003$at_check_filter
63004echo stderr:; tee stderr <"$at_stderr"
63005at_fn_diff_devnull "$at_stdout" || at_failed=:
63006at_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"
63012at_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>&-
63015at_status=$? at_failed=false
63016$at_check_filter
63017echo stderr:; tee stderr <"$at_stderr"
63018at_fn_diff_devnull "$at_stdout" || at_failed=:
63019at_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.
63027cat >input <<'_ATEOF'
630281 2
63029_ATEOF
63030
63031{ set +x
63032$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63033at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63034( $at_check_trace;  $PREPARSER ./calc input
63035) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63036at_status=$? at_failed=false
63037$at_check_filter
63038echo stderr:; tee stderr <"$at_stderr"
63039at_fn_diff_devnull "$at_stdout" || at_failed=:
63040at_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"
63046at_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>&-
63049at_status=$? at_failed=false
63050$at_check_filter
63051echo stderr:; tee stderr <"$at_stderr"
63052at_fn_diff_devnull "$at_stdout" || at_failed=:
63053at_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.
63062sed '/^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
63077mv at-stderr stderr
63078# 2. Create the reference error message.
63079cat >expout <<'_ATEOF'
630801.3: syntax error, unexpected number
63081_ATEOF
63082
63083# 3. If locations are not used, remove them.
63084sed 's/^[-0-9.]*: //' expout >at-expout
63085mv at-expout expout
63086# 4. If error-verbose is not used, strip the`, unexpected....' part.
63087sed 's/syntax error, .*$/syntax error/' expout >at-expout
63088mv at-expout expout
63089# 5. Check
63090{ set +x
63091$as_echo "$at_srcdir/calc.at:602: cat stderr"
63092at_fn_check_prepare_trace "calc.at:602"
63093( $at_check_trace; cat stderr
63094) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63095at_status=$? at_failed=false
63096$at_check_filter
63097at_fn_diff_devnull "$at_stderr" || at_failed=:
63098$at_diff expout "$at_stdout" || at_failed=:
63099at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
63100$at_failed && at_fn_log_failure
63101$at_traceon; }
63102
63103
63104cat >input <<'_ATEOF'
631051//2
63106_ATEOF
63107
63108{ set +x
63109$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63110at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63111( $at_check_trace;  $PREPARSER ./calc input
63112) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63113at_status=$? at_failed=false
63114$at_check_filter
63115echo stderr:; tee stderr <"$at_stderr"
63116at_fn_diff_devnull "$at_stdout" || at_failed=:
63117at_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"
63123at_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>&-
63126at_status=$? at_failed=false
63127$at_check_filter
63128echo stderr:; tee stderr <"$at_stderr"
63129at_fn_diff_devnull "$at_stdout" || at_failed=:
63130at_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.
63139sed '/^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
63154mv at-stderr stderr
63155# 2. Create the reference error message.
63156cat >expout <<'_ATEOF'
631571.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
63158_ATEOF
63159
63160# 3. If locations are not used, remove them.
63161sed 's/^[-0-9.]*: //' expout >at-expout
63162mv at-expout expout
63163# 4. If error-verbose is not used, strip the`, unexpected....' part.
63164sed 's/syntax error, .*$/syntax error/' expout >at-expout
63165mv at-expout expout
63166# 5. Check
63167{ set +x
63168$as_echo "$at_srcdir/calc.at:602: cat stderr"
63169at_fn_check_prepare_trace "calc.at:602"
63170( $at_check_trace; cat stderr
63171) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63172at_status=$? at_failed=false
63173$at_check_filter
63174at_fn_diff_devnull "$at_stderr" || at_failed=:
63175$at_diff expout "$at_stdout" || at_failed=:
63176at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
63177$at_failed && at_fn_log_failure
63178$at_traceon; }
63179
63180
63181cat >input <<'_ATEOF'
63182error
63183_ATEOF
63184
63185{ set +x
63186$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63187at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63188( $at_check_trace;  $PREPARSER ./calc input
63189) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63190at_status=$? at_failed=false
63191$at_check_filter
63192echo stderr:; tee stderr <"$at_stderr"
63193at_fn_diff_devnull "$at_stdout" || at_failed=:
63194at_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"
63200at_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>&-
63203at_status=$? at_failed=false
63204$at_check_filter
63205echo stderr:; tee stderr <"$at_stderr"
63206at_fn_diff_devnull "$at_stdout" || at_failed=:
63207at_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.
63216sed '/^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
63231mv at-stderr stderr
63232# 2. Create the reference error message.
63233cat >expout <<'_ATEOF'
632341.1: syntax error, unexpected $undefined
63235_ATEOF
63236
63237# 3. If locations are not used, remove them.
63238sed 's/^[-0-9.]*: //' expout >at-expout
63239mv at-expout expout
63240# 4. If error-verbose is not used, strip the`, unexpected....' part.
63241sed 's/syntax error, .*$/syntax error/' expout >at-expout
63242mv at-expout expout
63243# 5. Check
63244{ set +x
63245$as_echo "$at_srcdir/calc.at:602: cat stderr"
63246at_fn_check_prepare_trace "calc.at:602"
63247( $at_check_trace; cat stderr
63248) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63249at_status=$? at_failed=false
63250$at_check_filter
63251at_fn_diff_devnull "$at_stderr" || at_failed=:
63252$at_diff expout "$at_stdout" || at_failed=:
63253at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
63254$at_failed && at_fn_log_failure
63255$at_traceon; }
63256
63257
63258cat >input <<'_ATEOF'
632591 = 2 = 3
63260_ATEOF
63261
63262{ set +x
63263$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63264at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63265( $at_check_trace;  $PREPARSER ./calc input
63266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63267at_status=$? at_failed=false
63268$at_check_filter
63269echo stderr:; tee stderr <"$at_stderr"
63270at_fn_diff_devnull "$at_stdout" || at_failed=:
63271at_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"
63277at_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>&-
63280at_status=$? at_failed=false
63281$at_check_filter
63282echo stderr:; tee stderr <"$at_stderr"
63283at_fn_diff_devnull "$at_stdout" || at_failed=:
63284at_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.
63293sed '/^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
63308mv at-stderr stderr
63309# 2. Create the reference error message.
63310cat >expout <<'_ATEOF'
633111.7: syntax error, unexpected '='
63312_ATEOF
63313
63314# 3. If locations are not used, remove them.
63315sed 's/^[-0-9.]*: //' expout >at-expout
63316mv at-expout expout
63317# 4. If error-verbose is not used, strip the`, unexpected....' part.
63318sed 's/syntax error, .*$/syntax error/' expout >at-expout
63319mv at-expout expout
63320# 5. Check
63321{ set +x
63322$as_echo "$at_srcdir/calc.at:602: cat stderr"
63323at_fn_check_prepare_trace "calc.at:602"
63324( $at_check_trace; cat stderr
63325) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63326at_status=$? at_failed=false
63327$at_check_filter
63328at_fn_diff_devnull "$at_stderr" || at_failed=:
63329$at_diff expout "$at_stdout" || at_failed=:
63330at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
63331$at_failed && at_fn_log_failure
63332$at_traceon; }
63333
63334
63335cat >input <<'_ATEOF'
63336
63337+1
63338_ATEOF
63339
63340{ set +x
63341$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63342at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63343( $at_check_trace;  $PREPARSER ./calc input
63344) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63345at_status=$? at_failed=false
63346$at_check_filter
63347echo stderr:; tee stderr <"$at_stderr"
63348at_fn_diff_devnull "$at_stdout" || at_failed=:
63349at_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"
63355at_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>&-
63358at_status=$? at_failed=false
63359$at_check_filter
63360echo stderr:; tee stderr <"$at_stderr"
63361at_fn_diff_devnull "$at_stdout" || at_failed=:
63362at_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.
63371sed '/^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
63386mv at-stderr stderr
63387# 2. Create the reference error message.
63388cat >expout <<'_ATEOF'
633892.1: syntax error, unexpected '+'
63390_ATEOF
63391
63392# 3. If locations are not used, remove them.
63393sed 's/^[-0-9.]*: //' expout >at-expout
63394mv at-expout expout
63395# 4. If error-verbose is not used, strip the`, unexpected....' part.
63396sed 's/syntax error, .*$/syntax error/' expout >at-expout
63397mv at-expout expout
63398# 5. Check
63399{ set +x
63400$as_echo "$at_srcdir/calc.at:602: cat stderr"
63401at_fn_check_prepare_trace "calc.at:602"
63402( $at_check_trace; cat stderr
63403) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63404at_status=$? at_failed=false
63405$at_check_filter
63406at_fn_diff_devnull "$at_stderr" || at_failed=:
63407$at_diff expout "$at_stdout" || at_failed=:
63408at_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"
63416at_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>&-
63419at_status=$? at_failed=false
63420$at_check_filter
63421echo stderr:; tee stderr <"$at_stderr"
63422at_fn_diff_devnull "$at_stdout" || at_failed=:
63423at_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"
63429at_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>&-
63432at_status=$? at_failed=false
63433$at_check_filter
63434echo stderr:; tee stderr <"$at_stderr"
63435at_fn_diff_devnull "$at_stdout" || at_failed=:
63436at_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.
63445sed '/^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
63460mv at-stderr stderr
63461# 2. Create the reference error message.
63462cat >expout <<'_ATEOF'
634631.1: syntax error, unexpected end of input
63464_ATEOF
63465
63466# 3. If locations are not used, remove them.
63467sed 's/^[-0-9.]*: //' expout >at-expout
63468mv at-expout expout
63469# 4. If error-verbose is not used, strip the`, unexpected....' part.
63470sed 's/syntax error, .*$/syntax error/' expout >at-expout
63471mv at-expout expout
63472# 5. Check
63473{ set +x
63474$as_echo "$at_srcdir/calc.at:602: cat stderr"
63475at_fn_check_prepare_trace "calc.at:602"
63476( $at_check_trace; cat stderr
63477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63478at_status=$? at_failed=false
63479$at_check_filter
63480at_fn_diff_devnull "$at_stderr" || at_failed=:
63481$at_diff expout "$at_stdout" || at_failed=:
63482at_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#
63504cat >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"
63510at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63511( $at_check_trace;  $PREPARSER ./calc input
63512) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63513at_status=$? at_failed=false
63514$at_check_filter
63515echo stderr:; tee stderr <"$at_stderr"
63516at_fn_diff_devnull "$at_stdout" || at_failed=:
63517at_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"
63523at_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>&-
63526at_status=$? at_failed=false
63527$at_check_filter
63528echo stderr:; tee stderr <"$at_stderr"
63529at_fn_diff_devnull "$at_stdout" || at_failed=:
63530at_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.
63539sed '/^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
63554mv at-stderr stderr
63555# 2. Create the reference error message.
63556cat >expout <<'_ATEOF'
635571.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
635581.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
635591.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
635601.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
63561calc: error: 4444 != 1
63562_ATEOF
63563
63564# 3. If locations are not used, remove them.
63565sed 's/^[-0-9.]*: //' expout >at-expout
63566mv at-expout expout
63567# 4. If error-verbose is not used, strip the`, unexpected....' part.
63568sed 's/syntax error, .*$/syntax error/' expout >at-expout
63569mv at-expout expout
63570# 5. Check
63571{ set +x
63572$as_echo "$at_srcdir/calc.at:602: cat stderr"
63573at_fn_check_prepare_trace "calc.at:602"
63574( $at_check_trace; cat stderr
63575) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63576at_status=$? at_failed=false
63577$at_check_filter
63578at_fn_diff_devnull "$at_stderr" || at_failed=:
63579$at_diff expout "$at_stdout" || at_failed=:
63580at_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.
63588cat >input <<'_ATEOF'
63589(!) + (1 2) = 1
63590_ATEOF
63591
63592{ set +x
63593$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63594at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63595( $at_check_trace;  $PREPARSER ./calc input
63596) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63597at_status=$? at_failed=false
63598$at_check_filter
63599echo stderr:; tee stderr <"$at_stderr"
63600at_fn_diff_devnull "$at_stdout" || at_failed=:
63601at_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"
63607at_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>&-
63610at_status=$? at_failed=false
63611$at_check_filter
63612echo stderr:; tee stderr <"$at_stderr"
63613at_fn_diff_devnull "$at_stdout" || at_failed=:
63614at_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.
63623sed '/^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
63638mv at-stderr stderr
63639# 2. Create the reference error message.
63640cat >expout <<'_ATEOF'
636411.10: syntax error, unexpected number
63642calc: error: 2222 != 1
63643_ATEOF
63644
63645# 3. If locations are not used, remove them.
63646sed 's/^[-0-9.]*: //' expout >at-expout
63647mv at-expout expout
63648# 4. If error-verbose is not used, strip the`, unexpected....' part.
63649sed 's/syntax error, .*$/syntax error/' expout >at-expout
63650mv at-expout expout
63651# 5. Check
63652{ set +x
63653$as_echo "$at_srcdir/calc.at:602: cat stderr"
63654at_fn_check_prepare_trace "calc.at:602"
63655( $at_check_trace; cat stderr
63656) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63657at_status=$? at_failed=false
63658$at_check_filter
63659at_fn_diff_devnull "$at_stderr" || at_failed=:
63660$at_diff expout "$at_stdout" || at_failed=:
63661at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
63662$at_failed && at_fn_log_failure
63663$at_traceon; }
63664
63665
63666cat >input <<'_ATEOF'
63667(- *) + (1 2) = 1
63668_ATEOF
63669
63670{ set +x
63671$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63672at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63673( $at_check_trace;  $PREPARSER ./calc input
63674) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63675at_status=$? at_failed=false
63676$at_check_filter
63677echo stderr:; tee stderr <"$at_stderr"
63678at_fn_diff_devnull "$at_stdout" || at_failed=:
63679at_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"
63685at_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>&-
63688at_status=$? at_failed=false
63689$at_check_filter
63690echo stderr:; tee stderr <"$at_stderr"
63691at_fn_diff_devnull "$at_stdout" || at_failed=:
63692at_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.
63701sed '/^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
63716mv at-stderr stderr
63717# 2. Create the reference error message.
63718cat >expout <<'_ATEOF'
637191.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
637201.12: syntax error, unexpected number
63721calc: error: 2222 != 1
63722_ATEOF
63723
63724# 3. If locations are not used, remove them.
63725sed 's/^[-0-9.]*: //' expout >at-expout
63726mv at-expout expout
63727# 4. If error-verbose is not used, strip the`, unexpected....' part.
63728sed 's/syntax error, .*$/syntax error/' expout >at-expout
63729mv at-expout expout
63730# 5. Check
63731{ set +x
63732$as_echo "$at_srcdir/calc.at:602: cat stderr"
63733at_fn_check_prepare_trace "calc.at:602"
63734( $at_check_trace; cat stderr
63735) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63736at_status=$? at_failed=false
63737$at_check_filter
63738at_fn_diff_devnull "$at_stderr" || at_failed=:
63739$at_diff expout "$at_stdout" || at_failed=:
63740at_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.
63748cat >input <<'_ATEOF'
63749(* *) + (*) + (*)
63750_ATEOF
63751
63752{ set +x
63753$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
63754at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
63755( $at_check_trace;  $PREPARSER ./calc input
63756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63757at_status=$? at_failed=false
63758$at_check_filter
63759echo stderr:; tee stderr <"$at_stderr"
63760at_fn_diff_devnull "$at_stdout" || at_failed=:
63761at_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"
63767at_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>&-
63770at_status=$? at_failed=false
63771$at_check_filter
63772echo stderr:; tee stderr <"$at_stderr"
63773at_fn_diff_devnull "$at_stdout" || at_failed=:
63774at_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.
63783sed '/^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
63798mv at-stderr stderr
63799# 2. Create the reference error message.
63800cat >expout <<'_ATEOF'
638011.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
638021.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
638031.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
63804_ATEOF
63805
63806# 3. If locations are not used, remove them.
63807sed 's/^[-0-9.]*: //' expout >at-expout
63808mv at-expout expout
63809# 4. If error-verbose is not used, strip the`, unexpected....' part.
63810sed 's/syntax error, .*$/syntax error/' expout >at-expout
63811mv at-expout expout
63812# 5. Check
63813{ set +x
63814$as_echo "$at_srcdir/calc.at:602: cat stderr"
63815at_fn_check_prepare_trace "calc.at:602"
63816( $at_check_trace; cat stderr
63817) >>"$at_stdout" 2>>"$at_stderr" 5>&-
63818at_status=$? at_failed=false
63819$at_check_filter
63820at_fn_diff_devnull "$at_stderr" || at_failed=:
63821$at_diff expout "$at_stdout" || at_failed=:
63822at_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
63833read at_status <"$at_status_file"
63834#AT_STOP_203
63835#AT_START_204
63836at_fn_group_banner 204 'calc.at:603' \
63837  "Calculator %verbose" "                            " 11
63838at_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
63852cat >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
63893FILE *input;
63894static int power (int base, int exponent);
63895
63896static void yyerror ( const char *msg);
63897int 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%%
63915input:
63916  line
63917| input line         {  }
63918;
63919
63920line:
63921  '\n'
63922| exp '\n'           { USE ($1); }
63923;
63924
63925exp:
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
63946static int
63947power (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.  */
63959static
63960void yyerror ( const char *msg)
63961{
63962  fprintf (stderr, "%s\n", msg);
63963}
63964#include <ctype.h>
63965
63966int yylex (void);
63967static int get_char (void);
63968static void unget_char ( int c);
63969
63970
63971static int
63972get_char (void)
63973{
63974  int res = getc (input);
63975  ;
63976
63977  return res;
63978}
63979
63980static void
63981unget_char ( int c)
63982{
63983  ;
63984
63985  ungetc (c, input);
63986}
63987
63988static int
63989read_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
64020int 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
64056semantic_value global_result = 0;
64057int global_count = 0;
64058
64059/* A C main function.  */
64060int
64061main (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
64100if 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"
64108at_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>&-
64112at_status=$? at_failed=false
64113$at_check_filter
64114echo stderr:; cat "$at_stderr"
64115echo stdout:; cat "$at_stdout"
64116at_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"
64122at_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>&-
64125at_status=$? at_failed=false
64126$at_check_filter
64127echo stderr:; cat "$at_stderr"
64128echo stdout:; cat "$at_stdout"
64129at_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"
64138at_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>&-
64143at_status=$? at_failed=false
64144$at_check_filter
64145at_fn_diff_devnull "$at_stderr" || at_failed=:
64146$at_diff expout "$at_stdout" || at_failed=:
64147at_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"
64156at_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>&-
64161at_status=$? at_failed=false
64162$at_check_filter
64163at_fn_diff_devnull "$at_stderr" || at_failed=:
64164$at_diff expout "$at_stdout" || at_failed=:
64165at_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
64171fi
64172{ set +x
64173$as_echo "$at_srcdir/calc.at:603: bison -o calc.c calc.y"
64174at_fn_check_prepare_trace "calc.at:603"
64175( $at_check_trace; bison -o calc.c calc.y
64176) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64177at_status=$? at_failed=false
64178$at_check_filter
64179at_fn_diff_devnull "$at_stderr" || at_failed=:
64180at_fn_diff_devnull "$at_stdout" || at_failed=:
64181at_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"
64188at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603"
64189( $at_check_trace; $BISON_C_WORKS
64190) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64191at_status=$? at_failed=false
64192$at_check_filter
64193echo stderr:; cat "$at_stderr"
64194echo stdout:; cat "$at_stdout"
64195at_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"
64201at_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>&-
64204at_status=$? at_failed=false
64205$at_check_filter
64206echo stderr:; cat "$at_stderr"
64207echo stdout:; cat "$at_stdout"
64208at_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"
64223at_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>&-
64234at_status=$? at_failed=false
64235$at_check_filter
64236at_fn_diff_devnull "$at_stderr" || at_failed=:
64237at_fn_diff_devnull "$at_stdout" || at_failed=:
64238at_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.
64245cat >input <<'_ATEOF'
642461 + 2 * 3 = 7
642471 + 2 * -3 = -5
64248
64249-1^2 = -1
64250(-1)^2 = 1
64251
64252---1 = -1
64253
642541 - 2 - 3 = -4
642551 - (2 - 3) = 2
64256
642572^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"
64263at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64264( $at_check_trace;  $PREPARSER ./calc input
64265) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64266at_status=$? at_failed=false
64267$at_check_filter
64268echo stderr:; tee stderr <"$at_stderr"
64269at_fn_diff_devnull "$at_stdout" || at_failed=:
64270at_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"
64276at_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>&-
64279at_status=$? at_failed=false
64280$at_check_filter
64281echo stderr:; tee stderr <"$at_stderr"
64282at_fn_diff_devnull "$at_stdout" || at_failed=:
64283at_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.
64291cat >input <<'_ATEOF'
642921 2
64293_ATEOF
64294
64295{ set +x
64296$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64297at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64298( $at_check_trace;  $PREPARSER ./calc input
64299) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64300at_status=$? at_failed=false
64301$at_check_filter
64302echo stderr:; tee stderr <"$at_stderr"
64303at_fn_diff_devnull "$at_stdout" || at_failed=:
64304at_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"
64310at_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>&-
64313at_status=$? at_failed=false
64314$at_check_filter
64315echo stderr:; tee stderr <"$at_stderr"
64316at_fn_diff_devnull "$at_stdout" || at_failed=:
64317at_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.
64326sed '/^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
64341mv at-stderr stderr
64342# 2. Create the reference error message.
64343cat >expout <<'_ATEOF'
643441.3: syntax error, unexpected number
64345_ATEOF
64346
64347# 3. If locations are not used, remove them.
64348sed 's/^[-0-9.]*: //' expout >at-expout
64349mv at-expout expout
64350# 4. If error-verbose is not used, strip the`, unexpected....' part.
64351sed 's/syntax error, .*$/syntax error/' expout >at-expout
64352mv at-expout expout
64353# 5. Check
64354{ set +x
64355$as_echo "$at_srcdir/calc.at:603: cat stderr"
64356at_fn_check_prepare_trace "calc.at:603"
64357( $at_check_trace; cat stderr
64358) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64359at_status=$? at_failed=false
64360$at_check_filter
64361at_fn_diff_devnull "$at_stderr" || at_failed=:
64362$at_diff expout "$at_stdout" || at_failed=:
64363at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
64364$at_failed && at_fn_log_failure
64365$at_traceon; }
64366
64367
64368cat >input <<'_ATEOF'
643691//2
64370_ATEOF
64371
64372{ set +x
64373$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64374at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64375( $at_check_trace;  $PREPARSER ./calc input
64376) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64377at_status=$? at_failed=false
64378$at_check_filter
64379echo stderr:; tee stderr <"$at_stderr"
64380at_fn_diff_devnull "$at_stdout" || at_failed=:
64381at_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"
64387at_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>&-
64390at_status=$? at_failed=false
64391$at_check_filter
64392echo stderr:; tee stderr <"$at_stderr"
64393at_fn_diff_devnull "$at_stdout" || at_failed=:
64394at_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.
64403sed '/^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
64418mv at-stderr stderr
64419# 2. Create the reference error message.
64420cat >expout <<'_ATEOF'
644211.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
64422_ATEOF
64423
64424# 3. If locations are not used, remove them.
64425sed 's/^[-0-9.]*: //' expout >at-expout
64426mv at-expout expout
64427# 4. If error-verbose is not used, strip the`, unexpected....' part.
64428sed 's/syntax error, .*$/syntax error/' expout >at-expout
64429mv at-expout expout
64430# 5. Check
64431{ set +x
64432$as_echo "$at_srcdir/calc.at:603: cat stderr"
64433at_fn_check_prepare_trace "calc.at:603"
64434( $at_check_trace; cat stderr
64435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64436at_status=$? at_failed=false
64437$at_check_filter
64438at_fn_diff_devnull "$at_stderr" || at_failed=:
64439$at_diff expout "$at_stdout" || at_failed=:
64440at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
64441$at_failed && at_fn_log_failure
64442$at_traceon; }
64443
64444
64445cat >input <<'_ATEOF'
64446error
64447_ATEOF
64448
64449{ set +x
64450$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64451at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64452( $at_check_trace;  $PREPARSER ./calc input
64453) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64454at_status=$? at_failed=false
64455$at_check_filter
64456echo stderr:; tee stderr <"$at_stderr"
64457at_fn_diff_devnull "$at_stdout" || at_failed=:
64458at_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"
64464at_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>&-
64467at_status=$? at_failed=false
64468$at_check_filter
64469echo stderr:; tee stderr <"$at_stderr"
64470at_fn_diff_devnull "$at_stdout" || at_failed=:
64471at_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.
64480sed '/^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
64495mv at-stderr stderr
64496# 2. Create the reference error message.
64497cat >expout <<'_ATEOF'
644981.1: syntax error, unexpected $undefined
64499_ATEOF
64500
64501# 3. If locations are not used, remove them.
64502sed 's/^[-0-9.]*: //' expout >at-expout
64503mv at-expout expout
64504# 4. If error-verbose is not used, strip the`, unexpected....' part.
64505sed 's/syntax error, .*$/syntax error/' expout >at-expout
64506mv at-expout expout
64507# 5. Check
64508{ set +x
64509$as_echo "$at_srcdir/calc.at:603: cat stderr"
64510at_fn_check_prepare_trace "calc.at:603"
64511( $at_check_trace; cat stderr
64512) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64513at_status=$? at_failed=false
64514$at_check_filter
64515at_fn_diff_devnull "$at_stderr" || at_failed=:
64516$at_diff expout "$at_stdout" || at_failed=:
64517at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
64518$at_failed && at_fn_log_failure
64519$at_traceon; }
64520
64521
64522cat >input <<'_ATEOF'
645231 = 2 = 3
64524_ATEOF
64525
64526{ set +x
64527$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64528at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64529( $at_check_trace;  $PREPARSER ./calc input
64530) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64531at_status=$? at_failed=false
64532$at_check_filter
64533echo stderr:; tee stderr <"$at_stderr"
64534at_fn_diff_devnull "$at_stdout" || at_failed=:
64535at_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"
64541at_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>&-
64544at_status=$? at_failed=false
64545$at_check_filter
64546echo stderr:; tee stderr <"$at_stderr"
64547at_fn_diff_devnull "$at_stdout" || at_failed=:
64548at_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.
64557sed '/^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
64572mv at-stderr stderr
64573# 2. Create the reference error message.
64574cat >expout <<'_ATEOF'
645751.7: syntax error, unexpected '='
64576_ATEOF
64577
64578# 3. If locations are not used, remove them.
64579sed 's/^[-0-9.]*: //' expout >at-expout
64580mv at-expout expout
64581# 4. If error-verbose is not used, strip the`, unexpected....' part.
64582sed 's/syntax error, .*$/syntax error/' expout >at-expout
64583mv at-expout expout
64584# 5. Check
64585{ set +x
64586$as_echo "$at_srcdir/calc.at:603: cat stderr"
64587at_fn_check_prepare_trace "calc.at:603"
64588( $at_check_trace; cat stderr
64589) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64590at_status=$? at_failed=false
64591$at_check_filter
64592at_fn_diff_devnull "$at_stderr" || at_failed=:
64593$at_diff expout "$at_stdout" || at_failed=:
64594at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
64595$at_failed && at_fn_log_failure
64596$at_traceon; }
64597
64598
64599cat >input <<'_ATEOF'
64600
64601+1
64602_ATEOF
64603
64604{ set +x
64605$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64606at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64607( $at_check_trace;  $PREPARSER ./calc input
64608) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64609at_status=$? at_failed=false
64610$at_check_filter
64611echo stderr:; tee stderr <"$at_stderr"
64612at_fn_diff_devnull "$at_stdout" || at_failed=:
64613at_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"
64619at_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>&-
64622at_status=$? at_failed=false
64623$at_check_filter
64624echo stderr:; tee stderr <"$at_stderr"
64625at_fn_diff_devnull "$at_stdout" || at_failed=:
64626at_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.
64635sed '/^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
64650mv at-stderr stderr
64651# 2. Create the reference error message.
64652cat >expout <<'_ATEOF'
646532.1: syntax error, unexpected '+'
64654_ATEOF
64655
64656# 3. If locations are not used, remove them.
64657sed 's/^[-0-9.]*: //' expout >at-expout
64658mv at-expout expout
64659# 4. If error-verbose is not used, strip the`, unexpected....' part.
64660sed 's/syntax error, .*$/syntax error/' expout >at-expout
64661mv at-expout expout
64662# 5. Check
64663{ set +x
64664$as_echo "$at_srcdir/calc.at:603: cat stderr"
64665at_fn_check_prepare_trace "calc.at:603"
64666( $at_check_trace; cat stderr
64667) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64668at_status=$? at_failed=false
64669$at_check_filter
64670at_fn_diff_devnull "$at_stderr" || at_failed=:
64671$at_diff expout "$at_stdout" || at_failed=:
64672at_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"
64680at_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>&-
64683at_status=$? at_failed=false
64684$at_check_filter
64685echo stderr:; tee stderr <"$at_stderr"
64686at_fn_diff_devnull "$at_stdout" || at_failed=:
64687at_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"
64693at_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>&-
64696at_status=$? at_failed=false
64697$at_check_filter
64698echo stderr:; tee stderr <"$at_stderr"
64699at_fn_diff_devnull "$at_stdout" || at_failed=:
64700at_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.
64709sed '/^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
64724mv at-stderr stderr
64725# 2. Create the reference error message.
64726cat >expout <<'_ATEOF'
647271.1: syntax error, unexpected end of input
64728_ATEOF
64729
64730# 3. If locations are not used, remove them.
64731sed 's/^[-0-9.]*: //' expout >at-expout
64732mv at-expout expout
64733# 4. If error-verbose is not used, strip the`, unexpected....' part.
64734sed 's/syntax error, .*$/syntax error/' expout >at-expout
64735mv at-expout expout
64736# 5. Check
64737{ set +x
64738$as_echo "$at_srcdir/calc.at:603: cat stderr"
64739at_fn_check_prepare_trace "calc.at:603"
64740( $at_check_trace; cat stderr
64741) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64742at_status=$? at_failed=false
64743$at_check_filter
64744at_fn_diff_devnull "$at_stderr" || at_failed=:
64745$at_diff expout "$at_stdout" || at_failed=:
64746at_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#
64768cat >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"
64774at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64775( $at_check_trace;  $PREPARSER ./calc input
64776) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64777at_status=$? at_failed=false
64778$at_check_filter
64779echo stderr:; tee stderr <"$at_stderr"
64780at_fn_diff_devnull "$at_stdout" || at_failed=:
64781at_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"
64787at_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>&-
64790at_status=$? at_failed=false
64791$at_check_filter
64792echo stderr:; tee stderr <"$at_stderr"
64793at_fn_diff_devnull "$at_stdout" || at_failed=:
64794at_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.
64803sed '/^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
64818mv at-stderr stderr
64819# 2. Create the reference error message.
64820cat >expout <<'_ATEOF'
648211.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
648221.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
648231.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
648241.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
64825calc: error: 4444 != 1
64826_ATEOF
64827
64828# 3. If locations are not used, remove them.
64829sed 's/^[-0-9.]*: //' expout >at-expout
64830mv at-expout expout
64831# 4. If error-verbose is not used, strip the`, unexpected....' part.
64832sed 's/syntax error, .*$/syntax error/' expout >at-expout
64833mv at-expout expout
64834# 5. Check
64835{ set +x
64836$as_echo "$at_srcdir/calc.at:603: cat stderr"
64837at_fn_check_prepare_trace "calc.at:603"
64838( $at_check_trace; cat stderr
64839) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64840at_status=$? at_failed=false
64841$at_check_filter
64842at_fn_diff_devnull "$at_stderr" || at_failed=:
64843$at_diff expout "$at_stdout" || at_failed=:
64844at_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.
64852cat >input <<'_ATEOF'
64853(!) + (1 2) = 1
64854_ATEOF
64855
64856{ set +x
64857$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64858at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64859( $at_check_trace;  $PREPARSER ./calc input
64860) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64861at_status=$? at_failed=false
64862$at_check_filter
64863echo stderr:; tee stderr <"$at_stderr"
64864at_fn_diff_devnull "$at_stdout" || at_failed=:
64865at_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"
64871at_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>&-
64874at_status=$? at_failed=false
64875$at_check_filter
64876echo stderr:; tee stderr <"$at_stderr"
64877at_fn_diff_devnull "$at_stdout" || at_failed=:
64878at_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.
64887sed '/^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
64902mv at-stderr stderr
64903# 2. Create the reference error message.
64904cat >expout <<'_ATEOF'
649051.10: syntax error, unexpected number
64906calc: error: 2222 != 1
64907_ATEOF
64908
64909# 3. If locations are not used, remove them.
64910sed 's/^[-0-9.]*: //' expout >at-expout
64911mv at-expout expout
64912# 4. If error-verbose is not used, strip the`, unexpected....' part.
64913sed 's/syntax error, .*$/syntax error/' expout >at-expout
64914mv at-expout expout
64915# 5. Check
64916{ set +x
64917$as_echo "$at_srcdir/calc.at:603: cat stderr"
64918at_fn_check_prepare_trace "calc.at:603"
64919( $at_check_trace; cat stderr
64920) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64921at_status=$? at_failed=false
64922$at_check_filter
64923at_fn_diff_devnull "$at_stderr" || at_failed=:
64924$at_diff expout "$at_stdout" || at_failed=:
64925at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
64926$at_failed && at_fn_log_failure
64927$at_traceon; }
64928
64929
64930cat >input <<'_ATEOF'
64931(- *) + (1 2) = 1
64932_ATEOF
64933
64934{ set +x
64935$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
64936at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
64937( $at_check_trace;  $PREPARSER ./calc input
64938) >>"$at_stdout" 2>>"$at_stderr" 5>&-
64939at_status=$? at_failed=false
64940$at_check_filter
64941echo stderr:; tee stderr <"$at_stderr"
64942at_fn_diff_devnull "$at_stdout" || at_failed=:
64943at_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"
64949at_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>&-
64952at_status=$? at_failed=false
64953$at_check_filter
64954echo stderr:; tee stderr <"$at_stderr"
64955at_fn_diff_devnull "$at_stdout" || at_failed=:
64956at_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.
64965sed '/^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
64980mv at-stderr stderr
64981# 2. Create the reference error message.
64982cat >expout <<'_ATEOF'
649831.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
649841.12: syntax error, unexpected number
64985calc: error: 2222 != 1
64986_ATEOF
64987
64988# 3. If locations are not used, remove them.
64989sed 's/^[-0-9.]*: //' expout >at-expout
64990mv at-expout expout
64991# 4. If error-verbose is not used, strip the`, unexpected....' part.
64992sed 's/syntax error, .*$/syntax error/' expout >at-expout
64993mv at-expout expout
64994# 5. Check
64995{ set +x
64996$as_echo "$at_srcdir/calc.at:603: cat stderr"
64997at_fn_check_prepare_trace "calc.at:603"
64998( $at_check_trace; cat stderr
64999) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65000at_status=$? at_failed=false
65001$at_check_filter
65002at_fn_diff_devnull "$at_stderr" || at_failed=:
65003$at_diff expout "$at_stdout" || at_failed=:
65004at_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.
65012cat >input <<'_ATEOF'
65013(* *) + (*) + (*)
65014_ATEOF
65015
65016{ set +x
65017$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
65018at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
65019( $at_check_trace;  $PREPARSER ./calc input
65020) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65021at_status=$? at_failed=false
65022$at_check_filter
65023echo stderr:; tee stderr <"$at_stderr"
65024at_fn_diff_devnull "$at_stdout" || at_failed=:
65025at_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"
65031at_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>&-
65034at_status=$? at_failed=false
65035$at_check_filter
65036echo stderr:; tee stderr <"$at_stderr"
65037at_fn_diff_devnull "$at_stdout" || at_failed=:
65038at_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.
65047sed '/^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
65062mv at-stderr stderr
65063# 2. Create the reference error message.
65064cat >expout <<'_ATEOF'
650651.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
650661.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
650671.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
65068_ATEOF
65069
65070# 3. If locations are not used, remove them.
65071sed 's/^[-0-9.]*: //' expout >at-expout
65072mv at-expout expout
65073# 4. If error-verbose is not used, strip the`, unexpected....' part.
65074sed 's/syntax error, .*$/syntax error/' expout >at-expout
65075mv at-expout expout
65076# 5. Check
65077{ set +x
65078$as_echo "$at_srcdir/calc.at:603: cat stderr"
65079at_fn_check_prepare_trace "calc.at:603"
65080( $at_check_trace; cat stderr
65081) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65082at_status=$? at_failed=false
65083$at_check_filter
65084at_fn_diff_devnull "$at_stderr" || at_failed=:
65085$at_diff expout "$at_stdout" || at_failed=:
65086at_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
65097read at_status <"$at_status_file"
65098#AT_STOP_204
65099#AT_START_205
65100at_fn_group_banner 205 'calc.at:604' \
65101  "Calculator %yacc" "                               " 11
65102at_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
65116cat >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
65157FILE *input;
65158static int power (int base, int exponent);
65159
65160static void yyerror ( const char *msg);
65161int 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%%
65179input:
65180  line
65181| input line         {  }
65182;
65183
65184line:
65185  '\n'
65186| exp '\n'           { USE ($1); }
65187;
65188
65189exp:
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
65210static int
65211power (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.  */
65223static
65224void yyerror ( const char *msg)
65225{
65226  fprintf (stderr, "%s\n", msg);
65227}
65228#include <ctype.h>
65229
65230int yylex (void);
65231static int get_char (void);
65232static void unget_char ( int c);
65233
65234
65235static int
65236get_char (void)
65237{
65238  int res = getc (input);
65239  ;
65240
65241  return res;
65242}
65243
65244static void
65245unget_char ( int c)
65246{
65247  ;
65248
65249  ungetc (c, input);
65250}
65251
65252static int
65253read_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
65284int 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
65320semantic_value global_result = 0;
65321int global_count = 0;
65322
65323/* A C main function.  */
65324int
65325main (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
65364if 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"
65372at_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>&-
65376at_status=$? at_failed=false
65377$at_check_filter
65378echo stderr:; cat "$at_stderr"
65379echo stdout:; cat "$at_stdout"
65380at_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"
65386at_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>&-
65389at_status=$? at_failed=false
65390$at_check_filter
65391echo stderr:; cat "$at_stderr"
65392echo stdout:; cat "$at_stdout"
65393at_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"
65402at_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>&-
65407at_status=$? at_failed=false
65408$at_check_filter
65409at_fn_diff_devnull "$at_stderr" || at_failed=:
65410$at_diff expout "$at_stdout" || at_failed=:
65411at_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"
65420at_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>&-
65425at_status=$? at_failed=false
65426$at_check_filter
65427at_fn_diff_devnull "$at_stderr" || at_failed=:
65428$at_diff expout "$at_stdout" || at_failed=:
65429at_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
65435fi
65436{ set +x
65437$as_echo "$at_srcdir/calc.at:604: bison -o calc.c calc.y"
65438at_fn_check_prepare_trace "calc.at:604"
65439( $at_check_trace; bison -o calc.c calc.y
65440) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65441at_status=$? at_failed=false
65442$at_check_filter
65443at_fn_diff_devnull "$at_stderr" || at_failed=:
65444at_fn_diff_devnull "$at_stdout" || at_failed=:
65445at_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"
65452at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604"
65453( $at_check_trace; $BISON_C_WORKS
65454) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65455at_status=$? at_failed=false
65456$at_check_filter
65457echo stderr:; cat "$at_stderr"
65458echo stdout:; cat "$at_stdout"
65459at_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"
65465at_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>&-
65468at_status=$? at_failed=false
65469$at_check_filter
65470echo stderr:; cat "$at_stderr"
65471echo stdout:; cat "$at_stdout"
65472at_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"
65487at_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>&-
65498at_status=$? at_failed=false
65499$at_check_filter
65500at_fn_diff_devnull "$at_stderr" || at_failed=:
65501at_fn_diff_devnull "$at_stdout" || at_failed=:
65502at_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.
65509cat >input <<'_ATEOF'
655101 + 2 * 3 = 7
655111 + 2 * -3 = -5
65512
65513-1^2 = -1
65514(-1)^2 = 1
65515
65516---1 = -1
65517
655181 - 2 - 3 = -4
655191 - (2 - 3) = 2
65520
655212^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"
65527at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65528( $at_check_trace;  $PREPARSER ./calc input
65529) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65530at_status=$? at_failed=false
65531$at_check_filter
65532echo stderr:; tee stderr <"$at_stderr"
65533at_fn_diff_devnull "$at_stdout" || at_failed=:
65534at_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"
65540at_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>&-
65543at_status=$? at_failed=false
65544$at_check_filter
65545echo stderr:; tee stderr <"$at_stderr"
65546at_fn_diff_devnull "$at_stdout" || at_failed=:
65547at_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.
65555cat >input <<'_ATEOF'
655561 2
65557_ATEOF
65558
65559{ set +x
65560$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
65561at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65562( $at_check_trace;  $PREPARSER ./calc input
65563) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65564at_status=$? at_failed=false
65565$at_check_filter
65566echo stderr:; tee stderr <"$at_stderr"
65567at_fn_diff_devnull "$at_stdout" || at_failed=:
65568at_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"
65574at_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>&-
65577at_status=$? at_failed=false
65578$at_check_filter
65579echo stderr:; tee stderr <"$at_stderr"
65580at_fn_diff_devnull "$at_stdout" || at_failed=:
65581at_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.
65590sed '/^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
65605mv at-stderr stderr
65606# 2. Create the reference error message.
65607cat >expout <<'_ATEOF'
656081.3: syntax error, unexpected number
65609_ATEOF
65610
65611# 3. If locations are not used, remove them.
65612sed 's/^[-0-9.]*: //' expout >at-expout
65613mv at-expout expout
65614# 4. If error-verbose is not used, strip the`, unexpected....' part.
65615sed 's/syntax error, .*$/syntax error/' expout >at-expout
65616mv at-expout expout
65617# 5. Check
65618{ set +x
65619$as_echo "$at_srcdir/calc.at:604: cat stderr"
65620at_fn_check_prepare_trace "calc.at:604"
65621( $at_check_trace; cat stderr
65622) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65623at_status=$? at_failed=false
65624$at_check_filter
65625at_fn_diff_devnull "$at_stderr" || at_failed=:
65626$at_diff expout "$at_stdout" || at_failed=:
65627at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
65628$at_failed && at_fn_log_failure
65629$at_traceon; }
65630
65631
65632cat >input <<'_ATEOF'
656331//2
65634_ATEOF
65635
65636{ set +x
65637$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
65638at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65639( $at_check_trace;  $PREPARSER ./calc input
65640) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65641at_status=$? at_failed=false
65642$at_check_filter
65643echo stderr:; tee stderr <"$at_stderr"
65644at_fn_diff_devnull "$at_stdout" || at_failed=:
65645at_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"
65651at_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>&-
65654at_status=$? at_failed=false
65655$at_check_filter
65656echo stderr:; tee stderr <"$at_stderr"
65657at_fn_diff_devnull "$at_stdout" || at_failed=:
65658at_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.
65667sed '/^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
65682mv at-stderr stderr
65683# 2. Create the reference error message.
65684cat >expout <<'_ATEOF'
656851.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
65686_ATEOF
65687
65688# 3. If locations are not used, remove them.
65689sed 's/^[-0-9.]*: //' expout >at-expout
65690mv at-expout expout
65691# 4. If error-verbose is not used, strip the`, unexpected....' part.
65692sed 's/syntax error, .*$/syntax error/' expout >at-expout
65693mv at-expout expout
65694# 5. Check
65695{ set +x
65696$as_echo "$at_srcdir/calc.at:604: cat stderr"
65697at_fn_check_prepare_trace "calc.at:604"
65698( $at_check_trace; cat stderr
65699) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65700at_status=$? at_failed=false
65701$at_check_filter
65702at_fn_diff_devnull "$at_stderr" || at_failed=:
65703$at_diff expout "$at_stdout" || at_failed=:
65704at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
65705$at_failed && at_fn_log_failure
65706$at_traceon; }
65707
65708
65709cat >input <<'_ATEOF'
65710error
65711_ATEOF
65712
65713{ set +x
65714$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
65715at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65716( $at_check_trace;  $PREPARSER ./calc input
65717) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65718at_status=$? at_failed=false
65719$at_check_filter
65720echo stderr:; tee stderr <"$at_stderr"
65721at_fn_diff_devnull "$at_stdout" || at_failed=:
65722at_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"
65728at_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>&-
65731at_status=$? at_failed=false
65732$at_check_filter
65733echo stderr:; tee stderr <"$at_stderr"
65734at_fn_diff_devnull "$at_stdout" || at_failed=:
65735at_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.
65744sed '/^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
65759mv at-stderr stderr
65760# 2. Create the reference error message.
65761cat >expout <<'_ATEOF'
657621.1: syntax error, unexpected $undefined
65763_ATEOF
65764
65765# 3. If locations are not used, remove them.
65766sed 's/^[-0-9.]*: //' expout >at-expout
65767mv at-expout expout
65768# 4. If error-verbose is not used, strip the`, unexpected....' part.
65769sed 's/syntax error, .*$/syntax error/' expout >at-expout
65770mv at-expout expout
65771# 5. Check
65772{ set +x
65773$as_echo "$at_srcdir/calc.at:604: cat stderr"
65774at_fn_check_prepare_trace "calc.at:604"
65775( $at_check_trace; cat stderr
65776) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65777at_status=$? at_failed=false
65778$at_check_filter
65779at_fn_diff_devnull "$at_stderr" || at_failed=:
65780$at_diff expout "$at_stdout" || at_failed=:
65781at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
65782$at_failed && at_fn_log_failure
65783$at_traceon; }
65784
65785
65786cat >input <<'_ATEOF'
657871 = 2 = 3
65788_ATEOF
65789
65790{ set +x
65791$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
65792at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65793( $at_check_trace;  $PREPARSER ./calc input
65794) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65795at_status=$? at_failed=false
65796$at_check_filter
65797echo stderr:; tee stderr <"$at_stderr"
65798at_fn_diff_devnull "$at_stdout" || at_failed=:
65799at_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"
65805at_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>&-
65808at_status=$? at_failed=false
65809$at_check_filter
65810echo stderr:; tee stderr <"$at_stderr"
65811at_fn_diff_devnull "$at_stdout" || at_failed=:
65812at_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.
65821sed '/^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
65836mv at-stderr stderr
65837# 2. Create the reference error message.
65838cat >expout <<'_ATEOF'
658391.7: syntax error, unexpected '='
65840_ATEOF
65841
65842# 3. If locations are not used, remove them.
65843sed 's/^[-0-9.]*: //' expout >at-expout
65844mv at-expout expout
65845# 4. If error-verbose is not used, strip the`, unexpected....' part.
65846sed 's/syntax error, .*$/syntax error/' expout >at-expout
65847mv at-expout expout
65848# 5. Check
65849{ set +x
65850$as_echo "$at_srcdir/calc.at:604: cat stderr"
65851at_fn_check_prepare_trace "calc.at:604"
65852( $at_check_trace; cat stderr
65853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65854at_status=$? at_failed=false
65855$at_check_filter
65856at_fn_diff_devnull "$at_stderr" || at_failed=:
65857$at_diff expout "$at_stdout" || at_failed=:
65858at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
65859$at_failed && at_fn_log_failure
65860$at_traceon; }
65861
65862
65863cat >input <<'_ATEOF'
65864
65865+1
65866_ATEOF
65867
65868{ set +x
65869$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
65870at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
65871( $at_check_trace;  $PREPARSER ./calc input
65872) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65873at_status=$? at_failed=false
65874$at_check_filter
65875echo stderr:; tee stderr <"$at_stderr"
65876at_fn_diff_devnull "$at_stdout" || at_failed=:
65877at_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"
65883at_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>&-
65886at_status=$? at_failed=false
65887$at_check_filter
65888echo stderr:; tee stderr <"$at_stderr"
65889at_fn_diff_devnull "$at_stdout" || at_failed=:
65890at_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.
65899sed '/^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
65914mv at-stderr stderr
65915# 2. Create the reference error message.
65916cat >expout <<'_ATEOF'
659172.1: syntax error, unexpected '+'
65918_ATEOF
65919
65920# 3. If locations are not used, remove them.
65921sed 's/^[-0-9.]*: //' expout >at-expout
65922mv at-expout expout
65923# 4. If error-verbose is not used, strip the`, unexpected....' part.
65924sed 's/syntax error, .*$/syntax error/' expout >at-expout
65925mv at-expout expout
65926# 5. Check
65927{ set +x
65928$as_echo "$at_srcdir/calc.at:604: cat stderr"
65929at_fn_check_prepare_trace "calc.at:604"
65930( $at_check_trace; cat stderr
65931) >>"$at_stdout" 2>>"$at_stderr" 5>&-
65932at_status=$? at_failed=false
65933$at_check_filter
65934at_fn_diff_devnull "$at_stderr" || at_failed=:
65935$at_diff expout "$at_stdout" || at_failed=:
65936at_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"
65944at_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>&-
65947at_status=$? at_failed=false
65948$at_check_filter
65949echo stderr:; tee stderr <"$at_stderr"
65950at_fn_diff_devnull "$at_stdout" || at_failed=:
65951at_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"
65957at_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>&-
65960at_status=$? at_failed=false
65961$at_check_filter
65962echo stderr:; tee stderr <"$at_stderr"
65963at_fn_diff_devnull "$at_stdout" || at_failed=:
65964at_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.
65973sed '/^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
65988mv at-stderr stderr
65989# 2. Create the reference error message.
65990cat >expout <<'_ATEOF'
659911.1: syntax error, unexpected end of input
65992_ATEOF
65993
65994# 3. If locations are not used, remove them.
65995sed 's/^[-0-9.]*: //' expout >at-expout
65996mv at-expout expout
65997# 4. If error-verbose is not used, strip the`, unexpected....' part.
65998sed 's/syntax error, .*$/syntax error/' expout >at-expout
65999mv at-expout expout
66000# 5. Check
66001{ set +x
66002$as_echo "$at_srcdir/calc.at:604: cat stderr"
66003at_fn_check_prepare_trace "calc.at:604"
66004( $at_check_trace; cat stderr
66005) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66006at_status=$? at_failed=false
66007$at_check_filter
66008at_fn_diff_devnull "$at_stderr" || at_failed=:
66009$at_diff expout "$at_stdout" || at_failed=:
66010at_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#
66032cat >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"
66038at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
66039( $at_check_trace;  $PREPARSER ./calc input
66040) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66041at_status=$? at_failed=false
66042$at_check_filter
66043echo stderr:; tee stderr <"$at_stderr"
66044at_fn_diff_devnull "$at_stdout" || at_failed=:
66045at_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"
66051at_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>&-
66054at_status=$? at_failed=false
66055$at_check_filter
66056echo stderr:; tee stderr <"$at_stderr"
66057at_fn_diff_devnull "$at_stdout" || at_failed=:
66058at_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.
66067sed '/^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
66082mv at-stderr stderr
66083# 2. Create the reference error message.
66084cat >expout <<'_ATEOF'
660851.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
660861.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
660871.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
660881.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
66089calc: error: 4444 != 1
66090_ATEOF
66091
66092# 3. If locations are not used, remove them.
66093sed 's/^[-0-9.]*: //' expout >at-expout
66094mv at-expout expout
66095# 4. If error-verbose is not used, strip the`, unexpected....' part.
66096sed 's/syntax error, .*$/syntax error/' expout >at-expout
66097mv at-expout expout
66098# 5. Check
66099{ set +x
66100$as_echo "$at_srcdir/calc.at:604: cat stderr"
66101at_fn_check_prepare_trace "calc.at:604"
66102( $at_check_trace; cat stderr
66103) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66104at_status=$? at_failed=false
66105$at_check_filter
66106at_fn_diff_devnull "$at_stderr" || at_failed=:
66107$at_diff expout "$at_stdout" || at_failed=:
66108at_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.
66116cat >input <<'_ATEOF'
66117(!) + (1 2) = 1
66118_ATEOF
66119
66120{ set +x
66121$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
66122at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
66123( $at_check_trace;  $PREPARSER ./calc input
66124) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66125at_status=$? at_failed=false
66126$at_check_filter
66127echo stderr:; tee stderr <"$at_stderr"
66128at_fn_diff_devnull "$at_stdout" || at_failed=:
66129at_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"
66135at_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>&-
66138at_status=$? at_failed=false
66139$at_check_filter
66140echo stderr:; tee stderr <"$at_stderr"
66141at_fn_diff_devnull "$at_stdout" || at_failed=:
66142at_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.
66151sed '/^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
66166mv at-stderr stderr
66167# 2. Create the reference error message.
66168cat >expout <<'_ATEOF'
661691.10: syntax error, unexpected number
66170calc: error: 2222 != 1
66171_ATEOF
66172
66173# 3. If locations are not used, remove them.
66174sed 's/^[-0-9.]*: //' expout >at-expout
66175mv at-expout expout
66176# 4. If error-verbose is not used, strip the`, unexpected....' part.
66177sed 's/syntax error, .*$/syntax error/' expout >at-expout
66178mv at-expout expout
66179# 5. Check
66180{ set +x
66181$as_echo "$at_srcdir/calc.at:604: cat stderr"
66182at_fn_check_prepare_trace "calc.at:604"
66183( $at_check_trace; cat stderr
66184) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66185at_status=$? at_failed=false
66186$at_check_filter
66187at_fn_diff_devnull "$at_stderr" || at_failed=:
66188$at_diff expout "$at_stdout" || at_failed=:
66189at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
66190$at_failed && at_fn_log_failure
66191$at_traceon; }
66192
66193
66194cat >input <<'_ATEOF'
66195(- *) + (1 2) = 1
66196_ATEOF
66197
66198{ set +x
66199$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
66200at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
66201( $at_check_trace;  $PREPARSER ./calc input
66202) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66203at_status=$? at_failed=false
66204$at_check_filter
66205echo stderr:; tee stderr <"$at_stderr"
66206at_fn_diff_devnull "$at_stdout" || at_failed=:
66207at_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"
66213at_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>&-
66216at_status=$? at_failed=false
66217$at_check_filter
66218echo stderr:; tee stderr <"$at_stderr"
66219at_fn_diff_devnull "$at_stdout" || at_failed=:
66220at_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.
66229sed '/^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
66244mv at-stderr stderr
66245# 2. Create the reference error message.
66246cat >expout <<'_ATEOF'
662471.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
662481.12: syntax error, unexpected number
66249calc: error: 2222 != 1
66250_ATEOF
66251
66252# 3. If locations are not used, remove them.
66253sed 's/^[-0-9.]*: //' expout >at-expout
66254mv at-expout expout
66255# 4. If error-verbose is not used, strip the`, unexpected....' part.
66256sed 's/syntax error, .*$/syntax error/' expout >at-expout
66257mv at-expout expout
66258# 5. Check
66259{ set +x
66260$as_echo "$at_srcdir/calc.at:604: cat stderr"
66261at_fn_check_prepare_trace "calc.at:604"
66262( $at_check_trace; cat stderr
66263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66264at_status=$? at_failed=false
66265$at_check_filter
66266at_fn_diff_devnull "$at_stderr" || at_failed=:
66267$at_diff expout "$at_stdout" || at_failed=:
66268at_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.
66276cat >input <<'_ATEOF'
66277(* *) + (*) + (*)
66278_ATEOF
66279
66280{ set +x
66281$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
66282at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
66283( $at_check_trace;  $PREPARSER ./calc input
66284) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66285at_status=$? at_failed=false
66286$at_check_filter
66287echo stderr:; tee stderr <"$at_stderr"
66288at_fn_diff_devnull "$at_stdout" || at_failed=:
66289at_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"
66295at_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>&-
66298at_status=$? at_failed=false
66299$at_check_filter
66300echo stderr:; tee stderr <"$at_stderr"
66301at_fn_diff_devnull "$at_stdout" || at_failed=:
66302at_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.
66311sed '/^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
66326mv at-stderr stderr
66327# 2. Create the reference error message.
66328cat >expout <<'_ATEOF'
663291.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
663301.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
663311.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
66332_ATEOF
66333
66334# 3. If locations are not used, remove them.
66335sed 's/^[-0-9.]*: //' expout >at-expout
66336mv at-expout expout
66337# 4. If error-verbose is not used, strip the`, unexpected....' part.
66338sed 's/syntax error, .*$/syntax error/' expout >at-expout
66339mv at-expout expout
66340# 5. Check
66341{ set +x
66342$as_echo "$at_srcdir/calc.at:604: cat stderr"
66343at_fn_check_prepare_trace "calc.at:604"
66344( $at_check_trace; cat stderr
66345) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66346at_status=$? at_failed=false
66347$at_check_filter
66348at_fn_diff_devnull "$at_stderr" || at_failed=:
66349$at_diff expout "$at_stdout" || at_failed=:
66350at_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
66361read at_status <"$at_status_file"
66362#AT_STOP_205
66363#AT_START_206
66364at_fn_group_banner 206 'calc.at:605' \
66365  "Calculator %error-verbose" "                      " 11
66366at_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
66380cat >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
66421FILE *input;
66422static int power (int base, int exponent);
66423
66424static void yyerror ( const char *msg);
66425int 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%%
66443input:
66444  line
66445| input line         {  }
66446;
66447
66448line:
66449  '\n'
66450| exp '\n'           { USE ($1); }
66451;
66452
66453exp:
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
66474static int
66475power (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.  */
66487static
66488void yyerror ( const char *msg)
66489{
66490  fprintf (stderr, "%s\n", msg);
66491}
66492#include <ctype.h>
66493
66494int yylex (void);
66495static int get_char (void);
66496static void unget_char ( int c);
66497
66498
66499static int
66500get_char (void)
66501{
66502  int res = getc (input);
66503  ;
66504
66505  return res;
66506}
66507
66508static void
66509unget_char ( int c)
66510{
66511  ;
66512
66513  ungetc (c, input);
66514}
66515
66516static int
66517read_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
66548int 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
66584semantic_value global_result = 0;
66585int global_count = 0;
66586
66587/* A C main function.  */
66588int
66589main (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
66628if 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"
66636at_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>&-
66640at_status=$? at_failed=false
66641$at_check_filter
66642echo stderr:; cat "$at_stderr"
66643echo stdout:; cat "$at_stdout"
66644at_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"
66650at_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>&-
66653at_status=$? at_failed=false
66654$at_check_filter
66655echo stderr:; cat "$at_stderr"
66656echo stdout:; cat "$at_stdout"
66657at_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"
66666at_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>&-
66671at_status=$? at_failed=false
66672$at_check_filter
66673at_fn_diff_devnull "$at_stderr" || at_failed=:
66674$at_diff expout "$at_stdout" || at_failed=:
66675at_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"
66684at_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>&-
66689at_status=$? at_failed=false
66690$at_check_filter
66691at_fn_diff_devnull "$at_stderr" || at_failed=:
66692$at_diff expout "$at_stdout" || at_failed=:
66693at_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
66699fi
66700{ set +x
66701$as_echo "$at_srcdir/calc.at:605: bison -o calc.c calc.y"
66702at_fn_check_prepare_trace "calc.at:605"
66703( $at_check_trace; bison -o calc.c calc.y
66704) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66705at_status=$? at_failed=false
66706$at_check_filter
66707at_fn_diff_devnull "$at_stderr" || at_failed=:
66708at_fn_diff_devnull "$at_stdout" || at_failed=:
66709at_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"
66716at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:605"
66717( $at_check_trace; $BISON_C_WORKS
66718) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66719at_status=$? at_failed=false
66720$at_check_filter
66721echo stderr:; cat "$at_stderr"
66722echo stdout:; cat "$at_stdout"
66723at_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"
66729at_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>&-
66732at_status=$? at_failed=false
66733$at_check_filter
66734echo stderr:; cat "$at_stderr"
66735echo stdout:; cat "$at_stdout"
66736at_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"
66751at_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>&-
66762at_status=$? at_failed=false
66763$at_check_filter
66764at_fn_diff_devnull "$at_stderr" || at_failed=:
66765at_fn_diff_devnull "$at_stdout" || at_failed=:
66766at_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.
66773cat >input <<'_ATEOF'
667741 + 2 * 3 = 7
667751 + 2 * -3 = -5
66776
66777-1^2 = -1
66778(-1)^2 = 1
66779
66780---1 = -1
66781
667821 - 2 - 3 = -4
667831 - (2 - 3) = 2
66784
667852^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"
66791at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
66792( $at_check_trace;  $PREPARSER ./calc input
66793) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66794at_status=$? at_failed=false
66795$at_check_filter
66796echo stderr:; tee stderr <"$at_stderr"
66797at_fn_diff_devnull "$at_stdout" || at_failed=:
66798at_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"
66804at_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>&-
66807at_status=$? at_failed=false
66808$at_check_filter
66809echo stderr:; tee stderr <"$at_stderr"
66810at_fn_diff_devnull "$at_stdout" || at_failed=:
66811at_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.
66819cat >input <<'_ATEOF'
668201 2
66821_ATEOF
66822
66823{ set +x
66824$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
66825at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
66826( $at_check_trace;  $PREPARSER ./calc input
66827) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66828at_status=$? at_failed=false
66829$at_check_filter
66830echo stderr:; tee stderr <"$at_stderr"
66831at_fn_diff_devnull "$at_stdout" || at_failed=:
66832at_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"
66838at_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>&-
66841at_status=$? at_failed=false
66842$at_check_filter
66843echo stderr:; tee stderr <"$at_stderr"
66844at_fn_diff_devnull "$at_stdout" || at_failed=:
66845at_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.
66854sed '/^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
66869mv at-stderr stderr
66870# 2. Create the reference error message.
66871cat >expout <<'_ATEOF'
668721.3: syntax error, unexpected number
66873_ATEOF
66874
66875# 3. If locations are not used, remove them.
66876sed 's/^[-0-9.]*: //' expout >at-expout
66877mv 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"
66883at_fn_check_prepare_trace "calc.at:605"
66884( $at_check_trace; cat stderr
66885) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66886at_status=$? at_failed=false
66887$at_check_filter
66888at_fn_diff_devnull "$at_stderr" || at_failed=:
66889$at_diff expout "$at_stdout" || at_failed=:
66890at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
66891$at_failed && at_fn_log_failure
66892$at_traceon; }
66893
66894
66895cat >input <<'_ATEOF'
668961//2
66897_ATEOF
66898
66899{ set +x
66900$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
66901at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
66902( $at_check_trace;  $PREPARSER ./calc input
66903) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66904at_status=$? at_failed=false
66905$at_check_filter
66906echo stderr:; tee stderr <"$at_stderr"
66907at_fn_diff_devnull "$at_stdout" || at_failed=:
66908at_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"
66914at_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>&-
66917at_status=$? at_failed=false
66918$at_check_filter
66919echo stderr:; tee stderr <"$at_stderr"
66920at_fn_diff_devnull "$at_stdout" || at_failed=:
66921at_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.
66930sed '/^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
66945mv at-stderr stderr
66946# 2. Create the reference error message.
66947cat >expout <<'_ATEOF'
669481.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
66949_ATEOF
66950
66951# 3. If locations are not used, remove them.
66952sed 's/^[-0-9.]*: //' expout >at-expout
66953mv 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"
66959at_fn_check_prepare_trace "calc.at:605"
66960( $at_check_trace; cat stderr
66961) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66962at_status=$? at_failed=false
66963$at_check_filter
66964at_fn_diff_devnull "$at_stderr" || at_failed=:
66965$at_diff expout "$at_stdout" || at_failed=:
66966at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
66967$at_failed && at_fn_log_failure
66968$at_traceon; }
66969
66970
66971cat >input <<'_ATEOF'
66972error
66973_ATEOF
66974
66975{ set +x
66976$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
66977at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
66978( $at_check_trace;  $PREPARSER ./calc input
66979) >>"$at_stdout" 2>>"$at_stderr" 5>&-
66980at_status=$? at_failed=false
66981$at_check_filter
66982echo stderr:; tee stderr <"$at_stderr"
66983at_fn_diff_devnull "$at_stdout" || at_failed=:
66984at_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"
66990at_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>&-
66993at_status=$? at_failed=false
66994$at_check_filter
66995echo stderr:; tee stderr <"$at_stderr"
66996at_fn_diff_devnull "$at_stdout" || at_failed=:
66997at_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.
67006sed '/^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
67021mv at-stderr stderr
67022# 2. Create the reference error message.
67023cat >expout <<'_ATEOF'
670241.1: syntax error, unexpected $undefined
67025_ATEOF
67026
67027# 3. If locations are not used, remove them.
67028sed 's/^[-0-9.]*: //' expout >at-expout
67029mv 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"
67035at_fn_check_prepare_trace "calc.at:605"
67036( $at_check_trace; cat stderr
67037) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67038at_status=$? at_failed=false
67039$at_check_filter
67040at_fn_diff_devnull "$at_stderr" || at_failed=:
67041$at_diff expout "$at_stdout" || at_failed=:
67042at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
67043$at_failed && at_fn_log_failure
67044$at_traceon; }
67045
67046
67047cat >input <<'_ATEOF'
670481 = 2 = 3
67049_ATEOF
67050
67051{ set +x
67052$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
67053at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67054( $at_check_trace;  $PREPARSER ./calc input
67055) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67056at_status=$? at_failed=false
67057$at_check_filter
67058echo stderr:; tee stderr <"$at_stderr"
67059at_fn_diff_devnull "$at_stdout" || at_failed=:
67060at_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"
67066at_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>&-
67069at_status=$? at_failed=false
67070$at_check_filter
67071echo stderr:; tee stderr <"$at_stderr"
67072at_fn_diff_devnull "$at_stdout" || at_failed=:
67073at_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.
67082sed '/^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
67097mv at-stderr stderr
67098# 2. Create the reference error message.
67099cat >expout <<'_ATEOF'
671001.7: syntax error, unexpected '='
67101_ATEOF
67102
67103# 3. If locations are not used, remove them.
67104sed 's/^[-0-9.]*: //' expout >at-expout
67105mv 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"
67111at_fn_check_prepare_trace "calc.at:605"
67112( $at_check_trace; cat stderr
67113) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67114at_status=$? at_failed=false
67115$at_check_filter
67116at_fn_diff_devnull "$at_stderr" || at_failed=:
67117$at_diff expout "$at_stdout" || at_failed=:
67118at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
67119$at_failed && at_fn_log_failure
67120$at_traceon; }
67121
67122
67123cat >input <<'_ATEOF'
67124
67125+1
67126_ATEOF
67127
67128{ set +x
67129$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
67130at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67131( $at_check_trace;  $PREPARSER ./calc input
67132) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67133at_status=$? at_failed=false
67134$at_check_filter
67135echo stderr:; tee stderr <"$at_stderr"
67136at_fn_diff_devnull "$at_stdout" || at_failed=:
67137at_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"
67143at_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>&-
67146at_status=$? at_failed=false
67147$at_check_filter
67148echo stderr:; tee stderr <"$at_stderr"
67149at_fn_diff_devnull "$at_stdout" || at_failed=:
67150at_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.
67159sed '/^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
67174mv at-stderr stderr
67175# 2. Create the reference error message.
67176cat >expout <<'_ATEOF'
671772.1: syntax error, unexpected '+'
67178_ATEOF
67179
67180# 3. If locations are not used, remove them.
67181sed 's/^[-0-9.]*: //' expout >at-expout
67182mv 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"
67188at_fn_check_prepare_trace "calc.at:605"
67189( $at_check_trace; cat stderr
67190) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67191at_status=$? at_failed=false
67192$at_check_filter
67193at_fn_diff_devnull "$at_stderr" || at_failed=:
67194$at_diff expout "$at_stdout" || at_failed=:
67195at_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"
67203at_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>&-
67206at_status=$? at_failed=false
67207$at_check_filter
67208echo stderr:; tee stderr <"$at_stderr"
67209at_fn_diff_devnull "$at_stdout" || at_failed=:
67210at_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"
67216at_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>&-
67219at_status=$? at_failed=false
67220$at_check_filter
67221echo stderr:; tee stderr <"$at_stderr"
67222at_fn_diff_devnull "$at_stdout" || at_failed=:
67223at_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.
67232sed '/^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
67247mv at-stderr stderr
67248# 2. Create the reference error message.
67249cat >expout <<'_ATEOF'
672501.1: syntax error, unexpected end of input
67251_ATEOF
67252
67253# 3. If locations are not used, remove them.
67254sed 's/^[-0-9.]*: //' expout >at-expout
67255mv 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"
67261at_fn_check_prepare_trace "calc.at:605"
67262( $at_check_trace; cat stderr
67263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67264at_status=$? at_failed=false
67265$at_check_filter
67266at_fn_diff_devnull "$at_stderr" || at_failed=:
67267$at_diff expout "$at_stdout" || at_failed=:
67268at_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#
67290cat >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"
67296at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67297( $at_check_trace;  $PREPARSER ./calc input
67298) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67299at_status=$? at_failed=false
67300$at_check_filter
67301echo stderr:; tee stderr <"$at_stderr"
67302at_fn_diff_devnull "$at_stdout" || at_failed=:
67303at_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"
67309at_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>&-
67312at_status=$? at_failed=false
67313$at_check_filter
67314echo stderr:; tee stderr <"$at_stderr"
67315at_fn_diff_devnull "$at_stdout" || at_failed=:
67316at_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.
67325sed '/^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
67340mv at-stderr stderr
67341# 2. Create the reference error message.
67342cat >expout <<'_ATEOF'
673431.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
673441.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
673451.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
673461.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
67347calc: error: 4444 != 1
67348_ATEOF
67349
67350# 3. If locations are not used, remove them.
67351sed 's/^[-0-9.]*: //' expout >at-expout
67352mv 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"
67358at_fn_check_prepare_trace "calc.at:605"
67359( $at_check_trace; cat stderr
67360) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67361at_status=$? at_failed=false
67362$at_check_filter
67363at_fn_diff_devnull "$at_stderr" || at_failed=:
67364$at_diff expout "$at_stdout" || at_failed=:
67365at_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.
67373cat >input <<'_ATEOF'
67374(!) + (1 2) = 1
67375_ATEOF
67376
67377{ set +x
67378$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
67379at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67380( $at_check_trace;  $PREPARSER ./calc input
67381) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67382at_status=$? at_failed=false
67383$at_check_filter
67384echo stderr:; tee stderr <"$at_stderr"
67385at_fn_diff_devnull "$at_stdout" || at_failed=:
67386at_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"
67392at_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>&-
67395at_status=$? at_failed=false
67396$at_check_filter
67397echo stderr:; tee stderr <"$at_stderr"
67398at_fn_diff_devnull "$at_stdout" || at_failed=:
67399at_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.
67408sed '/^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
67423mv at-stderr stderr
67424# 2. Create the reference error message.
67425cat >expout <<'_ATEOF'
674261.10: syntax error, unexpected number
67427calc: error: 2222 != 1
67428_ATEOF
67429
67430# 3. If locations are not used, remove them.
67431sed 's/^[-0-9.]*: //' expout >at-expout
67432mv 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"
67438at_fn_check_prepare_trace "calc.at:605"
67439( $at_check_trace; cat stderr
67440) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67441at_status=$? at_failed=false
67442$at_check_filter
67443at_fn_diff_devnull "$at_stderr" || at_failed=:
67444$at_diff expout "$at_stdout" || at_failed=:
67445at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
67446$at_failed && at_fn_log_failure
67447$at_traceon; }
67448
67449
67450cat >input <<'_ATEOF'
67451(- *) + (1 2) = 1
67452_ATEOF
67453
67454{ set +x
67455$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
67456at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67457( $at_check_trace;  $PREPARSER ./calc input
67458) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67459at_status=$? at_failed=false
67460$at_check_filter
67461echo stderr:; tee stderr <"$at_stderr"
67462at_fn_diff_devnull "$at_stdout" || at_failed=:
67463at_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"
67469at_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>&-
67472at_status=$? at_failed=false
67473$at_check_filter
67474echo stderr:; tee stderr <"$at_stderr"
67475at_fn_diff_devnull "$at_stdout" || at_failed=:
67476at_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.
67485sed '/^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
67500mv at-stderr stderr
67501# 2. Create the reference error message.
67502cat >expout <<'_ATEOF'
675031.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
675041.12: syntax error, unexpected number
67505calc: error: 2222 != 1
67506_ATEOF
67507
67508# 3. If locations are not used, remove them.
67509sed 's/^[-0-9.]*: //' expout >at-expout
67510mv 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"
67516at_fn_check_prepare_trace "calc.at:605"
67517( $at_check_trace; cat stderr
67518) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67519at_status=$? at_failed=false
67520$at_check_filter
67521at_fn_diff_devnull "$at_stderr" || at_failed=:
67522$at_diff expout "$at_stdout" || at_failed=:
67523at_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.
67531cat >input <<'_ATEOF'
67532(* *) + (*) + (*)
67533_ATEOF
67534
67535{ set +x
67536$as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
67537at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
67538( $at_check_trace;  $PREPARSER ./calc input
67539) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67540at_status=$? at_failed=false
67541$at_check_filter
67542echo stderr:; tee stderr <"$at_stderr"
67543at_fn_diff_devnull "$at_stdout" || at_failed=:
67544at_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"
67550at_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>&-
67553at_status=$? at_failed=false
67554$at_check_filter
67555echo stderr:; tee stderr <"$at_stderr"
67556at_fn_diff_devnull "$at_stdout" || at_failed=:
67557at_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.
67566sed '/^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
67581mv at-stderr stderr
67582# 2. Create the reference error message.
67583cat >expout <<'_ATEOF'
675841.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
675851.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
675861.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
67587_ATEOF
67588
67589# 3. If locations are not used, remove them.
67590sed 's/^[-0-9.]*: //' expout >at-expout
67591mv 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"
67597at_fn_check_prepare_trace "calc.at:605"
67598( $at_check_trace; cat stderr
67599) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67600at_status=$? at_failed=false
67601$at_check_filter
67602at_fn_diff_devnull "$at_stderr" || at_failed=:
67603$at_diff expout "$at_stdout" || at_failed=:
67604at_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
67615read at_status <"$at_status_file"
67616#AT_STOP_206
67617#AT_START_207
67618at_fn_group_banner 207 'calc.at:607' \
67619  "Calculator %define api.pure full %locations" "    " 11
67620at_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
67634cat >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
67675FILE *input;
67676static int power (int base, int exponent);
67677
67678static void yyerror (YYLTYPE const * const llocp,  const char *msg);
67679int 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%%
67697input:
67698  line
67699| input line         {  }
67700;
67701
67702line:
67703  '\n'
67704| exp '\n'           { USE ($1); }
67705;
67706
67707exp:
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
67728static int
67729power (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.  */
67741static
67742void 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
67750int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
67751static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
67752static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
67753
67754
67755static YYLTYPE last_yylloc;
67756
67757static int
67758get_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
67775static void
67776unget_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
67786static int
67787read_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
67818int 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
67856semantic_value global_result = 0;
67857int global_count = 0;
67858
67859/* A C main function.  */
67860int
67861main (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
67900if 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"
67908at_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>&-
67912at_status=$? at_failed=false
67913$at_check_filter
67914echo stderr:; cat "$at_stderr"
67915echo stdout:; cat "$at_stdout"
67916at_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"
67922at_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>&-
67925at_status=$? at_failed=false
67926$at_check_filter
67927echo stderr:; cat "$at_stderr"
67928echo stdout:; cat "$at_stdout"
67929at_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"
67938at_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>&-
67943at_status=$? at_failed=false
67944$at_check_filter
67945at_fn_diff_devnull "$at_stderr" || at_failed=:
67946$at_diff expout "$at_stdout" || at_failed=:
67947at_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"
67956at_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>&-
67961at_status=$? at_failed=false
67962$at_check_filter
67963at_fn_diff_devnull "$at_stderr" || at_failed=:
67964$at_diff expout "$at_stdout" || at_failed=:
67965at_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
67971fi
67972{ set +x
67973$as_echo "$at_srcdir/calc.at:607: bison -o calc.c calc.y"
67974at_fn_check_prepare_trace "calc.at:607"
67975( $at_check_trace; bison -o calc.c calc.y
67976) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67977at_status=$? at_failed=false
67978$at_check_filter
67979at_fn_diff_devnull "$at_stderr" || at_failed=:
67980at_fn_diff_devnull "$at_stdout" || at_failed=:
67981at_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"
67988at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607"
67989( $at_check_trace; $BISON_C_WORKS
67990) >>"$at_stdout" 2>>"$at_stderr" 5>&-
67991at_status=$? at_failed=false
67992$at_check_filter
67993echo stderr:; cat "$at_stderr"
67994echo stdout:; cat "$at_stdout"
67995at_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"
68001at_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>&-
68004at_status=$? at_failed=false
68005$at_check_filter
68006echo stderr:; cat "$at_stderr"
68007echo stdout:; cat "$at_stdout"
68008at_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"
68023at_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>&-
68034at_status=$? at_failed=false
68035$at_check_filter
68036at_fn_diff_devnull "$at_stderr" || at_failed=:
68037at_fn_diff_devnull "$at_stdout" || at_failed=:
68038at_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.
68045cat >input <<'_ATEOF'
680461 + 2 * 3 = 7
680471 + 2 * -3 = -5
68048
68049-1^2 = -1
68050(-1)^2 = 1
68051
68052---1 = -1
68053
680541 - 2 - 3 = -4
680551 - (2 - 3) = 2
68056
680572^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"
68063at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68064( $at_check_trace;  $PREPARSER ./calc input
68065) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68066at_status=$? at_failed=false
68067$at_check_filter
68068echo stderr:; tee stderr <"$at_stderr"
68069at_fn_diff_devnull "$at_stdout" || at_failed=:
68070at_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"
68076at_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>&-
68079at_status=$? at_failed=false
68080$at_check_filter
68081echo stderr:; tee stderr <"$at_stderr"
68082at_fn_diff_devnull "$at_stdout" || at_failed=:
68083at_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.
68091cat >input <<'_ATEOF'
680921 2
68093_ATEOF
68094
68095{ set +x
68096$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68097at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68098( $at_check_trace;  $PREPARSER ./calc input
68099) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68100at_status=$? at_failed=false
68101$at_check_filter
68102echo stderr:; tee stderr <"$at_stderr"
68103at_fn_diff_devnull "$at_stdout" || at_failed=:
68104at_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"
68110at_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>&-
68113at_status=$? at_failed=false
68114$at_check_filter
68115echo stderr:; tee stderr <"$at_stderr"
68116at_fn_diff_devnull "$at_stdout" || at_failed=:
68117at_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.
68126sed '/^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
68141mv at-stderr stderr
68142# 2. Create the reference error message.
68143cat >expout <<'_ATEOF'
681441.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.
68150sed 's/syntax error, .*$/syntax error/' expout >at-expout
68151mv at-expout expout
68152# 5. Check
68153{ set +x
68154$as_echo "$at_srcdir/calc.at:607: cat stderr"
68155at_fn_check_prepare_trace "calc.at:607"
68156( $at_check_trace; cat stderr
68157) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68158at_status=$? at_failed=false
68159$at_check_filter
68160at_fn_diff_devnull "$at_stderr" || at_failed=:
68161$at_diff expout "$at_stdout" || at_failed=:
68162at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
68163$at_failed && at_fn_log_failure
68164$at_traceon; }
68165
68166
68167cat >input <<'_ATEOF'
681681//2
68169_ATEOF
68170
68171{ set +x
68172$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68173at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68174( $at_check_trace;  $PREPARSER ./calc input
68175) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68176at_status=$? at_failed=false
68177$at_check_filter
68178echo stderr:; tee stderr <"$at_stderr"
68179at_fn_diff_devnull "$at_stdout" || at_failed=:
68180at_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"
68186at_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>&-
68189at_status=$? at_failed=false
68190$at_check_filter
68191echo stderr:; tee stderr <"$at_stderr"
68192at_fn_diff_devnull "$at_stdout" || at_failed=:
68193at_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.
68202sed '/^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
68217mv at-stderr stderr
68218# 2. Create the reference error message.
68219cat >expout <<'_ATEOF'
682201.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.
68226sed 's/syntax error, .*$/syntax error/' expout >at-expout
68227mv at-expout expout
68228# 5. Check
68229{ set +x
68230$as_echo "$at_srcdir/calc.at:607: cat stderr"
68231at_fn_check_prepare_trace "calc.at:607"
68232( $at_check_trace; cat stderr
68233) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68234at_status=$? at_failed=false
68235$at_check_filter
68236at_fn_diff_devnull "$at_stderr" || at_failed=:
68237$at_diff expout "$at_stdout" || at_failed=:
68238at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
68239$at_failed && at_fn_log_failure
68240$at_traceon; }
68241
68242
68243cat >input <<'_ATEOF'
68244error
68245_ATEOF
68246
68247{ set +x
68248$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68249at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68250( $at_check_trace;  $PREPARSER ./calc input
68251) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68252at_status=$? at_failed=false
68253$at_check_filter
68254echo stderr:; tee stderr <"$at_stderr"
68255at_fn_diff_devnull "$at_stdout" || at_failed=:
68256at_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"
68262at_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>&-
68265at_status=$? at_failed=false
68266$at_check_filter
68267echo stderr:; tee stderr <"$at_stderr"
68268at_fn_diff_devnull "$at_stdout" || at_failed=:
68269at_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.
68278sed '/^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
68293mv at-stderr stderr
68294# 2. Create the reference error message.
68295cat >expout <<'_ATEOF'
682961.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.
68302sed 's/syntax error, .*$/syntax error/' expout >at-expout
68303mv at-expout expout
68304# 5. Check
68305{ set +x
68306$as_echo "$at_srcdir/calc.at:607: cat stderr"
68307at_fn_check_prepare_trace "calc.at:607"
68308( $at_check_trace; cat stderr
68309) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68310at_status=$? at_failed=false
68311$at_check_filter
68312at_fn_diff_devnull "$at_stderr" || at_failed=:
68313$at_diff expout "$at_stdout" || at_failed=:
68314at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
68315$at_failed && at_fn_log_failure
68316$at_traceon; }
68317
68318
68319cat >input <<'_ATEOF'
683201 = 2 = 3
68321_ATEOF
68322
68323{ set +x
68324$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68325at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68326( $at_check_trace;  $PREPARSER ./calc input
68327) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68328at_status=$? at_failed=false
68329$at_check_filter
68330echo stderr:; tee stderr <"$at_stderr"
68331at_fn_diff_devnull "$at_stdout" || at_failed=:
68332at_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"
68338at_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>&-
68341at_status=$? at_failed=false
68342$at_check_filter
68343echo stderr:; tee stderr <"$at_stderr"
68344at_fn_diff_devnull "$at_stdout" || at_failed=:
68345at_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.
68354sed '/^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
68369mv at-stderr stderr
68370# 2. Create the reference error message.
68371cat >expout <<'_ATEOF'
683721.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.
68378sed 's/syntax error, .*$/syntax error/' expout >at-expout
68379mv at-expout expout
68380# 5. Check
68381{ set +x
68382$as_echo "$at_srcdir/calc.at:607: cat stderr"
68383at_fn_check_prepare_trace "calc.at:607"
68384( $at_check_trace; cat stderr
68385) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68386at_status=$? at_failed=false
68387$at_check_filter
68388at_fn_diff_devnull "$at_stderr" || at_failed=:
68389$at_diff expout "$at_stdout" || at_failed=:
68390at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
68391$at_failed && at_fn_log_failure
68392$at_traceon; }
68393
68394
68395cat >input <<'_ATEOF'
68396
68397+1
68398_ATEOF
68399
68400{ set +x
68401$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68402at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68403( $at_check_trace;  $PREPARSER ./calc input
68404) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68405at_status=$? at_failed=false
68406$at_check_filter
68407echo stderr:; tee stderr <"$at_stderr"
68408at_fn_diff_devnull "$at_stdout" || at_failed=:
68409at_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"
68415at_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>&-
68418at_status=$? at_failed=false
68419$at_check_filter
68420echo stderr:; tee stderr <"$at_stderr"
68421at_fn_diff_devnull "$at_stdout" || at_failed=:
68422at_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.
68431sed '/^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
68446mv at-stderr stderr
68447# 2. Create the reference error message.
68448cat >expout <<'_ATEOF'
684492.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.
68455sed 's/syntax error, .*$/syntax error/' expout >at-expout
68456mv at-expout expout
68457# 5. Check
68458{ set +x
68459$as_echo "$at_srcdir/calc.at:607: cat stderr"
68460at_fn_check_prepare_trace "calc.at:607"
68461( $at_check_trace; cat stderr
68462) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68463at_status=$? at_failed=false
68464$at_check_filter
68465at_fn_diff_devnull "$at_stderr" || at_failed=:
68466$at_diff expout "$at_stdout" || at_failed=:
68467at_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"
68475at_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>&-
68478at_status=$? at_failed=false
68479$at_check_filter
68480echo stderr:; tee stderr <"$at_stderr"
68481at_fn_diff_devnull "$at_stdout" || at_failed=:
68482at_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"
68488at_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>&-
68491at_status=$? at_failed=false
68492$at_check_filter
68493echo stderr:; tee stderr <"$at_stderr"
68494at_fn_diff_devnull "$at_stdout" || at_failed=:
68495at_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.
68504sed '/^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
68519mv at-stderr stderr
68520# 2. Create the reference error message.
68521cat >expout <<'_ATEOF'
685221.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.
68528sed 's/syntax error, .*$/syntax error/' expout >at-expout
68529mv at-expout expout
68530# 5. Check
68531{ set +x
68532$as_echo "$at_srcdir/calc.at:607: cat stderr"
68533at_fn_check_prepare_trace "calc.at:607"
68534( $at_check_trace; cat stderr
68535) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68536at_status=$? at_failed=false
68537$at_check_filter
68538at_fn_diff_devnull "$at_stderr" || at_failed=:
68539$at_diff expout "$at_stdout" || at_failed=:
68540at_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#
68562cat >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"
68568at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68569( $at_check_trace;  $PREPARSER ./calc input
68570) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68571at_status=$? at_failed=false
68572$at_check_filter
68573echo stderr:; tee stderr <"$at_stderr"
68574at_fn_diff_devnull "$at_stdout" || at_failed=:
68575at_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"
68581at_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>&-
68584at_status=$? at_failed=false
68585$at_check_filter
68586echo stderr:; tee stderr <"$at_stderr"
68587at_fn_diff_devnull "$at_stdout" || at_failed=:
68588at_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.
68597sed '/^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
68612mv at-stderr stderr
68613# 2. Create the reference error message.
68614cat >expout <<'_ATEOF'
686151.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
686161.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
686171.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
686181.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
68619calc: 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.
68625sed 's/syntax error, .*$/syntax error/' expout >at-expout
68626mv at-expout expout
68627# 5. Check
68628{ set +x
68629$as_echo "$at_srcdir/calc.at:607: cat stderr"
68630at_fn_check_prepare_trace "calc.at:607"
68631( $at_check_trace; cat stderr
68632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68633at_status=$? at_failed=false
68634$at_check_filter
68635at_fn_diff_devnull "$at_stderr" || at_failed=:
68636$at_diff expout "$at_stdout" || at_failed=:
68637at_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.
68645cat >input <<'_ATEOF'
68646(!) + (1 2) = 1
68647_ATEOF
68648
68649{ set +x
68650$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68651at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68652( $at_check_trace;  $PREPARSER ./calc input
68653) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68654at_status=$? at_failed=false
68655$at_check_filter
68656echo stderr:; tee stderr <"$at_stderr"
68657at_fn_diff_devnull "$at_stdout" || at_failed=:
68658at_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"
68664at_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>&-
68667at_status=$? at_failed=false
68668$at_check_filter
68669echo stderr:; tee stderr <"$at_stderr"
68670at_fn_diff_devnull "$at_stdout" || at_failed=:
68671at_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.
68680sed '/^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
68695mv at-stderr stderr
68696# 2. Create the reference error message.
68697cat >expout <<'_ATEOF'
686981.10: syntax error, unexpected number
68699calc: 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.
68705sed 's/syntax error, .*$/syntax error/' expout >at-expout
68706mv at-expout expout
68707# 5. Check
68708{ set +x
68709$as_echo "$at_srcdir/calc.at:607: cat stderr"
68710at_fn_check_prepare_trace "calc.at:607"
68711( $at_check_trace; cat stderr
68712) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68713at_status=$? at_failed=false
68714$at_check_filter
68715at_fn_diff_devnull "$at_stderr" || at_failed=:
68716$at_diff expout "$at_stdout" || at_failed=:
68717at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
68718$at_failed && at_fn_log_failure
68719$at_traceon; }
68720
68721
68722cat >input <<'_ATEOF'
68723(- *) + (1 2) = 1
68724_ATEOF
68725
68726{ set +x
68727$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68728at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68729( $at_check_trace;  $PREPARSER ./calc input
68730) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68731at_status=$? at_failed=false
68732$at_check_filter
68733echo stderr:; tee stderr <"$at_stderr"
68734at_fn_diff_devnull "$at_stdout" || at_failed=:
68735at_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"
68741at_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>&-
68744at_status=$? at_failed=false
68745$at_check_filter
68746echo stderr:; tee stderr <"$at_stderr"
68747at_fn_diff_devnull "$at_stdout" || at_failed=:
68748at_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.
68757sed '/^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
68772mv at-stderr stderr
68773# 2. Create the reference error message.
68774cat >expout <<'_ATEOF'
687751.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
687761.12: syntax error, unexpected number
68777calc: 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.
68783sed 's/syntax error, .*$/syntax error/' expout >at-expout
68784mv at-expout expout
68785# 5. Check
68786{ set +x
68787$as_echo "$at_srcdir/calc.at:607: cat stderr"
68788at_fn_check_prepare_trace "calc.at:607"
68789( $at_check_trace; cat stderr
68790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68791at_status=$? at_failed=false
68792$at_check_filter
68793at_fn_diff_devnull "$at_stderr" || at_failed=:
68794$at_diff expout "$at_stdout" || at_failed=:
68795at_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.
68803cat >input <<'_ATEOF'
68804(* *) + (*) + (*)
68805_ATEOF
68806
68807{ set +x
68808$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
68809at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
68810( $at_check_trace;  $PREPARSER ./calc input
68811) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68812at_status=$? at_failed=false
68813$at_check_filter
68814echo stderr:; tee stderr <"$at_stderr"
68815at_fn_diff_devnull "$at_stdout" || at_failed=:
68816at_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"
68822at_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>&-
68825at_status=$? at_failed=false
68826$at_check_filter
68827echo stderr:; tee stderr <"$at_stderr"
68828at_fn_diff_devnull "$at_stdout" || at_failed=:
68829at_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.
68838sed '/^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
68853mv at-stderr stderr
68854# 2. Create the reference error message.
68855cat >expout <<'_ATEOF'
688561.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
688571.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
688581.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.
68864sed 's/syntax error, .*$/syntax error/' expout >at-expout
68865mv at-expout expout
68866# 5. Check
68867{ set +x
68868$as_echo "$at_srcdir/calc.at:607: cat stderr"
68869at_fn_check_prepare_trace "calc.at:607"
68870( $at_check_trace; cat stderr
68871) >>"$at_stdout" 2>>"$at_stderr" 5>&-
68872at_status=$? at_failed=false
68873$at_check_filter
68874at_fn_diff_devnull "$at_stderr" || at_failed=:
68875$at_diff expout "$at_stdout" || at_failed=:
68876at_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
68887read at_status <"$at_status_file"
68888#AT_STOP_207
68889#AT_START_208
68890at_fn_group_banner 208 'calc.at:608' \
68891  "Calculator %define api.push-pull both %define api.pure full %locations" "" 11
68892at_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
68906cat >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
68947FILE *input;
68948static int power (int base, int exponent);
68949
68950static void yyerror (YYLTYPE const * const llocp,  const char *msg);
68951int 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%%
68969input:
68970  line
68971| input line         {  }
68972;
68973
68974line:
68975  '\n'
68976| exp '\n'           { USE ($1); }
68977;
68978
68979exp:
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
69000static int
69001power (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.  */
69013static
69014void 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
69022int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
69023static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
69024static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
69025
69026
69027static YYLTYPE last_yylloc;
69028
69029static int
69030get_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
69047static void
69048unget_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
69058static int
69059read_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
69090int 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
69128semantic_value global_result = 0;
69129int global_count = 0;
69130
69131/* A C main function.  */
69132int
69133main (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
69172if 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"
69180at_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>&-
69184at_status=$? at_failed=false
69185$at_check_filter
69186echo stderr:; cat "$at_stderr"
69187echo stdout:; cat "$at_stdout"
69188at_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"
69194at_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>&-
69197at_status=$? at_failed=false
69198$at_check_filter
69199echo stderr:; cat "$at_stderr"
69200echo stdout:; cat "$at_stdout"
69201at_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"
69210at_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>&-
69215at_status=$? at_failed=false
69216$at_check_filter
69217at_fn_diff_devnull "$at_stderr" || at_failed=:
69218$at_diff expout "$at_stdout" || at_failed=:
69219at_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"
69228at_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>&-
69233at_status=$? at_failed=false
69234$at_check_filter
69235at_fn_diff_devnull "$at_stderr" || at_failed=:
69236$at_diff expout "$at_stdout" || at_failed=:
69237at_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
69243fi
69244{ set +x
69245$as_echo "$at_srcdir/calc.at:608: bison -o calc.c calc.y"
69246at_fn_check_prepare_trace "calc.at:608"
69247( $at_check_trace; bison -o calc.c calc.y
69248) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69249at_status=$? at_failed=false
69250$at_check_filter
69251at_fn_diff_devnull "$at_stderr" || at_failed=:
69252at_fn_diff_devnull "$at_stdout" || at_failed=:
69253at_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"
69260at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608"
69261( $at_check_trace; $BISON_C_WORKS
69262) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69263at_status=$? at_failed=false
69264$at_check_filter
69265echo stderr:; cat "$at_stderr"
69266echo stdout:; cat "$at_stdout"
69267at_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"
69273at_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>&-
69276at_status=$? at_failed=false
69277$at_check_filter
69278echo stderr:; cat "$at_stderr"
69279echo stdout:; cat "$at_stdout"
69280at_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"
69295at_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>&-
69306at_status=$? at_failed=false
69307$at_check_filter
69308at_fn_diff_devnull "$at_stderr" || at_failed=:
69309at_fn_diff_devnull "$at_stdout" || at_failed=:
69310at_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.
69317cat >input <<'_ATEOF'
693181 + 2 * 3 = 7
693191 + 2 * -3 = -5
69320
69321-1^2 = -1
69322(-1)^2 = 1
69323
69324---1 = -1
69325
693261 - 2 - 3 = -4
693271 - (2 - 3) = 2
69328
693292^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"
69335at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69336( $at_check_trace;  $PREPARSER ./calc input
69337) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69338at_status=$? at_failed=false
69339$at_check_filter
69340echo stderr:; tee stderr <"$at_stderr"
69341at_fn_diff_devnull "$at_stdout" || at_failed=:
69342at_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"
69348at_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>&-
69351at_status=$? at_failed=false
69352$at_check_filter
69353echo stderr:; tee stderr <"$at_stderr"
69354at_fn_diff_devnull "$at_stdout" || at_failed=:
69355at_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.
69363cat >input <<'_ATEOF'
693641 2
69365_ATEOF
69366
69367{ set +x
69368$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69369at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69370( $at_check_trace;  $PREPARSER ./calc input
69371) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69372at_status=$? at_failed=false
69373$at_check_filter
69374echo stderr:; tee stderr <"$at_stderr"
69375at_fn_diff_devnull "$at_stdout" || at_failed=:
69376at_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"
69382at_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>&-
69385at_status=$? at_failed=false
69386$at_check_filter
69387echo stderr:; tee stderr <"$at_stderr"
69388at_fn_diff_devnull "$at_stdout" || at_failed=:
69389at_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.
69398sed '/^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
69413mv at-stderr stderr
69414# 2. Create the reference error message.
69415cat >expout <<'_ATEOF'
694161.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.
69422sed 's/syntax error, .*$/syntax error/' expout >at-expout
69423mv at-expout expout
69424# 5. Check
69425{ set +x
69426$as_echo "$at_srcdir/calc.at:608: cat stderr"
69427at_fn_check_prepare_trace "calc.at:608"
69428( $at_check_trace; cat stderr
69429) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69430at_status=$? at_failed=false
69431$at_check_filter
69432at_fn_diff_devnull "$at_stderr" || at_failed=:
69433$at_diff expout "$at_stdout" || at_failed=:
69434at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
69435$at_failed && at_fn_log_failure
69436$at_traceon; }
69437
69438
69439cat >input <<'_ATEOF'
694401//2
69441_ATEOF
69442
69443{ set +x
69444$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69445at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69446( $at_check_trace;  $PREPARSER ./calc input
69447) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69448at_status=$? at_failed=false
69449$at_check_filter
69450echo stderr:; tee stderr <"$at_stderr"
69451at_fn_diff_devnull "$at_stdout" || at_failed=:
69452at_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"
69458at_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>&-
69461at_status=$? at_failed=false
69462$at_check_filter
69463echo stderr:; tee stderr <"$at_stderr"
69464at_fn_diff_devnull "$at_stdout" || at_failed=:
69465at_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.
69474sed '/^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
69489mv at-stderr stderr
69490# 2. Create the reference error message.
69491cat >expout <<'_ATEOF'
694921.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.
69498sed 's/syntax error, .*$/syntax error/' expout >at-expout
69499mv at-expout expout
69500# 5. Check
69501{ set +x
69502$as_echo "$at_srcdir/calc.at:608: cat stderr"
69503at_fn_check_prepare_trace "calc.at:608"
69504( $at_check_trace; cat stderr
69505) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69506at_status=$? at_failed=false
69507$at_check_filter
69508at_fn_diff_devnull "$at_stderr" || at_failed=:
69509$at_diff expout "$at_stdout" || at_failed=:
69510at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
69511$at_failed && at_fn_log_failure
69512$at_traceon; }
69513
69514
69515cat >input <<'_ATEOF'
69516error
69517_ATEOF
69518
69519{ set +x
69520$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69521at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69522( $at_check_trace;  $PREPARSER ./calc input
69523) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69524at_status=$? at_failed=false
69525$at_check_filter
69526echo stderr:; tee stderr <"$at_stderr"
69527at_fn_diff_devnull "$at_stdout" || at_failed=:
69528at_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"
69534at_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>&-
69537at_status=$? at_failed=false
69538$at_check_filter
69539echo stderr:; tee stderr <"$at_stderr"
69540at_fn_diff_devnull "$at_stdout" || at_failed=:
69541at_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.
69550sed '/^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
69565mv at-stderr stderr
69566# 2. Create the reference error message.
69567cat >expout <<'_ATEOF'
695681.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.
69574sed 's/syntax error, .*$/syntax error/' expout >at-expout
69575mv at-expout expout
69576# 5. Check
69577{ set +x
69578$as_echo "$at_srcdir/calc.at:608: cat stderr"
69579at_fn_check_prepare_trace "calc.at:608"
69580( $at_check_trace; cat stderr
69581) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69582at_status=$? at_failed=false
69583$at_check_filter
69584at_fn_diff_devnull "$at_stderr" || at_failed=:
69585$at_diff expout "$at_stdout" || at_failed=:
69586at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
69587$at_failed && at_fn_log_failure
69588$at_traceon; }
69589
69590
69591cat >input <<'_ATEOF'
695921 = 2 = 3
69593_ATEOF
69594
69595{ set +x
69596$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69597at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69598( $at_check_trace;  $PREPARSER ./calc input
69599) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69600at_status=$? at_failed=false
69601$at_check_filter
69602echo stderr:; tee stderr <"$at_stderr"
69603at_fn_diff_devnull "$at_stdout" || at_failed=:
69604at_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"
69610at_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>&-
69613at_status=$? at_failed=false
69614$at_check_filter
69615echo stderr:; tee stderr <"$at_stderr"
69616at_fn_diff_devnull "$at_stdout" || at_failed=:
69617at_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.
69626sed '/^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
69641mv at-stderr stderr
69642# 2. Create the reference error message.
69643cat >expout <<'_ATEOF'
696441.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.
69650sed 's/syntax error, .*$/syntax error/' expout >at-expout
69651mv at-expout expout
69652# 5. Check
69653{ set +x
69654$as_echo "$at_srcdir/calc.at:608: cat stderr"
69655at_fn_check_prepare_trace "calc.at:608"
69656( $at_check_trace; cat stderr
69657) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69658at_status=$? at_failed=false
69659$at_check_filter
69660at_fn_diff_devnull "$at_stderr" || at_failed=:
69661$at_diff expout "$at_stdout" || at_failed=:
69662at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
69663$at_failed && at_fn_log_failure
69664$at_traceon; }
69665
69666
69667cat >input <<'_ATEOF'
69668
69669+1
69670_ATEOF
69671
69672{ set +x
69673$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69674at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69675( $at_check_trace;  $PREPARSER ./calc input
69676) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69677at_status=$? at_failed=false
69678$at_check_filter
69679echo stderr:; tee stderr <"$at_stderr"
69680at_fn_diff_devnull "$at_stdout" || at_failed=:
69681at_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"
69687at_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>&-
69690at_status=$? at_failed=false
69691$at_check_filter
69692echo stderr:; tee stderr <"$at_stderr"
69693at_fn_diff_devnull "$at_stdout" || at_failed=:
69694at_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.
69703sed '/^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
69718mv at-stderr stderr
69719# 2. Create the reference error message.
69720cat >expout <<'_ATEOF'
697212.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.
69727sed 's/syntax error, .*$/syntax error/' expout >at-expout
69728mv at-expout expout
69729# 5. Check
69730{ set +x
69731$as_echo "$at_srcdir/calc.at:608: cat stderr"
69732at_fn_check_prepare_trace "calc.at:608"
69733( $at_check_trace; cat stderr
69734) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69735at_status=$? at_failed=false
69736$at_check_filter
69737at_fn_diff_devnull "$at_stderr" || at_failed=:
69738$at_diff expout "$at_stdout" || at_failed=:
69739at_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"
69747at_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>&-
69750at_status=$? at_failed=false
69751$at_check_filter
69752echo stderr:; tee stderr <"$at_stderr"
69753at_fn_diff_devnull "$at_stdout" || at_failed=:
69754at_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"
69760at_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>&-
69763at_status=$? at_failed=false
69764$at_check_filter
69765echo stderr:; tee stderr <"$at_stderr"
69766at_fn_diff_devnull "$at_stdout" || at_failed=:
69767at_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.
69776sed '/^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
69791mv at-stderr stderr
69792# 2. Create the reference error message.
69793cat >expout <<'_ATEOF'
697941.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.
69800sed 's/syntax error, .*$/syntax error/' expout >at-expout
69801mv at-expout expout
69802# 5. Check
69803{ set +x
69804$as_echo "$at_srcdir/calc.at:608: cat stderr"
69805at_fn_check_prepare_trace "calc.at:608"
69806( $at_check_trace; cat stderr
69807) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69808at_status=$? at_failed=false
69809$at_check_filter
69810at_fn_diff_devnull "$at_stderr" || at_failed=:
69811$at_diff expout "$at_stdout" || at_failed=:
69812at_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#
69834cat >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"
69840at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69841( $at_check_trace;  $PREPARSER ./calc input
69842) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69843at_status=$? at_failed=false
69844$at_check_filter
69845echo stderr:; tee stderr <"$at_stderr"
69846at_fn_diff_devnull "$at_stdout" || at_failed=:
69847at_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"
69853at_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>&-
69856at_status=$? at_failed=false
69857$at_check_filter
69858echo stderr:; tee stderr <"$at_stderr"
69859at_fn_diff_devnull "$at_stdout" || at_failed=:
69860at_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.
69869sed '/^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
69884mv at-stderr stderr
69885# 2. Create the reference error message.
69886cat >expout <<'_ATEOF'
698871.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
698881.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
698891.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
698901.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
69891calc: 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.
69897sed 's/syntax error, .*$/syntax error/' expout >at-expout
69898mv at-expout expout
69899# 5. Check
69900{ set +x
69901$as_echo "$at_srcdir/calc.at:608: cat stderr"
69902at_fn_check_prepare_trace "calc.at:608"
69903( $at_check_trace; cat stderr
69904) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69905at_status=$? at_failed=false
69906$at_check_filter
69907at_fn_diff_devnull "$at_stderr" || at_failed=:
69908$at_diff expout "$at_stdout" || at_failed=:
69909at_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.
69917cat >input <<'_ATEOF'
69918(!) + (1 2) = 1
69919_ATEOF
69920
69921{ set +x
69922$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
69923at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
69924( $at_check_trace;  $PREPARSER ./calc input
69925) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69926at_status=$? at_failed=false
69927$at_check_filter
69928echo stderr:; tee stderr <"$at_stderr"
69929at_fn_diff_devnull "$at_stdout" || at_failed=:
69930at_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"
69936at_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>&-
69939at_status=$? at_failed=false
69940$at_check_filter
69941echo stderr:; tee stderr <"$at_stderr"
69942at_fn_diff_devnull "$at_stdout" || at_failed=:
69943at_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.
69952sed '/^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
69967mv at-stderr stderr
69968# 2. Create the reference error message.
69969cat >expout <<'_ATEOF'
699701.10: syntax error, unexpected number
69971calc: 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.
69977sed 's/syntax error, .*$/syntax error/' expout >at-expout
69978mv at-expout expout
69979# 5. Check
69980{ set +x
69981$as_echo "$at_srcdir/calc.at:608: cat stderr"
69982at_fn_check_prepare_trace "calc.at:608"
69983( $at_check_trace; cat stderr
69984) >>"$at_stdout" 2>>"$at_stderr" 5>&-
69985at_status=$? at_failed=false
69986$at_check_filter
69987at_fn_diff_devnull "$at_stderr" || at_failed=:
69988$at_diff expout "$at_stdout" || at_failed=:
69989at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
69990$at_failed && at_fn_log_failure
69991$at_traceon; }
69992
69993
69994cat >input <<'_ATEOF'
69995(- *) + (1 2) = 1
69996_ATEOF
69997
69998{ set +x
69999$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
70000at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
70001( $at_check_trace;  $PREPARSER ./calc input
70002) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70003at_status=$? at_failed=false
70004$at_check_filter
70005echo stderr:; tee stderr <"$at_stderr"
70006at_fn_diff_devnull "$at_stdout" || at_failed=:
70007at_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"
70013at_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>&-
70016at_status=$? at_failed=false
70017$at_check_filter
70018echo stderr:; tee stderr <"$at_stderr"
70019at_fn_diff_devnull "$at_stdout" || at_failed=:
70020at_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.
70029sed '/^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
70044mv at-stderr stderr
70045# 2. Create the reference error message.
70046cat >expout <<'_ATEOF'
700471.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
700481.12: syntax error, unexpected number
70049calc: 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.
70055sed 's/syntax error, .*$/syntax error/' expout >at-expout
70056mv at-expout expout
70057# 5. Check
70058{ set +x
70059$as_echo "$at_srcdir/calc.at:608: cat stderr"
70060at_fn_check_prepare_trace "calc.at:608"
70061( $at_check_trace; cat stderr
70062) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70063at_status=$? at_failed=false
70064$at_check_filter
70065at_fn_diff_devnull "$at_stderr" || at_failed=:
70066$at_diff expout "$at_stdout" || at_failed=:
70067at_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.
70075cat >input <<'_ATEOF'
70076(* *) + (*) + (*)
70077_ATEOF
70078
70079{ set +x
70080$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
70081at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
70082( $at_check_trace;  $PREPARSER ./calc input
70083) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70084at_status=$? at_failed=false
70085$at_check_filter
70086echo stderr:; tee stderr <"$at_stderr"
70087at_fn_diff_devnull "$at_stdout" || at_failed=:
70088at_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"
70094at_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>&-
70097at_status=$? at_failed=false
70098$at_check_filter
70099echo stderr:; tee stderr <"$at_stderr"
70100at_fn_diff_devnull "$at_stdout" || at_failed=:
70101at_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.
70110sed '/^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
70125mv at-stderr stderr
70126# 2. Create the reference error message.
70127cat >expout <<'_ATEOF'
701281.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
701291.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
701301.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.
70136sed 's/syntax error, .*$/syntax error/' expout >at-expout
70137mv at-expout expout
70138# 5. Check
70139{ set +x
70140$as_echo "$at_srcdir/calc.at:608: cat stderr"
70141at_fn_check_prepare_trace "calc.at:608"
70142( $at_check_trace; cat stderr
70143) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70144at_status=$? at_failed=false
70145$at_check_filter
70146at_fn_diff_devnull "$at_stderr" || at_failed=:
70147$at_diff expout "$at_stdout" || at_failed=:
70148at_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
70159read at_status <"$at_status_file"
70160#AT_STOP_208
70161#AT_START_209
70162at_fn_group_banner 209 'calc.at:609' \
70163  "Calculator %error-verbose %locations" "           " 11
70164at_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
70178cat >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
70219FILE *input;
70220static int power (int base, int exponent);
70221
70222static void yyerror ( const char *msg);
70223int 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%%
70241input:
70242  line
70243| input line         {  }
70244;
70245
70246line:
70247  '\n'
70248| exp '\n'           { USE ($1); }
70249;
70250
70251exp:
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
70272static int
70273power (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.  */
70285static
70286void 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
70294int yylex (void);
70295static int get_char (void);
70296static void unget_char ( int c);
70297
70298
70299static YYLTYPE last_yylloc;
70300
70301static int
70302get_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
70319static void
70320unget_char ( int c)
70321{
70322  ;
70323
70324  /* Wrong when C == `\n'. */
70325  (yylloc) = last_yylloc;
70326
70327  ungetc (c, input);
70328}
70329
70330static int
70331read_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
70362int 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
70400semantic_value global_result = 0;
70401int global_count = 0;
70402
70403/* A C main function.  */
70404int
70405main (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
70444if 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"
70452at_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>&-
70456at_status=$? at_failed=false
70457$at_check_filter
70458echo stderr:; cat "$at_stderr"
70459echo stdout:; cat "$at_stdout"
70460at_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"
70466at_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>&-
70469at_status=$? at_failed=false
70470$at_check_filter
70471echo stderr:; cat "$at_stderr"
70472echo stdout:; cat "$at_stdout"
70473at_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"
70482at_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>&-
70487at_status=$? at_failed=false
70488$at_check_filter
70489at_fn_diff_devnull "$at_stderr" || at_failed=:
70490$at_diff expout "$at_stdout" || at_failed=:
70491at_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"
70500at_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>&-
70505at_status=$? at_failed=false
70506$at_check_filter
70507at_fn_diff_devnull "$at_stderr" || at_failed=:
70508$at_diff expout "$at_stdout" || at_failed=:
70509at_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
70515fi
70516{ set +x
70517$as_echo "$at_srcdir/calc.at:609: bison -o calc.c calc.y"
70518at_fn_check_prepare_trace "calc.at:609"
70519( $at_check_trace; bison -o calc.c calc.y
70520) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70521at_status=$? at_failed=false
70522$at_check_filter
70523at_fn_diff_devnull "$at_stderr" || at_failed=:
70524at_fn_diff_devnull "$at_stdout" || at_failed=:
70525at_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"
70532at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:609"
70533( $at_check_trace; $BISON_C_WORKS
70534) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70535at_status=$? at_failed=false
70536$at_check_filter
70537echo stderr:; cat "$at_stderr"
70538echo stdout:; cat "$at_stdout"
70539at_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"
70545at_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>&-
70548at_status=$? at_failed=false
70549$at_check_filter
70550echo stderr:; cat "$at_stderr"
70551echo stdout:; cat "$at_stdout"
70552at_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"
70567at_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>&-
70578at_status=$? at_failed=false
70579$at_check_filter
70580at_fn_diff_devnull "$at_stderr" || at_failed=:
70581at_fn_diff_devnull "$at_stdout" || at_failed=:
70582at_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.
70589cat >input <<'_ATEOF'
705901 + 2 * 3 = 7
705911 + 2 * -3 = -5
70592
70593-1^2 = -1
70594(-1)^2 = 1
70595
70596---1 = -1
70597
705981 - 2 - 3 = -4
705991 - (2 - 3) = 2
70600
706012^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"
70607at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70608( $at_check_trace;  $PREPARSER ./calc input
70609) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70610at_status=$? at_failed=false
70611$at_check_filter
70612echo stderr:; tee stderr <"$at_stderr"
70613at_fn_diff_devnull "$at_stdout" || at_failed=:
70614at_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"
70620at_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>&-
70623at_status=$? at_failed=false
70624$at_check_filter
70625echo stderr:; tee stderr <"$at_stderr"
70626at_fn_diff_devnull "$at_stdout" || at_failed=:
70627at_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.
70635cat >input <<'_ATEOF'
706361 2
70637_ATEOF
70638
70639{ set +x
70640$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
70641at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70642( $at_check_trace;  $PREPARSER ./calc input
70643) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70644at_status=$? at_failed=false
70645$at_check_filter
70646echo stderr:; tee stderr <"$at_stderr"
70647at_fn_diff_devnull "$at_stdout" || at_failed=:
70648at_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"
70654at_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>&-
70657at_status=$? at_failed=false
70658$at_check_filter
70659echo stderr:; tee stderr <"$at_stderr"
70660at_fn_diff_devnull "$at_stdout" || at_failed=:
70661at_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.
70670sed '/^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
70685mv at-stderr stderr
70686# 2. Create the reference error message.
70687cat >expout <<'_ATEOF'
706881.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"
70698at_fn_check_prepare_trace "calc.at:609"
70699( $at_check_trace; cat stderr
70700) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70701at_status=$? at_failed=false
70702$at_check_filter
70703at_fn_diff_devnull "$at_stderr" || at_failed=:
70704$at_diff expout "$at_stdout" || at_failed=:
70705at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
70706$at_failed && at_fn_log_failure
70707$at_traceon; }
70708
70709
70710cat >input <<'_ATEOF'
707111//2
70712_ATEOF
70713
70714{ set +x
70715$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
70716at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70717( $at_check_trace;  $PREPARSER ./calc input
70718) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70719at_status=$? at_failed=false
70720$at_check_filter
70721echo stderr:; tee stderr <"$at_stderr"
70722at_fn_diff_devnull "$at_stdout" || at_failed=:
70723at_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"
70729at_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>&-
70732at_status=$? at_failed=false
70733$at_check_filter
70734echo stderr:; tee stderr <"$at_stderr"
70735at_fn_diff_devnull "$at_stdout" || at_failed=:
70736at_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.
70745sed '/^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
70760mv at-stderr stderr
70761# 2. Create the reference error message.
70762cat >expout <<'_ATEOF'
707631.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"
70773at_fn_check_prepare_trace "calc.at:609"
70774( $at_check_trace; cat stderr
70775) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70776at_status=$? at_failed=false
70777$at_check_filter
70778at_fn_diff_devnull "$at_stderr" || at_failed=:
70779$at_diff expout "$at_stdout" || at_failed=:
70780at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
70781$at_failed && at_fn_log_failure
70782$at_traceon; }
70783
70784
70785cat >input <<'_ATEOF'
70786error
70787_ATEOF
70788
70789{ set +x
70790$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
70791at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70792( $at_check_trace;  $PREPARSER ./calc input
70793) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70794at_status=$? at_failed=false
70795$at_check_filter
70796echo stderr:; tee stderr <"$at_stderr"
70797at_fn_diff_devnull "$at_stdout" || at_failed=:
70798at_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"
70804at_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>&-
70807at_status=$? at_failed=false
70808$at_check_filter
70809echo stderr:; tee stderr <"$at_stderr"
70810at_fn_diff_devnull "$at_stdout" || at_failed=:
70811at_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.
70820sed '/^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
70835mv at-stderr stderr
70836# 2. Create the reference error message.
70837cat >expout <<'_ATEOF'
708381.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"
70848at_fn_check_prepare_trace "calc.at:609"
70849( $at_check_trace; cat stderr
70850) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70851at_status=$? at_failed=false
70852$at_check_filter
70853at_fn_diff_devnull "$at_stderr" || at_failed=:
70854$at_diff expout "$at_stdout" || at_failed=:
70855at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
70856$at_failed && at_fn_log_failure
70857$at_traceon; }
70858
70859
70860cat >input <<'_ATEOF'
708611 = 2 = 3
70862_ATEOF
70863
70864{ set +x
70865$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
70866at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70867( $at_check_trace;  $PREPARSER ./calc input
70868) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70869at_status=$? at_failed=false
70870$at_check_filter
70871echo stderr:; tee stderr <"$at_stderr"
70872at_fn_diff_devnull "$at_stdout" || at_failed=:
70873at_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"
70879at_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>&-
70882at_status=$? at_failed=false
70883$at_check_filter
70884echo stderr:; tee stderr <"$at_stderr"
70885at_fn_diff_devnull "$at_stdout" || at_failed=:
70886at_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.
70895sed '/^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
70910mv at-stderr stderr
70911# 2. Create the reference error message.
70912cat >expout <<'_ATEOF'
709131.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"
70923at_fn_check_prepare_trace "calc.at:609"
70924( $at_check_trace; cat stderr
70925) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70926at_status=$? at_failed=false
70927$at_check_filter
70928at_fn_diff_devnull "$at_stderr" || at_failed=:
70929$at_diff expout "$at_stdout" || at_failed=:
70930at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
70931$at_failed && at_fn_log_failure
70932$at_traceon; }
70933
70934
70935cat >input <<'_ATEOF'
70936
70937+1
70938_ATEOF
70939
70940{ set +x
70941$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
70942at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
70943( $at_check_trace;  $PREPARSER ./calc input
70944) >>"$at_stdout" 2>>"$at_stderr" 5>&-
70945at_status=$? at_failed=false
70946$at_check_filter
70947echo stderr:; tee stderr <"$at_stderr"
70948at_fn_diff_devnull "$at_stdout" || at_failed=:
70949at_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"
70955at_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>&-
70958at_status=$? at_failed=false
70959$at_check_filter
70960echo stderr:; tee stderr <"$at_stderr"
70961at_fn_diff_devnull "$at_stdout" || at_failed=:
70962at_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.
70971sed '/^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
70986mv at-stderr stderr
70987# 2. Create the reference error message.
70988cat >expout <<'_ATEOF'
709892.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"
70999at_fn_check_prepare_trace "calc.at:609"
71000( $at_check_trace; cat stderr
71001) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71002at_status=$? at_failed=false
71003$at_check_filter
71004at_fn_diff_devnull "$at_stderr" || at_failed=:
71005$at_diff expout "$at_stdout" || at_failed=:
71006at_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"
71014at_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>&-
71017at_status=$? at_failed=false
71018$at_check_filter
71019echo stderr:; tee stderr <"$at_stderr"
71020at_fn_diff_devnull "$at_stdout" || at_failed=:
71021at_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"
71027at_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>&-
71030at_status=$? at_failed=false
71031$at_check_filter
71032echo stderr:; tee stderr <"$at_stderr"
71033at_fn_diff_devnull "$at_stdout" || at_failed=:
71034at_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.
71043sed '/^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
71058mv at-stderr stderr
71059# 2. Create the reference error message.
71060cat >expout <<'_ATEOF'
710611.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"
71071at_fn_check_prepare_trace "calc.at:609"
71072( $at_check_trace; cat stderr
71073) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71074at_status=$? at_failed=false
71075$at_check_filter
71076at_fn_diff_devnull "$at_stderr" || at_failed=:
71077$at_diff expout "$at_stdout" || at_failed=:
71078at_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#
71100cat >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"
71106at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
71107( $at_check_trace;  $PREPARSER ./calc input
71108) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71109at_status=$? at_failed=false
71110$at_check_filter
71111echo stderr:; tee stderr <"$at_stderr"
71112at_fn_diff_devnull "$at_stdout" || at_failed=:
71113at_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"
71119at_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>&-
71122at_status=$? at_failed=false
71123$at_check_filter
71124echo stderr:; tee stderr <"$at_stderr"
71125at_fn_diff_devnull "$at_stdout" || at_failed=:
71126at_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.
71135sed '/^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
71150mv at-stderr stderr
71151# 2. Create the reference error message.
71152cat >expout <<'_ATEOF'
711531.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
711541.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
711551.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
711561.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
71157calc: 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"
71167at_fn_check_prepare_trace "calc.at:609"
71168( $at_check_trace; cat stderr
71169) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71170at_status=$? at_failed=false
71171$at_check_filter
71172at_fn_diff_devnull "$at_stderr" || at_failed=:
71173$at_diff expout "$at_stdout" || at_failed=:
71174at_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.
71182cat >input <<'_ATEOF'
71183(!) + (1 2) = 1
71184_ATEOF
71185
71186{ set +x
71187$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
71188at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
71189( $at_check_trace;  $PREPARSER ./calc input
71190) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71191at_status=$? at_failed=false
71192$at_check_filter
71193echo stderr:; tee stderr <"$at_stderr"
71194at_fn_diff_devnull "$at_stdout" || at_failed=:
71195at_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"
71201at_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>&-
71204at_status=$? at_failed=false
71205$at_check_filter
71206echo stderr:; tee stderr <"$at_stderr"
71207at_fn_diff_devnull "$at_stdout" || at_failed=:
71208at_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.
71217sed '/^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
71232mv at-stderr stderr
71233# 2. Create the reference error message.
71234cat >expout <<'_ATEOF'
712351.10: syntax error, unexpected number
71236calc: 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"
71246at_fn_check_prepare_trace "calc.at:609"
71247( $at_check_trace; cat stderr
71248) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71249at_status=$? at_failed=false
71250$at_check_filter
71251at_fn_diff_devnull "$at_stderr" || at_failed=:
71252$at_diff expout "$at_stdout" || at_failed=:
71253at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
71254$at_failed && at_fn_log_failure
71255$at_traceon; }
71256
71257
71258cat >input <<'_ATEOF'
71259(- *) + (1 2) = 1
71260_ATEOF
71261
71262{ set +x
71263$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
71264at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
71265( $at_check_trace;  $PREPARSER ./calc input
71266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71267at_status=$? at_failed=false
71268$at_check_filter
71269echo stderr:; tee stderr <"$at_stderr"
71270at_fn_diff_devnull "$at_stdout" || at_failed=:
71271at_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"
71277at_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>&-
71280at_status=$? at_failed=false
71281$at_check_filter
71282echo stderr:; tee stderr <"$at_stderr"
71283at_fn_diff_devnull "$at_stdout" || at_failed=:
71284at_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.
71293sed '/^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
71308mv at-stderr stderr
71309# 2. Create the reference error message.
71310cat >expout <<'_ATEOF'
713111.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
713121.12: syntax error, unexpected number
71313calc: 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"
71323at_fn_check_prepare_trace "calc.at:609"
71324( $at_check_trace; cat stderr
71325) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71326at_status=$? at_failed=false
71327$at_check_filter
71328at_fn_diff_devnull "$at_stderr" || at_failed=:
71329$at_diff expout "$at_stdout" || at_failed=:
71330at_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.
71338cat >input <<'_ATEOF'
71339(* *) + (*) + (*)
71340_ATEOF
71341
71342{ set +x
71343$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
71344at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
71345( $at_check_trace;  $PREPARSER ./calc input
71346) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71347at_status=$? at_failed=false
71348$at_check_filter
71349echo stderr:; tee stderr <"$at_stderr"
71350at_fn_diff_devnull "$at_stdout" || at_failed=:
71351at_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"
71357at_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>&-
71360at_status=$? at_failed=false
71361$at_check_filter
71362echo stderr:; tee stderr <"$at_stderr"
71363at_fn_diff_devnull "$at_stdout" || at_failed=:
71364at_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.
71373sed '/^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
71388mv at-stderr stderr
71389# 2. Create the reference error message.
71390cat >expout <<'_ATEOF'
713911.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
713921.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
713931.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"
71403at_fn_check_prepare_trace "calc.at:609"
71404( $at_check_trace; cat stderr
71405) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71406at_status=$? at_failed=false
71407$at_check_filter
71408at_fn_diff_devnull "$at_stderr" || at_failed=:
71409$at_diff expout "$at_stdout" || at_failed=:
71410at_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
71421read at_status <"$at_status_file"
71422#AT_STOP_209
71423#AT_START_210
71424at_fn_group_banner 210 'calc.at:611' \
71425  "Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
71426at_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
71440cat >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
71481FILE *input;
71482static int power (int base, int exponent);
71483
71484static void calcerror ( const char *msg);
71485int 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%%
71503input:
71504  line
71505| input line         {  }
71506;
71507
71508line:
71509  '\n'
71510| exp '\n'           { USE ($1); }
71511;
71512
71513exp:
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
71534static int
71535power (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.  */
71547static
71548void 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
71558cat >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
71569int calclex (void);
71570static int get_char (void);
71571static void unget_char ( int c);
71572
71573
71574static YYLTYPE last_yylloc;
71575
71576static int
71577get_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
71594static void
71595unget_char ( int c)
71596{
71597  ;
71598
71599  /* Wrong when C == `\n'. */
71600  (calclloc) = last_yylloc;
71601
71602  ungetc (c, input);
71603}
71604
71605static int
71606read_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
71637int 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
71667cat >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
71686semantic_value global_result = 0;
71687int global_count = 0;
71688
71689/* A C main function.  */
71690int
71691main (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
71729if 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"
71737at_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>&-
71741at_status=$? at_failed=false
71742$at_check_filter
71743echo stderr:; cat "$at_stderr"
71744echo stdout:; cat "$at_stdout"
71745at_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"
71751at_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>&-
71754at_status=$? at_failed=false
71755$at_check_filter
71756echo stderr:; cat "$at_stderr"
71757echo stdout:; cat "$at_stdout"
71758at_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"
71767at_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>&-
71772at_status=$? at_failed=false
71773$at_check_filter
71774at_fn_diff_devnull "$at_stderr" || at_failed=:
71775$at_diff expout "$at_stdout" || at_failed=:
71776at_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"
71785at_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>&-
71790at_status=$? at_failed=false
71791$at_check_filter
71792at_fn_diff_devnull "$at_stderr" || at_failed=:
71793$at_diff expout "$at_stdout" || at_failed=:
71794at_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
71800fi
71801{ set +x
71802$as_echo "$at_srcdir/calc.at:611: bison -o calc.c calc.y"
71803at_fn_check_prepare_trace "calc.at:611"
71804( $at_check_trace; bison -o calc.c calc.y
71805) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71806at_status=$? at_failed=false
71807$at_check_filter
71808at_fn_diff_devnull "$at_stderr" || at_failed=:
71809at_fn_diff_devnull "$at_stdout" || at_failed=:
71810at_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"
71817at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611"
71818( $at_check_trace; $BISON_C_WORKS
71819) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71820at_status=$? at_failed=false
71821$at_check_filter
71822echo stderr:; cat "$at_stderr"
71823echo stdout:; cat "$at_stdout"
71824at_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"
71830at_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>&-
71833at_status=$? at_failed=false
71834$at_check_filter
71835echo stderr:; cat "$at_stderr"
71836echo stdout:; cat "$at_stdout"
71837at_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"
71852at_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>&-
71863at_status=$? at_failed=false
71864$at_check_filter
71865at_fn_diff_devnull "$at_stderr" || at_failed=:
71866at_fn_diff_devnull "$at_stdout" || at_failed=:
71867at_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"
71881at_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>&-
71892at_status=$? at_failed=false
71893$at_check_filter
71894at_fn_diff_devnull "$at_stderr" || at_failed=:
71895at_fn_diff_devnull "$at_stdout" || at_failed=:
71896at_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.
71902cat >input <<'_ATEOF'
719031 + 2 * 3 = 7
719041 + 2 * -3 = -5
71905
71906-1^2 = -1
71907(-1)^2 = 1
71908
71909---1 = -1
71910
719111 - 2 - 3 = -4
719121 - (2 - 3) = 2
71913
719142^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"
71920at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
71921( $at_check_trace;  $PREPARSER ./calc input
71922) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71923at_status=$? at_failed=false
71924$at_check_filter
71925echo stderr:; tee stderr <"$at_stderr"
71926at_fn_diff_devnull "$at_stdout" || at_failed=:
71927at_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"
71933at_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>&-
71936at_status=$? at_failed=false
71937$at_check_filter
71938echo stderr:; tee stderr <"$at_stderr"
71939at_fn_diff_devnull "$at_stdout" || at_failed=:
71940at_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.
71948cat >input <<'_ATEOF'
719491 2
71950_ATEOF
71951
71952{ set +x
71953$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
71954at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
71955( $at_check_trace;  $PREPARSER ./calc input
71956) >>"$at_stdout" 2>>"$at_stderr" 5>&-
71957at_status=$? at_failed=false
71958$at_check_filter
71959echo stderr:; tee stderr <"$at_stderr"
71960at_fn_diff_devnull "$at_stdout" || at_failed=:
71961at_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"
71967at_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>&-
71970at_status=$? at_failed=false
71971$at_check_filter
71972echo stderr:; tee stderr <"$at_stderr"
71973at_fn_diff_devnull "$at_stdout" || at_failed=:
71974at_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.
71983sed '/^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
71998mv at-stderr stderr
71999# 2. Create the reference error message.
72000cat >expout <<'_ATEOF'
720011.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"
72011at_fn_check_prepare_trace "calc.at:611"
72012( $at_check_trace; cat stderr
72013) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72014at_status=$? at_failed=false
72015$at_check_filter
72016at_fn_diff_devnull "$at_stderr" || at_failed=:
72017$at_diff expout "$at_stdout" || at_failed=:
72018at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
72019$at_failed && at_fn_log_failure
72020$at_traceon; }
72021
72022
72023cat >input <<'_ATEOF'
720241//2
72025_ATEOF
72026
72027{ set +x
72028$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72029at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72030( $at_check_trace;  $PREPARSER ./calc input
72031) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72032at_status=$? at_failed=false
72033$at_check_filter
72034echo stderr:; tee stderr <"$at_stderr"
72035at_fn_diff_devnull "$at_stdout" || at_failed=:
72036at_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"
72042at_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>&-
72045at_status=$? at_failed=false
72046$at_check_filter
72047echo stderr:; tee stderr <"$at_stderr"
72048at_fn_diff_devnull "$at_stdout" || at_failed=:
72049at_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.
72058sed '/^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
72073mv at-stderr stderr
72074# 2. Create the reference error message.
72075cat >expout <<'_ATEOF'
720761.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"
72086at_fn_check_prepare_trace "calc.at:611"
72087( $at_check_trace; cat stderr
72088) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72089at_status=$? at_failed=false
72090$at_check_filter
72091at_fn_diff_devnull "$at_stderr" || at_failed=:
72092$at_diff expout "$at_stdout" || at_failed=:
72093at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
72094$at_failed && at_fn_log_failure
72095$at_traceon; }
72096
72097
72098cat >input <<'_ATEOF'
72099error
72100_ATEOF
72101
72102{ set +x
72103$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72104at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72105( $at_check_trace;  $PREPARSER ./calc input
72106) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72107at_status=$? at_failed=false
72108$at_check_filter
72109echo stderr:; tee stderr <"$at_stderr"
72110at_fn_diff_devnull "$at_stdout" || at_failed=:
72111at_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"
72117at_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>&-
72120at_status=$? at_failed=false
72121$at_check_filter
72122echo stderr:; tee stderr <"$at_stderr"
72123at_fn_diff_devnull "$at_stdout" || at_failed=:
72124at_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.
72133sed '/^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
72148mv at-stderr stderr
72149# 2. Create the reference error message.
72150cat >expout <<'_ATEOF'
721511.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"
72161at_fn_check_prepare_trace "calc.at:611"
72162( $at_check_trace; cat stderr
72163) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72164at_status=$? at_failed=false
72165$at_check_filter
72166at_fn_diff_devnull "$at_stderr" || at_failed=:
72167$at_diff expout "$at_stdout" || at_failed=:
72168at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
72169$at_failed && at_fn_log_failure
72170$at_traceon; }
72171
72172
72173cat >input <<'_ATEOF'
721741 = 2 = 3
72175_ATEOF
72176
72177{ set +x
72178$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72179at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72180( $at_check_trace;  $PREPARSER ./calc input
72181) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72182at_status=$? at_failed=false
72183$at_check_filter
72184echo stderr:; tee stderr <"$at_stderr"
72185at_fn_diff_devnull "$at_stdout" || at_failed=:
72186at_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"
72192at_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>&-
72195at_status=$? at_failed=false
72196$at_check_filter
72197echo stderr:; tee stderr <"$at_stderr"
72198at_fn_diff_devnull "$at_stdout" || at_failed=:
72199at_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.
72208sed '/^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
72223mv at-stderr stderr
72224# 2. Create the reference error message.
72225cat >expout <<'_ATEOF'
722261.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"
72236at_fn_check_prepare_trace "calc.at:611"
72237( $at_check_trace; cat stderr
72238) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72239at_status=$? at_failed=false
72240$at_check_filter
72241at_fn_diff_devnull "$at_stderr" || at_failed=:
72242$at_diff expout "$at_stdout" || at_failed=:
72243at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
72244$at_failed && at_fn_log_failure
72245$at_traceon; }
72246
72247
72248cat >input <<'_ATEOF'
72249
72250+1
72251_ATEOF
72252
72253{ set +x
72254$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72255at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72256( $at_check_trace;  $PREPARSER ./calc input
72257) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72258at_status=$? at_failed=false
72259$at_check_filter
72260echo stderr:; tee stderr <"$at_stderr"
72261at_fn_diff_devnull "$at_stdout" || at_failed=:
72262at_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"
72268at_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>&-
72271at_status=$? at_failed=false
72272$at_check_filter
72273echo stderr:; tee stderr <"$at_stderr"
72274at_fn_diff_devnull "$at_stdout" || at_failed=:
72275at_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.
72284sed '/^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
72299mv at-stderr stderr
72300# 2. Create the reference error message.
72301cat >expout <<'_ATEOF'
723022.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"
72312at_fn_check_prepare_trace "calc.at:611"
72313( $at_check_trace; cat stderr
72314) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72315at_status=$? at_failed=false
72316$at_check_filter
72317at_fn_diff_devnull "$at_stderr" || at_failed=:
72318$at_diff expout "$at_stdout" || at_failed=:
72319at_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"
72327at_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>&-
72330at_status=$? at_failed=false
72331$at_check_filter
72332echo stderr:; tee stderr <"$at_stderr"
72333at_fn_diff_devnull "$at_stdout" || at_failed=:
72334at_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"
72340at_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>&-
72343at_status=$? at_failed=false
72344$at_check_filter
72345echo stderr:; tee stderr <"$at_stderr"
72346at_fn_diff_devnull "$at_stdout" || at_failed=:
72347at_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.
72356sed '/^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
72371mv at-stderr stderr
72372# 2. Create the reference error message.
72373cat >expout <<'_ATEOF'
723741.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"
72384at_fn_check_prepare_trace "calc.at:611"
72385( $at_check_trace; cat stderr
72386) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72387at_status=$? at_failed=false
72388$at_check_filter
72389at_fn_diff_devnull "$at_stderr" || at_failed=:
72390$at_diff expout "$at_stdout" || at_failed=:
72391at_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#
72413cat >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"
72419at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72420( $at_check_trace;  $PREPARSER ./calc input
72421) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72422at_status=$? at_failed=false
72423$at_check_filter
72424echo stderr:; tee stderr <"$at_stderr"
72425at_fn_diff_devnull "$at_stdout" || at_failed=:
72426at_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"
72432at_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>&-
72435at_status=$? at_failed=false
72436$at_check_filter
72437echo stderr:; tee stderr <"$at_stderr"
72438at_fn_diff_devnull "$at_stdout" || at_failed=:
72439at_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.
72448sed '/^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
72463mv at-stderr stderr
72464# 2. Create the reference error message.
72465cat >expout <<'_ATEOF'
724661.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
724671.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
724681.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
724691.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
72470calc: 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"
72480at_fn_check_prepare_trace "calc.at:611"
72481( $at_check_trace; cat stderr
72482) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72483at_status=$? at_failed=false
72484$at_check_filter
72485at_fn_diff_devnull "$at_stderr" || at_failed=:
72486$at_diff expout "$at_stdout" || at_failed=:
72487at_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.
72495cat >input <<'_ATEOF'
72496(!) + (1 2) = 1
72497_ATEOF
72498
72499{ set +x
72500$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72501at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72502( $at_check_trace;  $PREPARSER ./calc input
72503) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72504at_status=$? at_failed=false
72505$at_check_filter
72506echo stderr:; tee stderr <"$at_stderr"
72507at_fn_diff_devnull "$at_stdout" || at_failed=:
72508at_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"
72514at_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>&-
72517at_status=$? at_failed=false
72518$at_check_filter
72519echo stderr:; tee stderr <"$at_stderr"
72520at_fn_diff_devnull "$at_stdout" || at_failed=:
72521at_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.
72530sed '/^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
72545mv at-stderr stderr
72546# 2. Create the reference error message.
72547cat >expout <<'_ATEOF'
725481.10: syntax error, unexpected number
72549calc: 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"
72559at_fn_check_prepare_trace "calc.at:611"
72560( $at_check_trace; cat stderr
72561) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72562at_status=$? at_failed=false
72563$at_check_filter
72564at_fn_diff_devnull "$at_stderr" || at_failed=:
72565$at_diff expout "$at_stdout" || at_failed=:
72566at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
72567$at_failed && at_fn_log_failure
72568$at_traceon; }
72569
72570
72571cat >input <<'_ATEOF'
72572(- *) + (1 2) = 1
72573_ATEOF
72574
72575{ set +x
72576$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72577at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72578( $at_check_trace;  $PREPARSER ./calc input
72579) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72580at_status=$? at_failed=false
72581$at_check_filter
72582echo stderr:; tee stderr <"$at_stderr"
72583at_fn_diff_devnull "$at_stdout" || at_failed=:
72584at_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"
72590at_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>&-
72593at_status=$? at_failed=false
72594$at_check_filter
72595echo stderr:; tee stderr <"$at_stderr"
72596at_fn_diff_devnull "$at_stdout" || at_failed=:
72597at_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.
72606sed '/^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
72621mv at-stderr stderr
72622# 2. Create the reference error message.
72623cat >expout <<'_ATEOF'
726241.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
726251.12: syntax error, unexpected number
72626calc: 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"
72636at_fn_check_prepare_trace "calc.at:611"
72637( $at_check_trace; cat stderr
72638) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72639at_status=$? at_failed=false
72640$at_check_filter
72641at_fn_diff_devnull "$at_stderr" || at_failed=:
72642$at_diff expout "$at_stdout" || at_failed=:
72643at_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.
72651cat >input <<'_ATEOF'
72652(* *) + (*) + (*)
72653_ATEOF
72654
72655{ set +x
72656$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
72657at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
72658( $at_check_trace;  $PREPARSER ./calc input
72659) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72660at_status=$? at_failed=false
72661$at_check_filter
72662echo stderr:; tee stderr <"$at_stderr"
72663at_fn_diff_devnull "$at_stdout" || at_failed=:
72664at_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"
72670at_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>&-
72673at_status=$? at_failed=false
72674$at_check_filter
72675echo stderr:; tee stderr <"$at_stderr"
72676at_fn_diff_devnull "$at_stdout" || at_failed=:
72677at_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.
72686sed '/^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
72701mv at-stderr stderr
72702# 2. Create the reference error message.
72703cat >expout <<'_ATEOF'
727041.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
727051.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
727061.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"
72716at_fn_check_prepare_trace "calc.at:611"
72717( $at_check_trace; cat stderr
72718) >>"$at_stdout" 2>>"$at_stderr" 5>&-
72719at_status=$? at_failed=false
72720$at_check_filter
72721at_fn_diff_devnull "$at_stderr" || at_failed=:
72722$at_diff expout "$at_stdout" || at_failed=:
72723at_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
72734read at_status <"$at_status_file"
72735#AT_STOP_210
72736#AT_START_211
72737at_fn_group_banner 211 'calc.at:612' \
72738  "Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11
72739at_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
72753cat >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
72794FILE *input;
72795static int power (int base, int exponent);
72796
72797static void calcerror ( const char *msg);
72798int 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%%
72816input:
72817  line
72818| input line         {  }
72819;
72820
72821line:
72822  '\n'
72823| exp '\n'           { USE ($1); }
72824;
72825
72826exp:
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
72847static int
72848power (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.  */
72860static
72861void 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
72871cat >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
72882int calclex (void);
72883static int get_char (void);
72884static void unget_char ( int c);
72885
72886
72887static CALCLTYPE last_yylloc;
72888
72889static int
72890get_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
72907static void
72908unget_char ( int c)
72909{
72910  ;
72911
72912  /* Wrong when C == `\n'. */
72913  (calclloc) = last_yylloc;
72914
72915  ungetc (c, input);
72916}
72917
72918static int
72919read_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
72950int 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
72980cat >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
72999semantic_value global_result = 0;
73000int global_count = 0;
73001
73002/* A C main function.  */
73003int
73004main (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
73042if 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"
73050at_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>&-
73054at_status=$? at_failed=false
73055$at_check_filter
73056echo stderr:; cat "$at_stderr"
73057echo stdout:; cat "$at_stdout"
73058at_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"
73064at_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>&-
73067at_status=$? at_failed=false
73068$at_check_filter
73069echo stderr:; cat "$at_stderr"
73070echo stdout:; cat "$at_stdout"
73071at_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"
73080at_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>&-
73085at_status=$? at_failed=false
73086$at_check_filter
73087at_fn_diff_devnull "$at_stderr" || at_failed=:
73088$at_diff expout "$at_stdout" || at_failed=:
73089at_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"
73098at_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>&-
73103at_status=$? at_failed=false
73104$at_check_filter
73105at_fn_diff_devnull "$at_stderr" || at_failed=:
73106$at_diff expout "$at_stdout" || at_failed=:
73107at_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
73113fi
73114{ set +x
73115$as_echo "$at_srcdir/calc.at:612: bison -o calc.c calc.y"
73116at_fn_check_prepare_trace "calc.at:612"
73117( $at_check_trace; bison -o calc.c calc.y
73118) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73119at_status=$? at_failed=false
73120$at_check_filter
73121at_fn_diff_devnull "$at_stderr" || at_failed=:
73122at_fn_diff_devnull "$at_stdout" || at_failed=:
73123at_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"
73130at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:612"
73131( $at_check_trace; $BISON_C_WORKS
73132) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73133at_status=$? at_failed=false
73134$at_check_filter
73135echo stderr:; cat "$at_stderr"
73136echo stdout:; cat "$at_stdout"
73137at_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"
73143at_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>&-
73146at_status=$? at_failed=false
73147$at_check_filter
73148echo stderr:; cat "$at_stderr"
73149echo stdout:; cat "$at_stdout"
73150at_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"
73165at_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>&-
73176at_status=$? at_failed=false
73177$at_check_filter
73178at_fn_diff_devnull "$at_stderr" || at_failed=:
73179at_fn_diff_devnull "$at_stdout" || at_failed=:
73180at_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"
73194at_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>&-
73205at_status=$? at_failed=false
73206$at_check_filter
73207at_fn_diff_devnull "$at_stderr" || at_failed=:
73208at_fn_diff_devnull "$at_stdout" || at_failed=:
73209at_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.
73215cat >input <<'_ATEOF'
732161 + 2 * 3 = 7
732171 + 2 * -3 = -5
73218
73219-1^2 = -1
73220(-1)^2 = 1
73221
73222---1 = -1
73223
732241 - 2 - 3 = -4
732251 - (2 - 3) = 2
73226
732272^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"
73233at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73234( $at_check_trace;  $PREPARSER ./calc input
73235) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73236at_status=$? at_failed=false
73237$at_check_filter
73238echo stderr:; tee stderr <"$at_stderr"
73239at_fn_diff_devnull "$at_stdout" || at_failed=:
73240at_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"
73246at_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>&-
73249at_status=$? at_failed=false
73250$at_check_filter
73251echo stderr:; tee stderr <"$at_stderr"
73252at_fn_diff_devnull "$at_stdout" || at_failed=:
73253at_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.
73261cat >input <<'_ATEOF'
732621 2
73263_ATEOF
73264
73265{ set +x
73266$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73267at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73268( $at_check_trace;  $PREPARSER ./calc input
73269) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73270at_status=$? at_failed=false
73271$at_check_filter
73272echo stderr:; tee stderr <"$at_stderr"
73273at_fn_diff_devnull "$at_stdout" || at_failed=:
73274at_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"
73280at_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>&-
73283at_status=$? at_failed=false
73284$at_check_filter
73285echo stderr:; tee stderr <"$at_stderr"
73286at_fn_diff_devnull "$at_stdout" || at_failed=:
73287at_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.
73296sed '/^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
73311mv at-stderr stderr
73312# 2. Create the reference error message.
73313cat >expout <<'_ATEOF'
733141.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"
73324at_fn_check_prepare_trace "calc.at:612"
73325( $at_check_trace; cat stderr
73326) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73327at_status=$? at_failed=false
73328$at_check_filter
73329at_fn_diff_devnull "$at_stderr" || at_failed=:
73330$at_diff expout "$at_stdout" || at_failed=:
73331at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
73332$at_failed && at_fn_log_failure
73333$at_traceon; }
73334
73335
73336cat >input <<'_ATEOF'
733371//2
73338_ATEOF
73339
73340{ set +x
73341$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73342at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73343( $at_check_trace;  $PREPARSER ./calc input
73344) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73345at_status=$? at_failed=false
73346$at_check_filter
73347echo stderr:; tee stderr <"$at_stderr"
73348at_fn_diff_devnull "$at_stdout" || at_failed=:
73349at_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"
73355at_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>&-
73358at_status=$? at_failed=false
73359$at_check_filter
73360echo stderr:; tee stderr <"$at_stderr"
73361at_fn_diff_devnull "$at_stdout" || at_failed=:
73362at_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.
73371sed '/^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
73386mv at-stderr stderr
73387# 2. Create the reference error message.
73388cat >expout <<'_ATEOF'
733891.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"
73399at_fn_check_prepare_trace "calc.at:612"
73400( $at_check_trace; cat stderr
73401) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73402at_status=$? at_failed=false
73403$at_check_filter
73404at_fn_diff_devnull "$at_stderr" || at_failed=:
73405$at_diff expout "$at_stdout" || at_failed=:
73406at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
73407$at_failed && at_fn_log_failure
73408$at_traceon; }
73409
73410
73411cat >input <<'_ATEOF'
73412error
73413_ATEOF
73414
73415{ set +x
73416$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73417at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73418( $at_check_trace;  $PREPARSER ./calc input
73419) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73420at_status=$? at_failed=false
73421$at_check_filter
73422echo stderr:; tee stderr <"$at_stderr"
73423at_fn_diff_devnull "$at_stdout" || at_failed=:
73424at_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"
73430at_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>&-
73433at_status=$? at_failed=false
73434$at_check_filter
73435echo stderr:; tee stderr <"$at_stderr"
73436at_fn_diff_devnull "$at_stdout" || at_failed=:
73437at_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.
73446sed '/^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
73461mv at-stderr stderr
73462# 2. Create the reference error message.
73463cat >expout <<'_ATEOF'
734641.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"
73474at_fn_check_prepare_trace "calc.at:612"
73475( $at_check_trace; cat stderr
73476) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73477at_status=$? at_failed=false
73478$at_check_filter
73479at_fn_diff_devnull "$at_stderr" || at_failed=:
73480$at_diff expout "$at_stdout" || at_failed=:
73481at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
73482$at_failed && at_fn_log_failure
73483$at_traceon; }
73484
73485
73486cat >input <<'_ATEOF'
734871 = 2 = 3
73488_ATEOF
73489
73490{ set +x
73491$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73492at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73493( $at_check_trace;  $PREPARSER ./calc input
73494) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73495at_status=$? at_failed=false
73496$at_check_filter
73497echo stderr:; tee stderr <"$at_stderr"
73498at_fn_diff_devnull "$at_stdout" || at_failed=:
73499at_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"
73505at_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>&-
73508at_status=$? at_failed=false
73509$at_check_filter
73510echo stderr:; tee stderr <"$at_stderr"
73511at_fn_diff_devnull "$at_stdout" || at_failed=:
73512at_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.
73521sed '/^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
73536mv at-stderr stderr
73537# 2. Create the reference error message.
73538cat >expout <<'_ATEOF'
735391.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"
73549at_fn_check_prepare_trace "calc.at:612"
73550( $at_check_trace; cat stderr
73551) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73552at_status=$? at_failed=false
73553$at_check_filter
73554at_fn_diff_devnull "$at_stderr" || at_failed=:
73555$at_diff expout "$at_stdout" || at_failed=:
73556at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
73557$at_failed && at_fn_log_failure
73558$at_traceon; }
73559
73560
73561cat >input <<'_ATEOF'
73562
73563+1
73564_ATEOF
73565
73566{ set +x
73567$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73568at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73569( $at_check_trace;  $PREPARSER ./calc input
73570) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73571at_status=$? at_failed=false
73572$at_check_filter
73573echo stderr:; tee stderr <"$at_stderr"
73574at_fn_diff_devnull "$at_stdout" || at_failed=:
73575at_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"
73581at_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>&-
73584at_status=$? at_failed=false
73585$at_check_filter
73586echo stderr:; tee stderr <"$at_stderr"
73587at_fn_diff_devnull "$at_stdout" || at_failed=:
73588at_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.
73597sed '/^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
73612mv at-stderr stderr
73613# 2. Create the reference error message.
73614cat >expout <<'_ATEOF'
736152.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"
73625at_fn_check_prepare_trace "calc.at:612"
73626( $at_check_trace; cat stderr
73627) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73628at_status=$? at_failed=false
73629$at_check_filter
73630at_fn_diff_devnull "$at_stderr" || at_failed=:
73631$at_diff expout "$at_stdout" || at_failed=:
73632at_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"
73640at_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>&-
73643at_status=$? at_failed=false
73644$at_check_filter
73645echo stderr:; tee stderr <"$at_stderr"
73646at_fn_diff_devnull "$at_stdout" || at_failed=:
73647at_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"
73653at_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>&-
73656at_status=$? at_failed=false
73657$at_check_filter
73658echo stderr:; tee stderr <"$at_stderr"
73659at_fn_diff_devnull "$at_stdout" || at_failed=:
73660at_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.
73669sed '/^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
73684mv at-stderr stderr
73685# 2. Create the reference error message.
73686cat >expout <<'_ATEOF'
736871.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"
73697at_fn_check_prepare_trace "calc.at:612"
73698( $at_check_trace; cat stderr
73699) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73700at_status=$? at_failed=false
73701$at_check_filter
73702at_fn_diff_devnull "$at_stderr" || at_failed=:
73703$at_diff expout "$at_stdout" || at_failed=:
73704at_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#
73726cat >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"
73732at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73733( $at_check_trace;  $PREPARSER ./calc input
73734) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73735at_status=$? at_failed=false
73736$at_check_filter
73737echo stderr:; tee stderr <"$at_stderr"
73738at_fn_diff_devnull "$at_stdout" || at_failed=:
73739at_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"
73745at_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>&-
73748at_status=$? at_failed=false
73749$at_check_filter
73750echo stderr:; tee stderr <"$at_stderr"
73751at_fn_diff_devnull "$at_stdout" || at_failed=:
73752at_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.
73761sed '/^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
73776mv at-stderr stderr
73777# 2. Create the reference error message.
73778cat >expout <<'_ATEOF'
737791.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
737801.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
737811.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
737821.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
73783calc: 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"
73793at_fn_check_prepare_trace "calc.at:612"
73794( $at_check_trace; cat stderr
73795) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73796at_status=$? at_failed=false
73797$at_check_filter
73798at_fn_diff_devnull "$at_stderr" || at_failed=:
73799$at_diff expout "$at_stdout" || at_failed=:
73800at_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.
73808cat >input <<'_ATEOF'
73809(!) + (1 2) = 1
73810_ATEOF
73811
73812{ set +x
73813$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73814at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73815( $at_check_trace;  $PREPARSER ./calc input
73816) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73817at_status=$? at_failed=false
73818$at_check_filter
73819echo stderr:; tee stderr <"$at_stderr"
73820at_fn_diff_devnull "$at_stdout" || at_failed=:
73821at_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"
73827at_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>&-
73830at_status=$? at_failed=false
73831$at_check_filter
73832echo stderr:; tee stderr <"$at_stderr"
73833at_fn_diff_devnull "$at_stdout" || at_failed=:
73834at_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.
73843sed '/^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
73858mv at-stderr stderr
73859# 2. Create the reference error message.
73860cat >expout <<'_ATEOF'
738611.10: syntax error, unexpected number
73862calc: 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"
73872at_fn_check_prepare_trace "calc.at:612"
73873( $at_check_trace; cat stderr
73874) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73875at_status=$? at_failed=false
73876$at_check_filter
73877at_fn_diff_devnull "$at_stderr" || at_failed=:
73878$at_diff expout "$at_stdout" || at_failed=:
73879at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
73880$at_failed && at_fn_log_failure
73881$at_traceon; }
73882
73883
73884cat >input <<'_ATEOF'
73885(- *) + (1 2) = 1
73886_ATEOF
73887
73888{ set +x
73889$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73890at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73891( $at_check_trace;  $PREPARSER ./calc input
73892) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73893at_status=$? at_failed=false
73894$at_check_filter
73895echo stderr:; tee stderr <"$at_stderr"
73896at_fn_diff_devnull "$at_stdout" || at_failed=:
73897at_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"
73903at_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>&-
73906at_status=$? at_failed=false
73907$at_check_filter
73908echo stderr:; tee stderr <"$at_stderr"
73909at_fn_diff_devnull "$at_stdout" || at_failed=:
73910at_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.
73919sed '/^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
73934mv at-stderr stderr
73935# 2. Create the reference error message.
73936cat >expout <<'_ATEOF'
739371.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
739381.12: syntax error, unexpected number
73939calc: 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"
73949at_fn_check_prepare_trace "calc.at:612"
73950( $at_check_trace; cat stderr
73951) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73952at_status=$? at_failed=false
73953$at_check_filter
73954at_fn_diff_devnull "$at_stderr" || at_failed=:
73955$at_diff expout "$at_stdout" || at_failed=:
73956at_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.
73964cat >input <<'_ATEOF'
73965(* *) + (*) + (*)
73966_ATEOF
73967
73968{ set +x
73969$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
73970at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
73971( $at_check_trace;  $PREPARSER ./calc input
73972) >>"$at_stdout" 2>>"$at_stderr" 5>&-
73973at_status=$? at_failed=false
73974$at_check_filter
73975echo stderr:; tee stderr <"$at_stderr"
73976at_fn_diff_devnull "$at_stdout" || at_failed=:
73977at_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"
73983at_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>&-
73986at_status=$? at_failed=false
73987$at_check_filter
73988echo stderr:; tee stderr <"$at_stderr"
73989at_fn_diff_devnull "$at_stdout" || at_failed=:
73990at_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.
73999sed '/^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
74014mv at-stderr stderr
74015# 2. Create the reference error message.
74016cat >expout <<'_ATEOF'
740171.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
740181.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
740191.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"
74029at_fn_check_prepare_trace "calc.at:612"
74030( $at_check_trace; cat stderr
74031) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74032at_status=$? at_failed=false
74033$at_check_filter
74034at_fn_diff_devnull "$at_stderr" || at_failed=:
74035$at_diff expout "$at_stdout" || at_failed=:
74036at_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
74047read at_status <"$at_status_file"
74048#AT_STOP_211
74049#AT_START_212
74050at_fn_group_banner 212 'calc.at:614' \
74051  "Calculator %debug" "                              " 11
74052at_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
74066cat >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
74107FILE *input;
74108static int power (int base, int exponent);
74109
74110static void yyerror ( const char *msg);
74111int 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%%
74129input:
74130  line
74131| input line         {  }
74132;
74133
74134line:
74135  '\n'
74136| exp '\n'           { USE ($1); }
74137;
74138
74139exp:
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
74160static int
74161power (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.  */
74173static
74174void yyerror ( const char *msg)
74175{
74176  fprintf (stderr, "%s\n", msg);
74177}
74178#include <ctype.h>
74179
74180int yylex (void);
74181static int get_char (void);
74182static void unget_char ( int c);
74183
74184
74185static int
74186get_char (void)
74187{
74188  int res = getc (input);
74189  ;
74190
74191  return res;
74192}
74193
74194static void
74195unget_char ( int c)
74196{
74197  ;
74198
74199  ungetc (c, input);
74200}
74201
74202static int
74203read_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
74234int 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
74270semantic_value global_result = 0;
74271int global_count = 0;
74272
74273/* A C main function.  */
74274int
74275main (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
74314if 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"
74322at_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>&-
74326at_status=$? at_failed=false
74327$at_check_filter
74328echo stderr:; cat "$at_stderr"
74329echo stdout:; cat "$at_stdout"
74330at_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"
74336at_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>&-
74339at_status=$? at_failed=false
74340$at_check_filter
74341echo stderr:; cat "$at_stderr"
74342echo stdout:; cat "$at_stdout"
74343at_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"
74352at_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>&-
74357at_status=$? at_failed=false
74358$at_check_filter
74359at_fn_diff_devnull "$at_stderr" || at_failed=:
74360$at_diff expout "$at_stdout" || at_failed=:
74361at_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"
74370at_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>&-
74375at_status=$? at_failed=false
74376$at_check_filter
74377at_fn_diff_devnull "$at_stderr" || at_failed=:
74378$at_diff expout "$at_stdout" || at_failed=:
74379at_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
74385fi
74386{ set +x
74387$as_echo "$at_srcdir/calc.at:614: bison -o calc.c calc.y"
74388at_fn_check_prepare_trace "calc.at:614"
74389( $at_check_trace; bison -o calc.c calc.y
74390) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74391at_status=$? at_failed=false
74392$at_check_filter
74393at_fn_diff_devnull "$at_stderr" || at_failed=:
74394at_fn_diff_devnull "$at_stdout" || at_failed=:
74395at_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"
74402at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614"
74403( $at_check_trace; $BISON_C_WORKS
74404) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74405at_status=$? at_failed=false
74406$at_check_filter
74407echo stderr:; cat "$at_stderr"
74408echo stdout:; cat "$at_stdout"
74409at_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"
74415at_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>&-
74418at_status=$? at_failed=false
74419$at_check_filter
74420echo stderr:; cat "$at_stderr"
74421echo stdout:; cat "$at_stdout"
74422at_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"
74437at_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>&-
74448at_status=$? at_failed=false
74449$at_check_filter
74450at_fn_diff_devnull "$at_stderr" || at_failed=:
74451at_fn_diff_devnull "$at_stdout" || at_failed=:
74452at_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.
74459cat >input <<'_ATEOF'
744601 + 2 * 3 = 7
744611 + 2 * -3 = -5
74462
74463-1^2 = -1
74464(-1)^2 = 1
74465
74466---1 = -1
74467
744681 - 2 - 3 = -4
744691 - (2 - 3) = 2
74470
744712^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"
74477at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74478( $at_check_trace;  $PREPARSER ./calc input
74479) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74480at_status=$? at_failed=false
74481$at_check_filter
74482echo stderr:; tee stderr <"$at_stderr"
74483at_fn_diff_devnull "$at_stdout" || at_failed=:
74484at_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"
74490at_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>&-
74493at_status=$? at_failed=false
74494$at_check_filter
74495echo stderr:; tee stderr <"$at_stderr"
74496at_fn_diff_devnull "$at_stdout" || at_failed=:
74497at_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.
74505cat >input <<'_ATEOF'
745061 2
74507_ATEOF
74508
74509{ set +x
74510$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
74511at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74512( $at_check_trace;  $PREPARSER ./calc input
74513) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74514at_status=$? at_failed=false
74515$at_check_filter
74516echo stderr:; tee stderr <"$at_stderr"
74517at_fn_diff_devnull "$at_stdout" || at_failed=:
74518at_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"
74524at_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>&-
74527at_status=$? at_failed=false
74528$at_check_filter
74529echo stderr:; tee stderr <"$at_stderr"
74530at_fn_diff_devnull "$at_stdout" || at_failed=:
74531at_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.
74540sed '/^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
74555mv at-stderr stderr
74556# 2. Create the reference error message.
74557cat >expout <<'_ATEOF'
745581.3: syntax error, unexpected number
74559_ATEOF
74560
74561# 3. If locations are not used, remove them.
74562sed 's/^[-0-9.]*: //' expout >at-expout
74563mv at-expout expout
74564# 4. If error-verbose is not used, strip the`, unexpected....' part.
74565sed 's/syntax error, .*$/syntax error/' expout >at-expout
74566mv at-expout expout
74567# 5. Check
74568{ set +x
74569$as_echo "$at_srcdir/calc.at:614: cat stderr"
74570at_fn_check_prepare_trace "calc.at:614"
74571( $at_check_trace; cat stderr
74572) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74573at_status=$? at_failed=false
74574$at_check_filter
74575at_fn_diff_devnull "$at_stderr" || at_failed=:
74576$at_diff expout "$at_stdout" || at_failed=:
74577at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
74578$at_failed && at_fn_log_failure
74579$at_traceon; }
74580
74581
74582cat >input <<'_ATEOF'
745831//2
74584_ATEOF
74585
74586{ set +x
74587$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
74588at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74589( $at_check_trace;  $PREPARSER ./calc input
74590) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74591at_status=$? at_failed=false
74592$at_check_filter
74593echo stderr:; tee stderr <"$at_stderr"
74594at_fn_diff_devnull "$at_stdout" || at_failed=:
74595at_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"
74601at_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>&-
74604at_status=$? at_failed=false
74605$at_check_filter
74606echo stderr:; tee stderr <"$at_stderr"
74607at_fn_diff_devnull "$at_stdout" || at_failed=:
74608at_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.
74617sed '/^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
74632mv at-stderr stderr
74633# 2. Create the reference error message.
74634cat >expout <<'_ATEOF'
746351.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
74636_ATEOF
74637
74638# 3. If locations are not used, remove them.
74639sed 's/^[-0-9.]*: //' expout >at-expout
74640mv at-expout expout
74641# 4. If error-verbose is not used, strip the`, unexpected....' part.
74642sed 's/syntax error, .*$/syntax error/' expout >at-expout
74643mv at-expout expout
74644# 5. Check
74645{ set +x
74646$as_echo "$at_srcdir/calc.at:614: cat stderr"
74647at_fn_check_prepare_trace "calc.at:614"
74648( $at_check_trace; cat stderr
74649) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74650at_status=$? at_failed=false
74651$at_check_filter
74652at_fn_diff_devnull "$at_stderr" || at_failed=:
74653$at_diff expout "$at_stdout" || at_failed=:
74654at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
74655$at_failed && at_fn_log_failure
74656$at_traceon; }
74657
74658
74659cat >input <<'_ATEOF'
74660error
74661_ATEOF
74662
74663{ set +x
74664$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
74665at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74666( $at_check_trace;  $PREPARSER ./calc input
74667) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74668at_status=$? at_failed=false
74669$at_check_filter
74670echo stderr:; tee stderr <"$at_stderr"
74671at_fn_diff_devnull "$at_stdout" || at_failed=:
74672at_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"
74678at_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>&-
74681at_status=$? at_failed=false
74682$at_check_filter
74683echo stderr:; tee stderr <"$at_stderr"
74684at_fn_diff_devnull "$at_stdout" || at_failed=:
74685at_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.
74694sed '/^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
74709mv at-stderr stderr
74710# 2. Create the reference error message.
74711cat >expout <<'_ATEOF'
747121.1: syntax error, unexpected $undefined
74713_ATEOF
74714
74715# 3. If locations are not used, remove them.
74716sed 's/^[-0-9.]*: //' expout >at-expout
74717mv at-expout expout
74718# 4. If error-verbose is not used, strip the`, unexpected....' part.
74719sed 's/syntax error, .*$/syntax error/' expout >at-expout
74720mv at-expout expout
74721# 5. Check
74722{ set +x
74723$as_echo "$at_srcdir/calc.at:614: cat stderr"
74724at_fn_check_prepare_trace "calc.at:614"
74725( $at_check_trace; cat stderr
74726) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74727at_status=$? at_failed=false
74728$at_check_filter
74729at_fn_diff_devnull "$at_stderr" || at_failed=:
74730$at_diff expout "$at_stdout" || at_failed=:
74731at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
74732$at_failed && at_fn_log_failure
74733$at_traceon; }
74734
74735
74736cat >input <<'_ATEOF'
747371 = 2 = 3
74738_ATEOF
74739
74740{ set +x
74741$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
74742at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74743( $at_check_trace;  $PREPARSER ./calc input
74744) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74745at_status=$? at_failed=false
74746$at_check_filter
74747echo stderr:; tee stderr <"$at_stderr"
74748at_fn_diff_devnull "$at_stdout" || at_failed=:
74749at_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"
74755at_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>&-
74758at_status=$? at_failed=false
74759$at_check_filter
74760echo stderr:; tee stderr <"$at_stderr"
74761at_fn_diff_devnull "$at_stdout" || at_failed=:
74762at_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.
74771sed '/^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
74786mv at-stderr stderr
74787# 2. Create the reference error message.
74788cat >expout <<'_ATEOF'
747891.7: syntax error, unexpected '='
74790_ATEOF
74791
74792# 3. If locations are not used, remove them.
74793sed 's/^[-0-9.]*: //' expout >at-expout
74794mv at-expout expout
74795# 4. If error-verbose is not used, strip the`, unexpected....' part.
74796sed 's/syntax error, .*$/syntax error/' expout >at-expout
74797mv at-expout expout
74798# 5. Check
74799{ set +x
74800$as_echo "$at_srcdir/calc.at:614: cat stderr"
74801at_fn_check_prepare_trace "calc.at:614"
74802( $at_check_trace; cat stderr
74803) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74804at_status=$? at_failed=false
74805$at_check_filter
74806at_fn_diff_devnull "$at_stderr" || at_failed=:
74807$at_diff expout "$at_stdout" || at_failed=:
74808at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
74809$at_failed && at_fn_log_failure
74810$at_traceon; }
74811
74812
74813cat >input <<'_ATEOF'
74814
74815+1
74816_ATEOF
74817
74818{ set +x
74819$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
74820at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74821( $at_check_trace;  $PREPARSER ./calc input
74822) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74823at_status=$? at_failed=false
74824$at_check_filter
74825echo stderr:; tee stderr <"$at_stderr"
74826at_fn_diff_devnull "$at_stdout" || at_failed=:
74827at_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"
74833at_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>&-
74836at_status=$? at_failed=false
74837$at_check_filter
74838echo stderr:; tee stderr <"$at_stderr"
74839at_fn_diff_devnull "$at_stdout" || at_failed=:
74840at_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.
74849sed '/^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
74864mv at-stderr stderr
74865# 2. Create the reference error message.
74866cat >expout <<'_ATEOF'
748672.1: syntax error, unexpected '+'
74868_ATEOF
74869
74870# 3. If locations are not used, remove them.
74871sed 's/^[-0-9.]*: //' expout >at-expout
74872mv at-expout expout
74873# 4. If error-verbose is not used, strip the`, unexpected....' part.
74874sed 's/syntax error, .*$/syntax error/' expout >at-expout
74875mv at-expout expout
74876# 5. Check
74877{ set +x
74878$as_echo "$at_srcdir/calc.at:614: cat stderr"
74879at_fn_check_prepare_trace "calc.at:614"
74880( $at_check_trace; cat stderr
74881) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74882at_status=$? at_failed=false
74883$at_check_filter
74884at_fn_diff_devnull "$at_stderr" || at_failed=:
74885$at_diff expout "$at_stdout" || at_failed=:
74886at_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"
74894at_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>&-
74897at_status=$? at_failed=false
74898$at_check_filter
74899echo stderr:; tee stderr <"$at_stderr"
74900at_fn_diff_devnull "$at_stdout" || at_failed=:
74901at_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"
74907at_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>&-
74910at_status=$? at_failed=false
74911$at_check_filter
74912echo stderr:; tee stderr <"$at_stderr"
74913at_fn_diff_devnull "$at_stdout" || at_failed=:
74914at_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.
74923sed '/^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
74938mv at-stderr stderr
74939# 2. Create the reference error message.
74940cat >expout <<'_ATEOF'
749411.1: syntax error, unexpected end of input
74942_ATEOF
74943
74944# 3. If locations are not used, remove them.
74945sed 's/^[-0-9.]*: //' expout >at-expout
74946mv at-expout expout
74947# 4. If error-verbose is not used, strip the`, unexpected....' part.
74948sed 's/syntax error, .*$/syntax error/' expout >at-expout
74949mv at-expout expout
74950# 5. Check
74951{ set +x
74952$as_echo "$at_srcdir/calc.at:614: cat stderr"
74953at_fn_check_prepare_trace "calc.at:614"
74954( $at_check_trace; cat stderr
74955) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74956at_status=$? at_failed=false
74957$at_check_filter
74958at_fn_diff_devnull "$at_stderr" || at_failed=:
74959$at_diff expout "$at_stdout" || at_failed=:
74960at_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#
74982cat >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"
74988at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
74989( $at_check_trace;  $PREPARSER ./calc input
74990) >>"$at_stdout" 2>>"$at_stderr" 5>&-
74991at_status=$? at_failed=false
74992$at_check_filter
74993echo stderr:; tee stderr <"$at_stderr"
74994at_fn_diff_devnull "$at_stdout" || at_failed=:
74995at_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"
75001at_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>&-
75004at_status=$? at_failed=false
75005$at_check_filter
75006echo stderr:; tee stderr <"$at_stderr"
75007at_fn_diff_devnull "$at_stdout" || at_failed=:
75008at_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.
75017sed '/^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
75032mv at-stderr stderr
75033# 2. Create the reference error message.
75034cat >expout <<'_ATEOF'
750351.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
750361.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
750371.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
750381.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
75039calc: error: 4444 != 1
75040_ATEOF
75041
75042# 3. If locations are not used, remove them.
75043sed 's/^[-0-9.]*: //' expout >at-expout
75044mv at-expout expout
75045# 4. If error-verbose is not used, strip the`, unexpected....' part.
75046sed 's/syntax error, .*$/syntax error/' expout >at-expout
75047mv at-expout expout
75048# 5. Check
75049{ set +x
75050$as_echo "$at_srcdir/calc.at:614: cat stderr"
75051at_fn_check_prepare_trace "calc.at:614"
75052( $at_check_trace; cat stderr
75053) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75054at_status=$? at_failed=false
75055$at_check_filter
75056at_fn_diff_devnull "$at_stderr" || at_failed=:
75057$at_diff expout "$at_stdout" || at_failed=:
75058at_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.
75066cat >input <<'_ATEOF'
75067(!) + (1 2) = 1
75068_ATEOF
75069
75070{ set +x
75071$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
75072at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
75073( $at_check_trace;  $PREPARSER ./calc input
75074) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75075at_status=$? at_failed=false
75076$at_check_filter
75077echo stderr:; tee stderr <"$at_stderr"
75078at_fn_diff_devnull "$at_stdout" || at_failed=:
75079at_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"
75085at_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>&-
75088at_status=$? at_failed=false
75089$at_check_filter
75090echo stderr:; tee stderr <"$at_stderr"
75091at_fn_diff_devnull "$at_stdout" || at_failed=:
75092at_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.
75101sed '/^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
75116mv at-stderr stderr
75117# 2. Create the reference error message.
75118cat >expout <<'_ATEOF'
751191.10: syntax error, unexpected number
75120calc: error: 2222 != 1
75121_ATEOF
75122
75123# 3. If locations are not used, remove them.
75124sed 's/^[-0-9.]*: //' expout >at-expout
75125mv at-expout expout
75126# 4. If error-verbose is not used, strip the`, unexpected....' part.
75127sed 's/syntax error, .*$/syntax error/' expout >at-expout
75128mv at-expout expout
75129# 5. Check
75130{ set +x
75131$as_echo "$at_srcdir/calc.at:614: cat stderr"
75132at_fn_check_prepare_trace "calc.at:614"
75133( $at_check_trace; cat stderr
75134) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75135at_status=$? at_failed=false
75136$at_check_filter
75137at_fn_diff_devnull "$at_stderr" || at_failed=:
75138$at_diff expout "$at_stdout" || at_failed=:
75139at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
75140$at_failed && at_fn_log_failure
75141$at_traceon; }
75142
75143
75144cat >input <<'_ATEOF'
75145(- *) + (1 2) = 1
75146_ATEOF
75147
75148{ set +x
75149$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
75150at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
75151( $at_check_trace;  $PREPARSER ./calc input
75152) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75153at_status=$? at_failed=false
75154$at_check_filter
75155echo stderr:; tee stderr <"$at_stderr"
75156at_fn_diff_devnull "$at_stdout" || at_failed=:
75157at_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"
75163at_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>&-
75166at_status=$? at_failed=false
75167$at_check_filter
75168echo stderr:; tee stderr <"$at_stderr"
75169at_fn_diff_devnull "$at_stdout" || at_failed=:
75170at_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.
75179sed '/^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
75194mv at-stderr stderr
75195# 2. Create the reference error message.
75196cat >expout <<'_ATEOF'
751971.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
751981.12: syntax error, unexpected number
75199calc: error: 2222 != 1
75200_ATEOF
75201
75202# 3. If locations are not used, remove them.
75203sed 's/^[-0-9.]*: //' expout >at-expout
75204mv at-expout expout
75205# 4. If error-verbose is not used, strip the`, unexpected....' part.
75206sed 's/syntax error, .*$/syntax error/' expout >at-expout
75207mv at-expout expout
75208# 5. Check
75209{ set +x
75210$as_echo "$at_srcdir/calc.at:614: cat stderr"
75211at_fn_check_prepare_trace "calc.at:614"
75212( $at_check_trace; cat stderr
75213) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75214at_status=$? at_failed=false
75215$at_check_filter
75216at_fn_diff_devnull "$at_stderr" || at_failed=:
75217$at_diff expout "$at_stdout" || at_failed=:
75218at_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.
75226cat >input <<'_ATEOF'
75227(* *) + (*) + (*)
75228_ATEOF
75229
75230{ set +x
75231$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
75232at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
75233( $at_check_trace;  $PREPARSER ./calc input
75234) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75235at_status=$? at_failed=false
75236$at_check_filter
75237echo stderr:; tee stderr <"$at_stderr"
75238at_fn_diff_devnull "$at_stdout" || at_failed=:
75239at_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"
75245at_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>&-
75248at_status=$? at_failed=false
75249$at_check_filter
75250echo stderr:; tee stderr <"$at_stderr"
75251at_fn_diff_devnull "$at_stdout" || at_failed=:
75252at_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.
75261sed '/^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
75276mv at-stderr stderr
75277# 2. Create the reference error message.
75278cat >expout <<'_ATEOF'
752791.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
752801.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
752811.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
75282_ATEOF
75283
75284# 3. If locations are not used, remove them.
75285sed 's/^[-0-9.]*: //' expout >at-expout
75286mv at-expout expout
75287# 4. If error-verbose is not used, strip the`, unexpected....' part.
75288sed 's/syntax error, .*$/syntax error/' expout >at-expout
75289mv at-expout expout
75290# 5. Check
75291{ set +x
75292$as_echo "$at_srcdir/calc.at:614: cat stderr"
75293at_fn_check_prepare_trace "calc.at:614"
75294( $at_check_trace; cat stderr
75295) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75296at_status=$? at_failed=false
75297$at_check_filter
75298at_fn_diff_devnull "$at_stderr" || at_failed=:
75299$at_diff expout "$at_stdout" || at_failed=:
75300at_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
75311read at_status <"$at_status_file"
75312#AT_STOP_212
75313#AT_START_213
75314at_fn_group_banner 213 'calc.at:615' \
75315  "Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
75316at_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
75330cat >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
75371FILE *input;
75372static int power (int base, int exponent);
75373
75374static void calcerror ( const char *msg);
75375int 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%%
75393input:
75394  line
75395| input line         {  }
75396;
75397
75398line:
75399  '\n'
75400| exp '\n'           { USE ($1); }
75401;
75402
75403exp:
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
75424static int
75425power (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.  */
75437static
75438void 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
75448cat >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
75459int calclex (void);
75460static int get_char (void);
75461static void unget_char ( int c);
75462
75463
75464static YYLTYPE last_yylloc;
75465
75466static int
75467get_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
75484static void
75485unget_char ( int c)
75486{
75487  ;
75488
75489  /* Wrong when C == `\n'. */
75490  (calclloc) = last_yylloc;
75491
75492  ungetc (c, input);
75493}
75494
75495static int
75496read_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
75527int 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
75557cat >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
75576semantic_value global_result = 0;
75577int global_count = 0;
75578
75579/* A C main function.  */
75580int
75581main (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
75619if 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"
75627at_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>&-
75631at_status=$? at_failed=false
75632$at_check_filter
75633echo stderr:; cat "$at_stderr"
75634echo stdout:; cat "$at_stdout"
75635at_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"
75641at_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>&-
75644at_status=$? at_failed=false
75645$at_check_filter
75646echo stderr:; cat "$at_stderr"
75647echo stdout:; cat "$at_stdout"
75648at_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"
75657at_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>&-
75662at_status=$? at_failed=false
75663$at_check_filter
75664at_fn_diff_devnull "$at_stderr" || at_failed=:
75665$at_diff expout "$at_stdout" || at_failed=:
75666at_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"
75675at_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>&-
75680at_status=$? at_failed=false
75681$at_check_filter
75682at_fn_diff_devnull "$at_stderr" || at_failed=:
75683$at_diff expout "$at_stdout" || at_failed=:
75684at_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
75690fi
75691{ set +x
75692$as_echo "$at_srcdir/calc.at:615: bison -o calc.c calc.y"
75693at_fn_check_prepare_trace "calc.at:615"
75694( $at_check_trace; bison -o calc.c calc.y
75695) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75696at_status=$? at_failed=false
75697$at_check_filter
75698at_fn_diff_devnull "$at_stderr" || at_failed=:
75699at_fn_diff_devnull "$at_stdout" || at_failed=:
75700at_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"
75707at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615"
75708( $at_check_trace; $BISON_C_WORKS
75709) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75710at_status=$? at_failed=false
75711$at_check_filter
75712echo stderr:; cat "$at_stderr"
75713echo stdout:; cat "$at_stdout"
75714at_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"
75720at_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>&-
75723at_status=$? at_failed=false
75724$at_check_filter
75725echo stderr:; cat "$at_stderr"
75726echo stdout:; cat "$at_stdout"
75727at_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"
75742at_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>&-
75753at_status=$? at_failed=false
75754$at_check_filter
75755at_fn_diff_devnull "$at_stderr" || at_failed=:
75756at_fn_diff_devnull "$at_stdout" || at_failed=:
75757at_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"
75771at_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>&-
75782at_status=$? at_failed=false
75783$at_check_filter
75784at_fn_diff_devnull "$at_stderr" || at_failed=:
75785at_fn_diff_devnull "$at_stdout" || at_failed=:
75786at_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.
75792cat >input <<'_ATEOF'
757931 + 2 * 3 = 7
757941 + 2 * -3 = -5
75795
75796-1^2 = -1
75797(-1)^2 = 1
75798
75799---1 = -1
75800
758011 - 2 - 3 = -4
758021 - (2 - 3) = 2
75803
758042^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"
75810at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
75811( $at_check_trace;  $PREPARSER ./calc input
75812) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75813at_status=$? at_failed=false
75814$at_check_filter
75815echo stderr:; tee stderr <"$at_stderr"
75816at_fn_diff_devnull "$at_stdout" || at_failed=:
75817at_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"
75823at_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>&-
75826at_status=$? at_failed=false
75827$at_check_filter
75828echo stderr:; tee stderr <"$at_stderr"
75829at_fn_diff_devnull "$at_stdout" || at_failed=:
75830at_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.
75838cat >input <<'_ATEOF'
758391 2
75840_ATEOF
75841
75842{ set +x
75843$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
75844at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
75845( $at_check_trace;  $PREPARSER ./calc input
75846) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75847at_status=$? at_failed=false
75848$at_check_filter
75849echo stderr:; tee stderr <"$at_stderr"
75850at_fn_diff_devnull "$at_stdout" || at_failed=:
75851at_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"
75857at_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>&-
75860at_status=$? at_failed=false
75861$at_check_filter
75862echo stderr:; tee stderr <"$at_stderr"
75863at_fn_diff_devnull "$at_stdout" || at_failed=:
75864at_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.
75873sed '/^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
75888mv at-stderr stderr
75889# 2. Create the reference error message.
75890cat >expout <<'_ATEOF'
758911.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"
75901at_fn_check_prepare_trace "calc.at:615"
75902( $at_check_trace; cat stderr
75903) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75904at_status=$? at_failed=false
75905$at_check_filter
75906at_fn_diff_devnull "$at_stderr" || at_failed=:
75907$at_diff expout "$at_stdout" || at_failed=:
75908at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
75909$at_failed && at_fn_log_failure
75910$at_traceon; }
75911
75912
75913cat >input <<'_ATEOF'
759141//2
75915_ATEOF
75916
75917{ set +x
75918$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
75919at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
75920( $at_check_trace;  $PREPARSER ./calc input
75921) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75922at_status=$? at_failed=false
75923$at_check_filter
75924echo stderr:; tee stderr <"$at_stderr"
75925at_fn_diff_devnull "$at_stdout" || at_failed=:
75926at_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"
75932at_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>&-
75935at_status=$? at_failed=false
75936$at_check_filter
75937echo stderr:; tee stderr <"$at_stderr"
75938at_fn_diff_devnull "$at_stdout" || at_failed=:
75939at_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.
75948sed '/^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
75963mv at-stderr stderr
75964# 2. Create the reference error message.
75965cat >expout <<'_ATEOF'
759661.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"
75976at_fn_check_prepare_trace "calc.at:615"
75977( $at_check_trace; cat stderr
75978) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75979at_status=$? at_failed=false
75980$at_check_filter
75981at_fn_diff_devnull "$at_stderr" || at_failed=:
75982$at_diff expout "$at_stdout" || at_failed=:
75983at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
75984$at_failed && at_fn_log_failure
75985$at_traceon; }
75986
75987
75988cat >input <<'_ATEOF'
75989error
75990_ATEOF
75991
75992{ set +x
75993$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
75994at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
75995( $at_check_trace;  $PREPARSER ./calc input
75996) >>"$at_stdout" 2>>"$at_stderr" 5>&-
75997at_status=$? at_failed=false
75998$at_check_filter
75999echo stderr:; tee stderr <"$at_stderr"
76000at_fn_diff_devnull "$at_stdout" || at_failed=:
76001at_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"
76007at_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>&-
76010at_status=$? at_failed=false
76011$at_check_filter
76012echo stderr:; tee stderr <"$at_stderr"
76013at_fn_diff_devnull "$at_stdout" || at_failed=:
76014at_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.
76023sed '/^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
76038mv at-stderr stderr
76039# 2. Create the reference error message.
76040cat >expout <<'_ATEOF'
760411.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"
76051at_fn_check_prepare_trace "calc.at:615"
76052( $at_check_trace; cat stderr
76053) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76054at_status=$? at_failed=false
76055$at_check_filter
76056at_fn_diff_devnull "$at_stderr" || at_failed=:
76057$at_diff expout "$at_stdout" || at_failed=:
76058at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
76059$at_failed && at_fn_log_failure
76060$at_traceon; }
76061
76062
76063cat >input <<'_ATEOF'
760641 = 2 = 3
76065_ATEOF
76066
76067{ set +x
76068$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
76069at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76070( $at_check_trace;  $PREPARSER ./calc input
76071) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76072at_status=$? at_failed=false
76073$at_check_filter
76074echo stderr:; tee stderr <"$at_stderr"
76075at_fn_diff_devnull "$at_stdout" || at_failed=:
76076at_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"
76082at_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>&-
76085at_status=$? at_failed=false
76086$at_check_filter
76087echo stderr:; tee stderr <"$at_stderr"
76088at_fn_diff_devnull "$at_stdout" || at_failed=:
76089at_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.
76098sed '/^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
76113mv at-stderr stderr
76114# 2. Create the reference error message.
76115cat >expout <<'_ATEOF'
761161.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"
76126at_fn_check_prepare_trace "calc.at:615"
76127( $at_check_trace; cat stderr
76128) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76129at_status=$? at_failed=false
76130$at_check_filter
76131at_fn_diff_devnull "$at_stderr" || at_failed=:
76132$at_diff expout "$at_stdout" || at_failed=:
76133at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
76134$at_failed && at_fn_log_failure
76135$at_traceon; }
76136
76137
76138cat >input <<'_ATEOF'
76139
76140+1
76141_ATEOF
76142
76143{ set +x
76144$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
76145at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76146( $at_check_trace;  $PREPARSER ./calc input
76147) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76148at_status=$? at_failed=false
76149$at_check_filter
76150echo stderr:; tee stderr <"$at_stderr"
76151at_fn_diff_devnull "$at_stdout" || at_failed=:
76152at_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"
76158at_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>&-
76161at_status=$? at_failed=false
76162$at_check_filter
76163echo stderr:; tee stderr <"$at_stderr"
76164at_fn_diff_devnull "$at_stdout" || at_failed=:
76165at_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.
76174sed '/^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
76189mv at-stderr stderr
76190# 2. Create the reference error message.
76191cat >expout <<'_ATEOF'
761922.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"
76202at_fn_check_prepare_trace "calc.at:615"
76203( $at_check_trace; cat stderr
76204) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76205at_status=$? at_failed=false
76206$at_check_filter
76207at_fn_diff_devnull "$at_stderr" || at_failed=:
76208$at_diff expout "$at_stdout" || at_failed=:
76209at_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"
76217at_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>&-
76220at_status=$? at_failed=false
76221$at_check_filter
76222echo stderr:; tee stderr <"$at_stderr"
76223at_fn_diff_devnull "$at_stdout" || at_failed=:
76224at_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"
76230at_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>&-
76233at_status=$? at_failed=false
76234$at_check_filter
76235echo stderr:; tee stderr <"$at_stderr"
76236at_fn_diff_devnull "$at_stdout" || at_failed=:
76237at_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.
76246sed '/^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
76261mv at-stderr stderr
76262# 2. Create the reference error message.
76263cat >expout <<'_ATEOF'
762641.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"
76274at_fn_check_prepare_trace "calc.at:615"
76275( $at_check_trace; cat stderr
76276) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76277at_status=$? at_failed=false
76278$at_check_filter
76279at_fn_diff_devnull "$at_stderr" || at_failed=:
76280$at_diff expout "$at_stdout" || at_failed=:
76281at_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#
76303cat >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"
76309at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76310( $at_check_trace;  $PREPARSER ./calc input
76311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76312at_status=$? at_failed=false
76313$at_check_filter
76314echo stderr:; tee stderr <"$at_stderr"
76315at_fn_diff_devnull "$at_stdout" || at_failed=:
76316at_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"
76322at_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>&-
76325at_status=$? at_failed=false
76326$at_check_filter
76327echo stderr:; tee stderr <"$at_stderr"
76328at_fn_diff_devnull "$at_stdout" || at_failed=:
76329at_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.
76338sed '/^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
76353mv at-stderr stderr
76354# 2. Create the reference error message.
76355cat >expout <<'_ATEOF'
763561.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
763571.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
763581.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
763591.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
76360calc: 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"
76370at_fn_check_prepare_trace "calc.at:615"
76371( $at_check_trace; cat stderr
76372) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76373at_status=$? at_failed=false
76374$at_check_filter
76375at_fn_diff_devnull "$at_stderr" || at_failed=:
76376$at_diff expout "$at_stdout" || at_failed=:
76377at_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.
76385cat >input <<'_ATEOF'
76386(!) + (1 2) = 1
76387_ATEOF
76388
76389{ set +x
76390$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
76391at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76392( $at_check_trace;  $PREPARSER ./calc input
76393) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76394at_status=$? at_failed=false
76395$at_check_filter
76396echo stderr:; tee stderr <"$at_stderr"
76397at_fn_diff_devnull "$at_stdout" || at_failed=:
76398at_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"
76404at_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>&-
76407at_status=$? at_failed=false
76408$at_check_filter
76409echo stderr:; tee stderr <"$at_stderr"
76410at_fn_diff_devnull "$at_stdout" || at_failed=:
76411at_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.
76420sed '/^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
76435mv at-stderr stderr
76436# 2. Create the reference error message.
76437cat >expout <<'_ATEOF'
764381.10: syntax error, unexpected number
76439calc: 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"
76449at_fn_check_prepare_trace "calc.at:615"
76450( $at_check_trace; cat stderr
76451) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76452at_status=$? at_failed=false
76453$at_check_filter
76454at_fn_diff_devnull "$at_stderr" || at_failed=:
76455$at_diff expout "$at_stdout" || at_failed=:
76456at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
76457$at_failed && at_fn_log_failure
76458$at_traceon; }
76459
76460
76461cat >input <<'_ATEOF'
76462(- *) + (1 2) = 1
76463_ATEOF
76464
76465{ set +x
76466$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
76467at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76468( $at_check_trace;  $PREPARSER ./calc input
76469) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76470at_status=$? at_failed=false
76471$at_check_filter
76472echo stderr:; tee stderr <"$at_stderr"
76473at_fn_diff_devnull "$at_stdout" || at_failed=:
76474at_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"
76480at_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>&-
76483at_status=$? at_failed=false
76484$at_check_filter
76485echo stderr:; tee stderr <"$at_stderr"
76486at_fn_diff_devnull "$at_stdout" || at_failed=:
76487at_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.
76496sed '/^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
76511mv at-stderr stderr
76512# 2. Create the reference error message.
76513cat >expout <<'_ATEOF'
765141.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
765151.12: syntax error, unexpected number
76516calc: 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"
76526at_fn_check_prepare_trace "calc.at:615"
76527( $at_check_trace; cat stderr
76528) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76529at_status=$? at_failed=false
76530$at_check_filter
76531at_fn_diff_devnull "$at_stderr" || at_failed=:
76532$at_diff expout "$at_stdout" || at_failed=:
76533at_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.
76541cat >input <<'_ATEOF'
76542(* *) + (*) + (*)
76543_ATEOF
76544
76545{ set +x
76546$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
76547at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
76548( $at_check_trace;  $PREPARSER ./calc input
76549) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76550at_status=$? at_failed=false
76551$at_check_filter
76552echo stderr:; tee stderr <"$at_stderr"
76553at_fn_diff_devnull "$at_stdout" || at_failed=:
76554at_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"
76560at_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>&-
76563at_status=$? at_failed=false
76564$at_check_filter
76565echo stderr:; tee stderr <"$at_stderr"
76566at_fn_diff_devnull "$at_stdout" || at_failed=:
76567at_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.
76576sed '/^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
76591mv at-stderr stderr
76592# 2. Create the reference error message.
76593cat >expout <<'_ATEOF'
765941.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
765951.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
765961.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"
76606at_fn_check_prepare_trace "calc.at:615"
76607( $at_check_trace; cat stderr
76608) >>"$at_stdout" 2>>"$at_stderr" 5>&-
76609at_status=$? at_failed=false
76610$at_check_filter
76611at_fn_diff_devnull "$at_stderr" || at_failed=:
76612$at_diff expout "$at_stdout" || at_failed=:
76613at_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
76624read at_status <"$at_status_file"
76625#AT_STOP_213
76626#AT_START_214
76627at_fn_group_banner 214 'calc.at:616' \
76628  "Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11
76629at_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
76643cat >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
76684FILE *input;
76685static int power (int base, int exponent);
76686
76687static void calcerror ( const char *msg);
76688int 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%%
76706input:
76707  line
76708| input line         {  }
76709;
76710
76711line:
76712  '\n'
76713| exp '\n'           { USE ($1); }
76714;
76715
76716exp:
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
76737static int
76738power (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.  */
76750static
76751void 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
76761cat >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
76772int calclex (void);
76773static int get_char (void);
76774static void unget_char ( int c);
76775
76776
76777static CALCLTYPE last_yylloc;
76778
76779static int
76780get_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
76797static void
76798unget_char ( int c)
76799{
76800  ;
76801
76802  /* Wrong when C == `\n'. */
76803  (calclloc) = last_yylloc;
76804
76805  ungetc (c, input);
76806}
76807
76808static int
76809read_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
76840int 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
76870cat >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
76889semantic_value global_result = 0;
76890int global_count = 0;
76891
76892/* A C main function.  */
76893int
76894main (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
76932if 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"
76940at_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>&-
76944at_status=$? at_failed=false
76945$at_check_filter
76946echo stderr:; cat "$at_stderr"
76947echo stdout:; cat "$at_stdout"
76948at_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"
76954at_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>&-
76957at_status=$? at_failed=false
76958$at_check_filter
76959echo stderr:; cat "$at_stderr"
76960echo stdout:; cat "$at_stdout"
76961at_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"
76970at_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>&-
76975at_status=$? at_failed=false
76976$at_check_filter
76977at_fn_diff_devnull "$at_stderr" || at_failed=:
76978$at_diff expout "$at_stdout" || at_failed=:
76979at_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"
76988at_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>&-
76993at_status=$? at_failed=false
76994$at_check_filter
76995at_fn_diff_devnull "$at_stderr" || at_failed=:
76996$at_diff expout "$at_stdout" || at_failed=:
76997at_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
77003fi
77004{ set +x
77005$as_echo "$at_srcdir/calc.at:616: bison -o calc.c calc.y"
77006at_fn_check_prepare_trace "calc.at:616"
77007( $at_check_trace; bison -o calc.c calc.y
77008) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77009at_status=$? at_failed=false
77010$at_check_filter
77011at_fn_diff_devnull "$at_stderr" || at_failed=:
77012at_fn_diff_devnull "$at_stdout" || at_failed=:
77013at_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"
77020at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:616"
77021( $at_check_trace; $BISON_C_WORKS
77022) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77023at_status=$? at_failed=false
77024$at_check_filter
77025echo stderr:; cat "$at_stderr"
77026echo stdout:; cat "$at_stdout"
77027at_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"
77033at_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>&-
77036at_status=$? at_failed=false
77037$at_check_filter
77038echo stderr:; cat "$at_stderr"
77039echo stdout:; cat "$at_stdout"
77040at_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"
77055at_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>&-
77066at_status=$? at_failed=false
77067$at_check_filter
77068at_fn_diff_devnull "$at_stderr" || at_failed=:
77069at_fn_diff_devnull "$at_stdout" || at_failed=:
77070at_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"
77084at_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>&-
77095at_status=$? at_failed=false
77096$at_check_filter
77097at_fn_diff_devnull "$at_stderr" || at_failed=:
77098at_fn_diff_devnull "$at_stdout" || at_failed=:
77099at_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.
77105cat >input <<'_ATEOF'
771061 + 2 * 3 = 7
771071 + 2 * -3 = -5
77108
77109-1^2 = -1
77110(-1)^2 = 1
77111
77112---1 = -1
77113
771141 - 2 - 3 = -4
771151 - (2 - 3) = 2
77116
771172^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"
77123at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77124( $at_check_trace;  $PREPARSER ./calc input
77125) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77126at_status=$? at_failed=false
77127$at_check_filter
77128echo stderr:; tee stderr <"$at_stderr"
77129at_fn_diff_devnull "$at_stdout" || at_failed=:
77130at_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"
77136at_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>&-
77139at_status=$? at_failed=false
77140$at_check_filter
77141echo stderr:; tee stderr <"$at_stderr"
77142at_fn_diff_devnull "$at_stdout" || at_failed=:
77143at_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.
77151cat >input <<'_ATEOF'
771521 2
77153_ATEOF
77154
77155{ set +x
77156$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77157at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77158( $at_check_trace;  $PREPARSER ./calc input
77159) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77160at_status=$? at_failed=false
77161$at_check_filter
77162echo stderr:; tee stderr <"$at_stderr"
77163at_fn_diff_devnull "$at_stdout" || at_failed=:
77164at_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"
77170at_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>&-
77173at_status=$? at_failed=false
77174$at_check_filter
77175echo stderr:; tee stderr <"$at_stderr"
77176at_fn_diff_devnull "$at_stdout" || at_failed=:
77177at_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.
77186sed '/^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
77201mv at-stderr stderr
77202# 2. Create the reference error message.
77203cat >expout <<'_ATEOF'
772041.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"
77214at_fn_check_prepare_trace "calc.at:616"
77215( $at_check_trace; cat stderr
77216) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77217at_status=$? at_failed=false
77218$at_check_filter
77219at_fn_diff_devnull "$at_stderr" || at_failed=:
77220$at_diff expout "$at_stdout" || at_failed=:
77221at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
77222$at_failed && at_fn_log_failure
77223$at_traceon; }
77224
77225
77226cat >input <<'_ATEOF'
772271//2
77228_ATEOF
77229
77230{ set +x
77231$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77232at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77233( $at_check_trace;  $PREPARSER ./calc input
77234) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77235at_status=$? at_failed=false
77236$at_check_filter
77237echo stderr:; tee stderr <"$at_stderr"
77238at_fn_diff_devnull "$at_stdout" || at_failed=:
77239at_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"
77245at_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>&-
77248at_status=$? at_failed=false
77249$at_check_filter
77250echo stderr:; tee stderr <"$at_stderr"
77251at_fn_diff_devnull "$at_stdout" || at_failed=:
77252at_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.
77261sed '/^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
77276mv at-stderr stderr
77277# 2. Create the reference error message.
77278cat >expout <<'_ATEOF'
772791.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"
77289at_fn_check_prepare_trace "calc.at:616"
77290( $at_check_trace; cat stderr
77291) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77292at_status=$? at_failed=false
77293$at_check_filter
77294at_fn_diff_devnull "$at_stderr" || at_failed=:
77295$at_diff expout "$at_stdout" || at_failed=:
77296at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
77297$at_failed && at_fn_log_failure
77298$at_traceon; }
77299
77300
77301cat >input <<'_ATEOF'
77302error
77303_ATEOF
77304
77305{ set +x
77306$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77307at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77308( $at_check_trace;  $PREPARSER ./calc input
77309) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77310at_status=$? at_failed=false
77311$at_check_filter
77312echo stderr:; tee stderr <"$at_stderr"
77313at_fn_diff_devnull "$at_stdout" || at_failed=:
77314at_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"
77320at_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>&-
77323at_status=$? at_failed=false
77324$at_check_filter
77325echo stderr:; tee stderr <"$at_stderr"
77326at_fn_diff_devnull "$at_stdout" || at_failed=:
77327at_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.
77336sed '/^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
77351mv at-stderr stderr
77352# 2. Create the reference error message.
77353cat >expout <<'_ATEOF'
773541.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"
77364at_fn_check_prepare_trace "calc.at:616"
77365( $at_check_trace; cat stderr
77366) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77367at_status=$? at_failed=false
77368$at_check_filter
77369at_fn_diff_devnull "$at_stderr" || at_failed=:
77370$at_diff expout "$at_stdout" || at_failed=:
77371at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
77372$at_failed && at_fn_log_failure
77373$at_traceon; }
77374
77375
77376cat >input <<'_ATEOF'
773771 = 2 = 3
77378_ATEOF
77379
77380{ set +x
77381$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77382at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77383( $at_check_trace;  $PREPARSER ./calc input
77384) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77385at_status=$? at_failed=false
77386$at_check_filter
77387echo stderr:; tee stderr <"$at_stderr"
77388at_fn_diff_devnull "$at_stdout" || at_failed=:
77389at_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"
77395at_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>&-
77398at_status=$? at_failed=false
77399$at_check_filter
77400echo stderr:; tee stderr <"$at_stderr"
77401at_fn_diff_devnull "$at_stdout" || at_failed=:
77402at_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.
77411sed '/^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
77426mv at-stderr stderr
77427# 2. Create the reference error message.
77428cat >expout <<'_ATEOF'
774291.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"
77439at_fn_check_prepare_trace "calc.at:616"
77440( $at_check_trace; cat stderr
77441) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77442at_status=$? at_failed=false
77443$at_check_filter
77444at_fn_diff_devnull "$at_stderr" || at_failed=:
77445$at_diff expout "$at_stdout" || at_failed=:
77446at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
77447$at_failed && at_fn_log_failure
77448$at_traceon; }
77449
77450
77451cat >input <<'_ATEOF'
77452
77453+1
77454_ATEOF
77455
77456{ set +x
77457$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77458at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77459( $at_check_trace;  $PREPARSER ./calc input
77460) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77461at_status=$? at_failed=false
77462$at_check_filter
77463echo stderr:; tee stderr <"$at_stderr"
77464at_fn_diff_devnull "$at_stdout" || at_failed=:
77465at_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"
77471at_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>&-
77474at_status=$? at_failed=false
77475$at_check_filter
77476echo stderr:; tee stderr <"$at_stderr"
77477at_fn_diff_devnull "$at_stdout" || at_failed=:
77478at_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.
77487sed '/^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
77502mv at-stderr stderr
77503# 2. Create the reference error message.
77504cat >expout <<'_ATEOF'
775052.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"
77515at_fn_check_prepare_trace "calc.at:616"
77516( $at_check_trace; cat stderr
77517) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77518at_status=$? at_failed=false
77519$at_check_filter
77520at_fn_diff_devnull "$at_stderr" || at_failed=:
77521$at_diff expout "$at_stdout" || at_failed=:
77522at_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"
77530at_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>&-
77533at_status=$? at_failed=false
77534$at_check_filter
77535echo stderr:; tee stderr <"$at_stderr"
77536at_fn_diff_devnull "$at_stdout" || at_failed=:
77537at_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"
77543at_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>&-
77546at_status=$? at_failed=false
77547$at_check_filter
77548echo stderr:; tee stderr <"$at_stderr"
77549at_fn_diff_devnull "$at_stdout" || at_failed=:
77550at_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.
77559sed '/^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
77574mv at-stderr stderr
77575# 2. Create the reference error message.
77576cat >expout <<'_ATEOF'
775771.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"
77587at_fn_check_prepare_trace "calc.at:616"
77588( $at_check_trace; cat stderr
77589) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77590at_status=$? at_failed=false
77591$at_check_filter
77592at_fn_diff_devnull "$at_stderr" || at_failed=:
77593$at_diff expout "$at_stdout" || at_failed=:
77594at_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#
77616cat >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"
77622at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77623( $at_check_trace;  $PREPARSER ./calc input
77624) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77625at_status=$? at_failed=false
77626$at_check_filter
77627echo stderr:; tee stderr <"$at_stderr"
77628at_fn_diff_devnull "$at_stdout" || at_failed=:
77629at_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"
77635at_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>&-
77638at_status=$? at_failed=false
77639$at_check_filter
77640echo stderr:; tee stderr <"$at_stderr"
77641at_fn_diff_devnull "$at_stdout" || at_failed=:
77642at_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.
77651sed '/^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
77666mv at-stderr stderr
77667# 2. Create the reference error message.
77668cat >expout <<'_ATEOF'
776691.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
776701.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
776711.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
776721.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
77673calc: 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"
77683at_fn_check_prepare_trace "calc.at:616"
77684( $at_check_trace; cat stderr
77685) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77686at_status=$? at_failed=false
77687$at_check_filter
77688at_fn_diff_devnull "$at_stderr" || at_failed=:
77689$at_diff expout "$at_stdout" || at_failed=:
77690at_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.
77698cat >input <<'_ATEOF'
77699(!) + (1 2) = 1
77700_ATEOF
77701
77702{ set +x
77703$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77704at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77705( $at_check_trace;  $PREPARSER ./calc input
77706) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77707at_status=$? at_failed=false
77708$at_check_filter
77709echo stderr:; tee stderr <"$at_stderr"
77710at_fn_diff_devnull "$at_stdout" || at_failed=:
77711at_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"
77717at_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>&-
77720at_status=$? at_failed=false
77721$at_check_filter
77722echo stderr:; tee stderr <"$at_stderr"
77723at_fn_diff_devnull "$at_stdout" || at_failed=:
77724at_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.
77733sed '/^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
77748mv at-stderr stderr
77749# 2. Create the reference error message.
77750cat >expout <<'_ATEOF'
777511.10: syntax error, unexpected number
77752calc: 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"
77762at_fn_check_prepare_trace "calc.at:616"
77763( $at_check_trace; cat stderr
77764) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77765at_status=$? at_failed=false
77766$at_check_filter
77767at_fn_diff_devnull "$at_stderr" || at_failed=:
77768$at_diff expout "$at_stdout" || at_failed=:
77769at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
77770$at_failed && at_fn_log_failure
77771$at_traceon; }
77772
77773
77774cat >input <<'_ATEOF'
77775(- *) + (1 2) = 1
77776_ATEOF
77777
77778{ set +x
77779$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77780at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77781( $at_check_trace;  $PREPARSER ./calc input
77782) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77783at_status=$? at_failed=false
77784$at_check_filter
77785echo stderr:; tee stderr <"$at_stderr"
77786at_fn_diff_devnull "$at_stdout" || at_failed=:
77787at_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"
77793at_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>&-
77796at_status=$? at_failed=false
77797$at_check_filter
77798echo stderr:; tee stderr <"$at_stderr"
77799at_fn_diff_devnull "$at_stdout" || at_failed=:
77800at_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.
77809sed '/^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
77824mv at-stderr stderr
77825# 2. Create the reference error message.
77826cat >expout <<'_ATEOF'
778271.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
778281.12: syntax error, unexpected number
77829calc: 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"
77839at_fn_check_prepare_trace "calc.at:616"
77840( $at_check_trace; cat stderr
77841) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77842at_status=$? at_failed=false
77843$at_check_filter
77844at_fn_diff_devnull "$at_stderr" || at_failed=:
77845$at_diff expout "$at_stdout" || at_failed=:
77846at_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.
77854cat >input <<'_ATEOF'
77855(* *) + (*) + (*)
77856_ATEOF
77857
77858{ set +x
77859$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
77860at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
77861( $at_check_trace;  $PREPARSER ./calc input
77862) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77863at_status=$? at_failed=false
77864$at_check_filter
77865echo stderr:; tee stderr <"$at_stderr"
77866at_fn_diff_devnull "$at_stdout" || at_failed=:
77867at_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"
77873at_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>&-
77876at_status=$? at_failed=false
77877$at_check_filter
77878echo stderr:; tee stderr <"$at_stderr"
77879at_fn_diff_devnull "$at_stdout" || at_failed=:
77880at_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.
77889sed '/^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
77904mv at-stderr stderr
77905# 2. Create the reference error message.
77906cat >expout <<'_ATEOF'
779071.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
779081.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
779091.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"
77919at_fn_check_prepare_trace "calc.at:616"
77920( $at_check_trace; cat stderr
77921) >>"$at_stdout" 2>>"$at_stderr" 5>&-
77922at_status=$? at_failed=false
77923$at_check_filter
77924at_fn_diff_devnull "$at_stderr" || at_failed=:
77925$at_diff expout "$at_stdout" || at_failed=:
77926at_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
77937read at_status <"$at_status_file"
77938#AT_STOP_214
77939#AT_START_215
77940at_fn_group_banner 215 'calc.at:618' \
77941  "Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
77942at_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
77956cat >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
77997FILE *input;
77998static int power (int base, int exponent);
77999
78000static void calcerror (YYLTYPE const * const llocp,  const char *msg);
78001int 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%%
78019input:
78020  line
78021| input line         {  }
78022;
78023
78024line:
78025  '\n'
78026| exp '\n'           { USE ($1); }
78027;
78028
78029exp:
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
78050static int
78051power (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.  */
78063static
78064void 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
78074cat >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
78085int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
78086static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
78087static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
78088
78089
78090static YYLTYPE last_yylloc;
78091
78092static int
78093get_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
78110static void
78111unget_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
78121static int
78122read_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
78153int 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
78183cat >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
78202semantic_value global_result = 0;
78203int global_count = 0;
78204
78205/* A C main function.  */
78206int
78207main (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
78245if 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"
78253at_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>&-
78257at_status=$? at_failed=false
78258$at_check_filter
78259echo stderr:; cat "$at_stderr"
78260echo stdout:; cat "$at_stdout"
78261at_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"
78267at_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>&-
78270at_status=$? at_failed=false
78271$at_check_filter
78272echo stderr:; cat "$at_stderr"
78273echo stdout:; cat "$at_stdout"
78274at_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"
78283at_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>&-
78288at_status=$? at_failed=false
78289$at_check_filter
78290at_fn_diff_devnull "$at_stderr" || at_failed=:
78291$at_diff expout "$at_stdout" || at_failed=:
78292at_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"
78301at_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>&-
78306at_status=$? at_failed=false
78307$at_check_filter
78308at_fn_diff_devnull "$at_stderr" || at_failed=:
78309$at_diff expout "$at_stdout" || at_failed=:
78310at_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
78316fi
78317{ set +x
78318$as_echo "$at_srcdir/calc.at:618: bison -o calc.c calc.y"
78319at_fn_check_prepare_trace "calc.at:618"
78320( $at_check_trace; bison -o calc.c calc.y
78321) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78322at_status=$? at_failed=false
78323$at_check_filter
78324at_fn_diff_devnull "$at_stderr" || at_failed=:
78325at_fn_diff_devnull "$at_stdout" || at_failed=:
78326at_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"
78333at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618"
78334( $at_check_trace; $BISON_C_WORKS
78335) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78336at_status=$? at_failed=false
78337$at_check_filter
78338echo stderr:; cat "$at_stderr"
78339echo stdout:; cat "$at_stdout"
78340at_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"
78346at_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>&-
78349at_status=$? at_failed=false
78350$at_check_filter
78351echo stderr:; cat "$at_stderr"
78352echo stdout:; cat "$at_stdout"
78353at_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"
78368at_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>&-
78379at_status=$? at_failed=false
78380$at_check_filter
78381at_fn_diff_devnull "$at_stderr" || at_failed=:
78382at_fn_diff_devnull "$at_stdout" || at_failed=:
78383at_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"
78397at_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>&-
78408at_status=$? at_failed=false
78409$at_check_filter
78410at_fn_diff_devnull "$at_stderr" || at_failed=:
78411at_fn_diff_devnull "$at_stdout" || at_failed=:
78412at_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.
78418cat >input <<'_ATEOF'
784191 + 2 * 3 = 7
784201 + 2 * -3 = -5
78421
78422-1^2 = -1
78423(-1)^2 = 1
78424
78425---1 = -1
78426
784271 - 2 - 3 = -4
784281 - (2 - 3) = 2
78429
784302^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"
78436at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78437( $at_check_trace;  $PREPARSER ./calc input
78438) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78439at_status=$? at_failed=false
78440$at_check_filter
78441echo stderr:; tee stderr <"$at_stderr"
78442at_fn_diff_devnull "$at_stdout" || at_failed=:
78443at_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"
78449at_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>&-
78452at_status=$? at_failed=false
78453$at_check_filter
78454echo stderr:; tee stderr <"$at_stderr"
78455at_fn_diff_devnull "$at_stdout" || at_failed=:
78456at_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.
78464cat >input <<'_ATEOF'
784651 2
78466_ATEOF
78467
78468{ set +x
78469$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
78470at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78471( $at_check_trace;  $PREPARSER ./calc input
78472) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78473at_status=$? at_failed=false
78474$at_check_filter
78475echo stderr:; tee stderr <"$at_stderr"
78476at_fn_diff_devnull "$at_stdout" || at_failed=:
78477at_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"
78483at_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>&-
78486at_status=$? at_failed=false
78487$at_check_filter
78488echo stderr:; tee stderr <"$at_stderr"
78489at_fn_diff_devnull "$at_stdout" || at_failed=:
78490at_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.
78499sed '/^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
78514mv at-stderr stderr
78515# 2. Create the reference error message.
78516cat >expout <<'_ATEOF'
785171.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.
78523sed 's/syntax error, .*$/syntax error/' expout >at-expout
78524mv at-expout expout
78525# 5. Check
78526{ set +x
78527$as_echo "$at_srcdir/calc.at:618: cat stderr"
78528at_fn_check_prepare_trace "calc.at:618"
78529( $at_check_trace; cat stderr
78530) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78531at_status=$? at_failed=false
78532$at_check_filter
78533at_fn_diff_devnull "$at_stderr" || at_failed=:
78534$at_diff expout "$at_stdout" || at_failed=:
78535at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
78536$at_failed && at_fn_log_failure
78537$at_traceon; }
78538
78539
78540cat >input <<'_ATEOF'
785411//2
78542_ATEOF
78543
78544{ set +x
78545$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
78546at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78547( $at_check_trace;  $PREPARSER ./calc input
78548) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78549at_status=$? at_failed=false
78550$at_check_filter
78551echo stderr:; tee stderr <"$at_stderr"
78552at_fn_diff_devnull "$at_stdout" || at_failed=:
78553at_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"
78559at_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>&-
78562at_status=$? at_failed=false
78563$at_check_filter
78564echo stderr:; tee stderr <"$at_stderr"
78565at_fn_diff_devnull "$at_stdout" || at_failed=:
78566at_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.
78575sed '/^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
78590mv at-stderr stderr
78591# 2. Create the reference error message.
78592cat >expout <<'_ATEOF'
785931.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.
78599sed 's/syntax error, .*$/syntax error/' expout >at-expout
78600mv at-expout expout
78601# 5. Check
78602{ set +x
78603$as_echo "$at_srcdir/calc.at:618: cat stderr"
78604at_fn_check_prepare_trace "calc.at:618"
78605( $at_check_trace; cat stderr
78606) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78607at_status=$? at_failed=false
78608$at_check_filter
78609at_fn_diff_devnull "$at_stderr" || at_failed=:
78610$at_diff expout "$at_stdout" || at_failed=:
78611at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
78612$at_failed && at_fn_log_failure
78613$at_traceon; }
78614
78615
78616cat >input <<'_ATEOF'
78617error
78618_ATEOF
78619
78620{ set +x
78621$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
78622at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78623( $at_check_trace;  $PREPARSER ./calc input
78624) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78625at_status=$? at_failed=false
78626$at_check_filter
78627echo stderr:; tee stderr <"$at_stderr"
78628at_fn_diff_devnull "$at_stdout" || at_failed=:
78629at_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"
78635at_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>&-
78638at_status=$? at_failed=false
78639$at_check_filter
78640echo stderr:; tee stderr <"$at_stderr"
78641at_fn_diff_devnull "$at_stdout" || at_failed=:
78642at_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.
78651sed '/^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
78666mv at-stderr stderr
78667# 2. Create the reference error message.
78668cat >expout <<'_ATEOF'
786691.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.
78675sed 's/syntax error, .*$/syntax error/' expout >at-expout
78676mv at-expout expout
78677# 5. Check
78678{ set +x
78679$as_echo "$at_srcdir/calc.at:618: cat stderr"
78680at_fn_check_prepare_trace "calc.at:618"
78681( $at_check_trace; cat stderr
78682) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78683at_status=$? at_failed=false
78684$at_check_filter
78685at_fn_diff_devnull "$at_stderr" || at_failed=:
78686$at_diff expout "$at_stdout" || at_failed=:
78687at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
78688$at_failed && at_fn_log_failure
78689$at_traceon; }
78690
78691
78692cat >input <<'_ATEOF'
786931 = 2 = 3
78694_ATEOF
78695
78696{ set +x
78697$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
78698at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78699( $at_check_trace;  $PREPARSER ./calc input
78700) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78701at_status=$? at_failed=false
78702$at_check_filter
78703echo stderr:; tee stderr <"$at_stderr"
78704at_fn_diff_devnull "$at_stdout" || at_failed=:
78705at_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"
78711at_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>&-
78714at_status=$? at_failed=false
78715$at_check_filter
78716echo stderr:; tee stderr <"$at_stderr"
78717at_fn_diff_devnull "$at_stdout" || at_failed=:
78718at_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.
78727sed '/^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
78742mv at-stderr stderr
78743# 2. Create the reference error message.
78744cat >expout <<'_ATEOF'
787451.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.
78751sed 's/syntax error, .*$/syntax error/' expout >at-expout
78752mv at-expout expout
78753# 5. Check
78754{ set +x
78755$as_echo "$at_srcdir/calc.at:618: cat stderr"
78756at_fn_check_prepare_trace "calc.at:618"
78757( $at_check_trace; cat stderr
78758) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78759at_status=$? at_failed=false
78760$at_check_filter
78761at_fn_diff_devnull "$at_stderr" || at_failed=:
78762$at_diff expout "$at_stdout" || at_failed=:
78763at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
78764$at_failed && at_fn_log_failure
78765$at_traceon; }
78766
78767
78768cat >input <<'_ATEOF'
78769
78770+1
78771_ATEOF
78772
78773{ set +x
78774$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
78775at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78776( $at_check_trace;  $PREPARSER ./calc input
78777) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78778at_status=$? at_failed=false
78779$at_check_filter
78780echo stderr:; tee stderr <"$at_stderr"
78781at_fn_diff_devnull "$at_stdout" || at_failed=:
78782at_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"
78788at_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>&-
78791at_status=$? at_failed=false
78792$at_check_filter
78793echo stderr:; tee stderr <"$at_stderr"
78794at_fn_diff_devnull "$at_stdout" || at_failed=:
78795at_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.
78804sed '/^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
78819mv at-stderr stderr
78820# 2. Create the reference error message.
78821cat >expout <<'_ATEOF'
788222.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.
78828sed 's/syntax error, .*$/syntax error/' expout >at-expout
78829mv at-expout expout
78830# 5. Check
78831{ set +x
78832$as_echo "$at_srcdir/calc.at:618: cat stderr"
78833at_fn_check_prepare_trace "calc.at:618"
78834( $at_check_trace; cat stderr
78835) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78836at_status=$? at_failed=false
78837$at_check_filter
78838at_fn_diff_devnull "$at_stderr" || at_failed=:
78839$at_diff expout "$at_stdout" || at_failed=:
78840at_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"
78848at_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>&-
78851at_status=$? at_failed=false
78852$at_check_filter
78853echo stderr:; tee stderr <"$at_stderr"
78854at_fn_diff_devnull "$at_stdout" || at_failed=:
78855at_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"
78861at_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>&-
78864at_status=$? at_failed=false
78865$at_check_filter
78866echo stderr:; tee stderr <"$at_stderr"
78867at_fn_diff_devnull "$at_stdout" || at_failed=:
78868at_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.
78877sed '/^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
78892mv at-stderr stderr
78893# 2. Create the reference error message.
78894cat >expout <<'_ATEOF'
788951.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.
78901sed 's/syntax error, .*$/syntax error/' expout >at-expout
78902mv at-expout expout
78903# 5. Check
78904{ set +x
78905$as_echo "$at_srcdir/calc.at:618: cat stderr"
78906at_fn_check_prepare_trace "calc.at:618"
78907( $at_check_trace; cat stderr
78908) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78909at_status=$? at_failed=false
78910$at_check_filter
78911at_fn_diff_devnull "$at_stderr" || at_failed=:
78912$at_diff expout "$at_stdout" || at_failed=:
78913at_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#
78935cat >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"
78941at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
78942( $at_check_trace;  $PREPARSER ./calc input
78943) >>"$at_stdout" 2>>"$at_stderr" 5>&-
78944at_status=$? at_failed=false
78945$at_check_filter
78946echo stderr:; tee stderr <"$at_stderr"
78947at_fn_diff_devnull "$at_stdout" || at_failed=:
78948at_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"
78954at_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>&-
78957at_status=$? at_failed=false
78958$at_check_filter
78959echo stderr:; tee stderr <"$at_stderr"
78960at_fn_diff_devnull "$at_stdout" || at_failed=:
78961at_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.
78970sed '/^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
78985mv at-stderr stderr
78986# 2. Create the reference error message.
78987cat >expout <<'_ATEOF'
789881.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
789891.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
789901.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
789911.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
78992calc: 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.
78998sed 's/syntax error, .*$/syntax error/' expout >at-expout
78999mv at-expout expout
79000# 5. Check
79001{ set +x
79002$as_echo "$at_srcdir/calc.at:618: cat stderr"
79003at_fn_check_prepare_trace "calc.at:618"
79004( $at_check_trace; cat stderr
79005) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79006at_status=$? at_failed=false
79007$at_check_filter
79008at_fn_diff_devnull "$at_stderr" || at_failed=:
79009$at_diff expout "$at_stdout" || at_failed=:
79010at_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.
79018cat >input <<'_ATEOF'
79019(!) + (1 2) = 1
79020_ATEOF
79021
79022{ set +x
79023$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
79024at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
79025( $at_check_trace;  $PREPARSER ./calc input
79026) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79027at_status=$? at_failed=false
79028$at_check_filter
79029echo stderr:; tee stderr <"$at_stderr"
79030at_fn_diff_devnull "$at_stdout" || at_failed=:
79031at_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"
79037at_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>&-
79040at_status=$? at_failed=false
79041$at_check_filter
79042echo stderr:; tee stderr <"$at_stderr"
79043at_fn_diff_devnull "$at_stdout" || at_failed=:
79044at_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.
79053sed '/^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
79068mv at-stderr stderr
79069# 2. Create the reference error message.
79070cat >expout <<'_ATEOF'
790711.10: syntax error, unexpected number
79072calc: 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.
79078sed 's/syntax error, .*$/syntax error/' expout >at-expout
79079mv at-expout expout
79080# 5. Check
79081{ set +x
79082$as_echo "$at_srcdir/calc.at:618: cat stderr"
79083at_fn_check_prepare_trace "calc.at:618"
79084( $at_check_trace; cat stderr
79085) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79086at_status=$? at_failed=false
79087$at_check_filter
79088at_fn_diff_devnull "$at_stderr" || at_failed=:
79089$at_diff expout "$at_stdout" || at_failed=:
79090at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
79091$at_failed && at_fn_log_failure
79092$at_traceon; }
79093
79094
79095cat >input <<'_ATEOF'
79096(- *) + (1 2) = 1
79097_ATEOF
79098
79099{ set +x
79100$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
79101at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
79102( $at_check_trace;  $PREPARSER ./calc input
79103) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79104at_status=$? at_failed=false
79105$at_check_filter
79106echo stderr:; tee stderr <"$at_stderr"
79107at_fn_diff_devnull "$at_stdout" || at_failed=:
79108at_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"
79114at_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>&-
79117at_status=$? at_failed=false
79118$at_check_filter
79119echo stderr:; tee stderr <"$at_stderr"
79120at_fn_diff_devnull "$at_stdout" || at_failed=:
79121at_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.
79130sed '/^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
79145mv at-stderr stderr
79146# 2. Create the reference error message.
79147cat >expout <<'_ATEOF'
791481.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
791491.12: syntax error, unexpected number
79150calc: 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.
79156sed 's/syntax error, .*$/syntax error/' expout >at-expout
79157mv at-expout expout
79158# 5. Check
79159{ set +x
79160$as_echo "$at_srcdir/calc.at:618: cat stderr"
79161at_fn_check_prepare_trace "calc.at:618"
79162( $at_check_trace; cat stderr
79163) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79164at_status=$? at_failed=false
79165$at_check_filter
79166at_fn_diff_devnull "$at_stderr" || at_failed=:
79167$at_diff expout "$at_stdout" || at_failed=:
79168at_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.
79176cat >input <<'_ATEOF'
79177(* *) + (*) + (*)
79178_ATEOF
79179
79180{ set +x
79181$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
79182at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
79183( $at_check_trace;  $PREPARSER ./calc input
79184) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79185at_status=$? at_failed=false
79186$at_check_filter
79187echo stderr:; tee stderr <"$at_stderr"
79188at_fn_diff_devnull "$at_stdout" || at_failed=:
79189at_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"
79195at_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>&-
79198at_status=$? at_failed=false
79199$at_check_filter
79200echo stderr:; tee stderr <"$at_stderr"
79201at_fn_diff_devnull "$at_stdout" || at_failed=:
79202at_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.
79211sed '/^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
79226mv at-stderr stderr
79227# 2. Create the reference error message.
79228cat >expout <<'_ATEOF'
792291.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
792301.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
792311.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.
79237sed 's/syntax error, .*$/syntax error/' expout >at-expout
79238mv at-expout expout
79239# 5. Check
79240{ set +x
79241$as_echo "$at_srcdir/calc.at:618: cat stderr"
79242at_fn_check_prepare_trace "calc.at:618"
79243( $at_check_trace; cat stderr
79244) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79245at_status=$? at_failed=false
79246$at_check_filter
79247at_fn_diff_devnull "$at_stderr" || at_failed=:
79248$at_diff expout "$at_stdout" || at_failed=:
79249at_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
79260read at_status <"$at_status_file"
79261#AT_STOP_215
79262#AT_START_216
79263at_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
79265at_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
79279cat >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
79320FILE *input;
79321static int power (int base, int exponent);
79322
79323static void calcerror (CALCLTYPE const * const llocp,  const char *msg);
79324int 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%%
79342input:
79343  line
79344| input line         {  }
79345;
79346
79347line:
79348  '\n'
79349| exp '\n'           { USE ($1); }
79350;
79351
79352exp:
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
79373static int
79374power (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.  */
79386static
79387void 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
79397cat >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
79408int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
79409static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
79410static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
79411
79412
79413static CALCLTYPE last_yylloc;
79414
79415static int
79416get_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
79433static void
79434unget_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
79444static int
79445read_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
79476int 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
79506cat >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
79525semantic_value global_result = 0;
79526int global_count = 0;
79527
79528/* A C main function.  */
79529int
79530main (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
79568if 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"
79576at_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>&-
79580at_status=$? at_failed=false
79581$at_check_filter
79582echo stderr:; cat "$at_stderr"
79583echo stdout:; cat "$at_stdout"
79584at_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"
79590at_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>&-
79593at_status=$? at_failed=false
79594$at_check_filter
79595echo stderr:; cat "$at_stderr"
79596echo stdout:; cat "$at_stdout"
79597at_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"
79606at_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>&-
79611at_status=$? at_failed=false
79612$at_check_filter
79613at_fn_diff_devnull "$at_stderr" || at_failed=:
79614$at_diff expout "$at_stdout" || at_failed=:
79615at_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"
79624at_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>&-
79629at_status=$? at_failed=false
79630$at_check_filter
79631at_fn_diff_devnull "$at_stderr" || at_failed=:
79632$at_diff expout "$at_stdout" || at_failed=:
79633at_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
79639fi
79640{ set +x
79641$as_echo "$at_srcdir/calc.at:619: bison -o calc.c calc.y"
79642at_fn_check_prepare_trace "calc.at:619"
79643( $at_check_trace; bison -o calc.c calc.y
79644) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79645at_status=$? at_failed=false
79646$at_check_filter
79647at_fn_diff_devnull "$at_stderr" || at_failed=:
79648at_fn_diff_devnull "$at_stdout" || at_failed=:
79649at_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"
79656at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:619"
79657( $at_check_trace; $BISON_C_WORKS
79658) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79659at_status=$? at_failed=false
79660$at_check_filter
79661echo stderr:; cat "$at_stderr"
79662echo stdout:; cat "$at_stdout"
79663at_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"
79669at_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>&-
79672at_status=$? at_failed=false
79673$at_check_filter
79674echo stderr:; cat "$at_stderr"
79675echo stdout:; cat "$at_stdout"
79676at_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"
79691at_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>&-
79702at_status=$? at_failed=false
79703$at_check_filter
79704at_fn_diff_devnull "$at_stderr" || at_failed=:
79705at_fn_diff_devnull "$at_stdout" || at_failed=:
79706at_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"
79720at_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>&-
79731at_status=$? at_failed=false
79732$at_check_filter
79733at_fn_diff_devnull "$at_stderr" || at_failed=:
79734at_fn_diff_devnull "$at_stdout" || at_failed=:
79735at_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.
79741cat >input <<'_ATEOF'
797421 + 2 * 3 = 7
797431 + 2 * -3 = -5
79744
79745-1^2 = -1
79746(-1)^2 = 1
79747
79748---1 = -1
79749
797501 - 2 - 3 = -4
797511 - (2 - 3) = 2
79752
797532^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"
79759at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
79760( $at_check_trace;  $PREPARSER ./calc input
79761) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79762at_status=$? at_failed=false
79763$at_check_filter
79764echo stderr:; tee stderr <"$at_stderr"
79765at_fn_diff_devnull "$at_stdout" || at_failed=:
79766at_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"
79772at_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>&-
79775at_status=$? at_failed=false
79776$at_check_filter
79777echo stderr:; tee stderr <"$at_stderr"
79778at_fn_diff_devnull "$at_stdout" || at_failed=:
79779at_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.
79787cat >input <<'_ATEOF'
797881 2
79789_ATEOF
79790
79791{ set +x
79792$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
79793at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
79794( $at_check_trace;  $PREPARSER ./calc input
79795) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79796at_status=$? at_failed=false
79797$at_check_filter
79798echo stderr:; tee stderr <"$at_stderr"
79799at_fn_diff_devnull "$at_stdout" || at_failed=:
79800at_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"
79806at_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>&-
79809at_status=$? at_failed=false
79810$at_check_filter
79811echo stderr:; tee stderr <"$at_stderr"
79812at_fn_diff_devnull "$at_stdout" || at_failed=:
79813at_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.
79822sed '/^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
79837mv at-stderr stderr
79838# 2. Create the reference error message.
79839cat >expout <<'_ATEOF'
798401.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.
79846sed 's/syntax error, .*$/syntax error/' expout >at-expout
79847mv at-expout expout
79848# 5. Check
79849{ set +x
79850$as_echo "$at_srcdir/calc.at:619: cat stderr"
79851at_fn_check_prepare_trace "calc.at:619"
79852( $at_check_trace; cat stderr
79853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79854at_status=$? at_failed=false
79855$at_check_filter
79856at_fn_diff_devnull "$at_stderr" || at_failed=:
79857$at_diff expout "$at_stdout" || at_failed=:
79858at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
79859$at_failed && at_fn_log_failure
79860$at_traceon; }
79861
79862
79863cat >input <<'_ATEOF'
798641//2
79865_ATEOF
79866
79867{ set +x
79868$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
79869at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
79870( $at_check_trace;  $PREPARSER ./calc input
79871) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79872at_status=$? at_failed=false
79873$at_check_filter
79874echo stderr:; tee stderr <"$at_stderr"
79875at_fn_diff_devnull "$at_stdout" || at_failed=:
79876at_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"
79882at_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>&-
79885at_status=$? at_failed=false
79886$at_check_filter
79887echo stderr:; tee stderr <"$at_stderr"
79888at_fn_diff_devnull "$at_stdout" || at_failed=:
79889at_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.
79898sed '/^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
79913mv at-stderr stderr
79914# 2. Create the reference error message.
79915cat >expout <<'_ATEOF'
799161.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.
79922sed 's/syntax error, .*$/syntax error/' expout >at-expout
79923mv at-expout expout
79924# 5. Check
79925{ set +x
79926$as_echo "$at_srcdir/calc.at:619: cat stderr"
79927at_fn_check_prepare_trace "calc.at:619"
79928( $at_check_trace; cat stderr
79929) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79930at_status=$? at_failed=false
79931$at_check_filter
79932at_fn_diff_devnull "$at_stderr" || at_failed=:
79933$at_diff expout "$at_stdout" || at_failed=:
79934at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
79935$at_failed && at_fn_log_failure
79936$at_traceon; }
79937
79938
79939cat >input <<'_ATEOF'
79940error
79941_ATEOF
79942
79943{ set +x
79944$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
79945at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
79946( $at_check_trace;  $PREPARSER ./calc input
79947) >>"$at_stdout" 2>>"$at_stderr" 5>&-
79948at_status=$? at_failed=false
79949$at_check_filter
79950echo stderr:; tee stderr <"$at_stderr"
79951at_fn_diff_devnull "$at_stdout" || at_failed=:
79952at_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"
79958at_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>&-
79961at_status=$? at_failed=false
79962$at_check_filter
79963echo stderr:; tee stderr <"$at_stderr"
79964at_fn_diff_devnull "$at_stdout" || at_failed=:
79965at_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.
79974sed '/^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
79989mv at-stderr stderr
79990# 2. Create the reference error message.
79991cat >expout <<'_ATEOF'
799921.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.
79998sed 's/syntax error, .*$/syntax error/' expout >at-expout
79999mv at-expout expout
80000# 5. Check
80001{ set +x
80002$as_echo "$at_srcdir/calc.at:619: cat stderr"
80003at_fn_check_prepare_trace "calc.at:619"
80004( $at_check_trace; cat stderr
80005) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80006at_status=$? at_failed=false
80007$at_check_filter
80008at_fn_diff_devnull "$at_stderr" || at_failed=:
80009$at_diff expout "$at_stdout" || at_failed=:
80010at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
80011$at_failed && at_fn_log_failure
80012$at_traceon; }
80013
80014
80015cat >input <<'_ATEOF'
800161 = 2 = 3
80017_ATEOF
80018
80019{ set +x
80020$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
80021at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80022( $at_check_trace;  $PREPARSER ./calc input
80023) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80024at_status=$? at_failed=false
80025$at_check_filter
80026echo stderr:; tee stderr <"$at_stderr"
80027at_fn_diff_devnull "$at_stdout" || at_failed=:
80028at_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"
80034at_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>&-
80037at_status=$? at_failed=false
80038$at_check_filter
80039echo stderr:; tee stderr <"$at_stderr"
80040at_fn_diff_devnull "$at_stdout" || at_failed=:
80041at_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.
80050sed '/^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
80065mv at-stderr stderr
80066# 2. Create the reference error message.
80067cat >expout <<'_ATEOF'
800681.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.
80074sed 's/syntax error, .*$/syntax error/' expout >at-expout
80075mv at-expout expout
80076# 5. Check
80077{ set +x
80078$as_echo "$at_srcdir/calc.at:619: cat stderr"
80079at_fn_check_prepare_trace "calc.at:619"
80080( $at_check_trace; cat stderr
80081) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80082at_status=$? at_failed=false
80083$at_check_filter
80084at_fn_diff_devnull "$at_stderr" || at_failed=:
80085$at_diff expout "$at_stdout" || at_failed=:
80086at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
80087$at_failed && at_fn_log_failure
80088$at_traceon; }
80089
80090
80091cat >input <<'_ATEOF'
80092
80093+1
80094_ATEOF
80095
80096{ set +x
80097$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
80098at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80099( $at_check_trace;  $PREPARSER ./calc input
80100) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80101at_status=$? at_failed=false
80102$at_check_filter
80103echo stderr:; tee stderr <"$at_stderr"
80104at_fn_diff_devnull "$at_stdout" || at_failed=:
80105at_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"
80111at_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>&-
80114at_status=$? at_failed=false
80115$at_check_filter
80116echo stderr:; tee stderr <"$at_stderr"
80117at_fn_diff_devnull "$at_stdout" || at_failed=:
80118at_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.
80127sed '/^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
80142mv at-stderr stderr
80143# 2. Create the reference error message.
80144cat >expout <<'_ATEOF'
801452.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.
80151sed 's/syntax error, .*$/syntax error/' expout >at-expout
80152mv at-expout expout
80153# 5. Check
80154{ set +x
80155$as_echo "$at_srcdir/calc.at:619: cat stderr"
80156at_fn_check_prepare_trace "calc.at:619"
80157( $at_check_trace; cat stderr
80158) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80159at_status=$? at_failed=false
80160$at_check_filter
80161at_fn_diff_devnull "$at_stderr" || at_failed=:
80162$at_diff expout "$at_stdout" || at_failed=:
80163at_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"
80171at_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>&-
80174at_status=$? at_failed=false
80175$at_check_filter
80176echo stderr:; tee stderr <"$at_stderr"
80177at_fn_diff_devnull "$at_stdout" || at_failed=:
80178at_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"
80184at_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>&-
80187at_status=$? at_failed=false
80188$at_check_filter
80189echo stderr:; tee stderr <"$at_stderr"
80190at_fn_diff_devnull "$at_stdout" || at_failed=:
80191at_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.
80200sed '/^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
80215mv at-stderr stderr
80216# 2. Create the reference error message.
80217cat >expout <<'_ATEOF'
802181.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.
80224sed 's/syntax error, .*$/syntax error/' expout >at-expout
80225mv at-expout expout
80226# 5. Check
80227{ set +x
80228$as_echo "$at_srcdir/calc.at:619: cat stderr"
80229at_fn_check_prepare_trace "calc.at:619"
80230( $at_check_trace; cat stderr
80231) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80232at_status=$? at_failed=false
80233$at_check_filter
80234at_fn_diff_devnull "$at_stderr" || at_failed=:
80235$at_diff expout "$at_stdout" || at_failed=:
80236at_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#
80258cat >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"
80264at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80265( $at_check_trace;  $PREPARSER ./calc input
80266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80267at_status=$? at_failed=false
80268$at_check_filter
80269echo stderr:; tee stderr <"$at_stderr"
80270at_fn_diff_devnull "$at_stdout" || at_failed=:
80271at_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"
80277at_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>&-
80280at_status=$? at_failed=false
80281$at_check_filter
80282echo stderr:; tee stderr <"$at_stderr"
80283at_fn_diff_devnull "$at_stdout" || at_failed=:
80284at_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.
80293sed '/^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
80308mv at-stderr stderr
80309# 2. Create the reference error message.
80310cat >expout <<'_ATEOF'
803111.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
803121.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
803131.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
803141.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
80315calc: 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.
80321sed 's/syntax error, .*$/syntax error/' expout >at-expout
80322mv at-expout expout
80323# 5. Check
80324{ set +x
80325$as_echo "$at_srcdir/calc.at:619: cat stderr"
80326at_fn_check_prepare_trace "calc.at:619"
80327( $at_check_trace; cat stderr
80328) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80329at_status=$? at_failed=false
80330$at_check_filter
80331at_fn_diff_devnull "$at_stderr" || at_failed=:
80332$at_diff expout "$at_stdout" || at_failed=:
80333at_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.
80341cat >input <<'_ATEOF'
80342(!) + (1 2) = 1
80343_ATEOF
80344
80345{ set +x
80346$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
80347at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80348( $at_check_trace;  $PREPARSER ./calc input
80349) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80350at_status=$? at_failed=false
80351$at_check_filter
80352echo stderr:; tee stderr <"$at_stderr"
80353at_fn_diff_devnull "$at_stdout" || at_failed=:
80354at_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"
80360at_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>&-
80363at_status=$? at_failed=false
80364$at_check_filter
80365echo stderr:; tee stderr <"$at_stderr"
80366at_fn_diff_devnull "$at_stdout" || at_failed=:
80367at_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.
80376sed '/^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
80391mv at-stderr stderr
80392# 2. Create the reference error message.
80393cat >expout <<'_ATEOF'
803941.10: syntax error, unexpected number
80395calc: 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.
80401sed 's/syntax error, .*$/syntax error/' expout >at-expout
80402mv at-expout expout
80403# 5. Check
80404{ set +x
80405$as_echo "$at_srcdir/calc.at:619: cat stderr"
80406at_fn_check_prepare_trace "calc.at:619"
80407( $at_check_trace; cat stderr
80408) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80409at_status=$? at_failed=false
80410$at_check_filter
80411at_fn_diff_devnull "$at_stderr" || at_failed=:
80412$at_diff expout "$at_stdout" || at_failed=:
80413at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
80414$at_failed && at_fn_log_failure
80415$at_traceon; }
80416
80417
80418cat >input <<'_ATEOF'
80419(- *) + (1 2) = 1
80420_ATEOF
80421
80422{ set +x
80423$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
80424at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80425( $at_check_trace;  $PREPARSER ./calc input
80426) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80427at_status=$? at_failed=false
80428$at_check_filter
80429echo stderr:; tee stderr <"$at_stderr"
80430at_fn_diff_devnull "$at_stdout" || at_failed=:
80431at_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"
80437at_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>&-
80440at_status=$? at_failed=false
80441$at_check_filter
80442echo stderr:; tee stderr <"$at_stderr"
80443at_fn_diff_devnull "$at_stdout" || at_failed=:
80444at_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.
80453sed '/^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
80468mv at-stderr stderr
80469# 2. Create the reference error message.
80470cat >expout <<'_ATEOF'
804711.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
804721.12: syntax error, unexpected number
80473calc: 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.
80479sed 's/syntax error, .*$/syntax error/' expout >at-expout
80480mv at-expout expout
80481# 5. Check
80482{ set +x
80483$as_echo "$at_srcdir/calc.at:619: cat stderr"
80484at_fn_check_prepare_trace "calc.at:619"
80485( $at_check_trace; cat stderr
80486) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80487at_status=$? at_failed=false
80488$at_check_filter
80489at_fn_diff_devnull "$at_stderr" || at_failed=:
80490$at_diff expout "$at_stdout" || at_failed=:
80491at_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.
80499cat >input <<'_ATEOF'
80500(* *) + (*) + (*)
80501_ATEOF
80502
80503{ set +x
80504$as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
80505at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
80506( $at_check_trace;  $PREPARSER ./calc input
80507) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80508at_status=$? at_failed=false
80509$at_check_filter
80510echo stderr:; tee stderr <"$at_stderr"
80511at_fn_diff_devnull "$at_stdout" || at_failed=:
80512at_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"
80518at_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>&-
80521at_status=$? at_failed=false
80522$at_check_filter
80523echo stderr:; tee stderr <"$at_stderr"
80524at_fn_diff_devnull "$at_stdout" || at_failed=:
80525at_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.
80534sed '/^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
80549mv at-stderr stderr
80550# 2. Create the reference error message.
80551cat >expout <<'_ATEOF'
805521.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
805531.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
805541.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.
80560sed 's/syntax error, .*$/syntax error/' expout >at-expout
80561mv at-expout expout
80562# 5. Check
80563{ set +x
80564$as_echo "$at_srcdir/calc.at:619: cat stderr"
80565at_fn_check_prepare_trace "calc.at:619"
80566( $at_check_trace; cat stderr
80567) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80568at_status=$? at_failed=false
80569$at_check_filter
80570at_fn_diff_devnull "$at_stderr" || at_failed=:
80571$at_diff expout "$at_stdout" || at_failed=:
80572at_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
80583read at_status <"$at_status_file"
80584#AT_STOP_216
80585#AT_START_217
80586at_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
80588at_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
80602cat >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
80643FILE *input;
80644static int power (int base, int exponent);
80645
80646static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
80647int 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%%
80665input:
80666  line
80667| input line         { ++*count; ++global_count; }
80668;
80669
80670line:
80671  '\n'
80672| exp '\n'           { *result = global_result = $1; }
80673;
80674
80675exp:
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
80696static int
80697power (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.  */
80709static
80710void 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
80722cat >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
80733int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
80734static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
80735static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
80736
80737
80738static CALCLTYPE last_yylloc;
80739
80740static int
80741get_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
80758static void
80759unget_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
80769static int
80770read_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
80801int 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
80831cat >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
80850semantic_value global_result = 0;
80851int global_count = 0;
80852
80853/* A C main function.  */
80854int
80855main (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
80893if 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"
80901at_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>&-
80905at_status=$? at_failed=false
80906$at_check_filter
80907echo stderr:; cat "$at_stderr"
80908echo stdout:; cat "$at_stdout"
80909at_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"
80915at_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>&-
80918at_status=$? at_failed=false
80919$at_check_filter
80920echo stderr:; cat "$at_stderr"
80921echo stdout:; cat "$at_stdout"
80922at_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"
80931at_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>&-
80936at_status=$? at_failed=false
80937$at_check_filter
80938at_fn_diff_devnull "$at_stderr" || at_failed=:
80939$at_diff expout "$at_stdout" || at_failed=:
80940at_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"
80949at_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>&-
80954at_status=$? at_failed=false
80955$at_check_filter
80956at_fn_diff_devnull "$at_stderr" || at_failed=:
80957$at_diff expout "$at_stdout" || at_failed=:
80958at_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
80964fi
80965{ set +x
80966$as_echo "$at_srcdir/calc.at:621: bison -o calc.c calc.y"
80967at_fn_check_prepare_trace "calc.at:621"
80968( $at_check_trace; bison -o calc.c calc.y
80969) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80970at_status=$? at_failed=false
80971$at_check_filter
80972at_fn_diff_devnull "$at_stderr" || at_failed=:
80973at_fn_diff_devnull "$at_stdout" || at_failed=:
80974at_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"
80981at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:621"
80982( $at_check_trace; $BISON_C_WORKS
80983) >>"$at_stdout" 2>>"$at_stderr" 5>&-
80984at_status=$? at_failed=false
80985$at_check_filter
80986echo stderr:; cat "$at_stderr"
80987echo stdout:; cat "$at_stdout"
80988at_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"
80994at_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>&-
80997at_status=$? at_failed=false
80998$at_check_filter
80999echo stderr:; cat "$at_stderr"
81000echo stdout:; cat "$at_stdout"
81001at_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"
81016at_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>&-
81027at_status=$? at_failed=false
81028$at_check_filter
81029at_fn_diff_devnull "$at_stderr" || at_failed=:
81030at_fn_diff_devnull "$at_stdout" || at_failed=:
81031at_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"
81045at_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>&-
81056at_status=$? at_failed=false
81057$at_check_filter
81058at_fn_diff_devnull "$at_stderr" || at_failed=:
81059at_fn_diff_devnull "$at_stdout" || at_failed=:
81060at_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.
81066cat >input <<'_ATEOF'
810671 + 2 * 3 = 7
810681 + 2 * -3 = -5
81069
81070-1^2 = -1
81071(-1)^2 = 1
81072
81073---1 = -1
81074
810751 - 2 - 3 = -4
810761 - (2 - 3) = 2
81077
810782^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"
81084at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81085( $at_check_trace;  $PREPARSER ./calc input
81086) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81087at_status=$? at_failed=false
81088$at_check_filter
81089echo stderr:; tee stderr <"$at_stderr"
81090at_fn_diff_devnull "$at_stdout" || at_failed=:
81091at_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"
81097at_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>&-
81100at_status=$? at_failed=false
81101$at_check_filter
81102echo stderr:; tee stderr <"$at_stderr"
81103at_fn_diff_devnull "$at_stdout" || at_failed=:
81104at_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.
81112cat >input <<'_ATEOF'
811131 2
81114_ATEOF
81115
81116{ set +x
81117$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81118at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81119( $at_check_trace;  $PREPARSER ./calc input
81120) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81121at_status=$? at_failed=false
81122$at_check_filter
81123echo stderr:; tee stderr <"$at_stderr"
81124at_fn_diff_devnull "$at_stdout" || at_failed=:
81125at_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"
81131at_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>&-
81134at_status=$? at_failed=false
81135$at_check_filter
81136echo stderr:; tee stderr <"$at_stderr"
81137at_fn_diff_devnull "$at_stdout" || at_failed=:
81138at_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.
81147sed '/^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
81162mv at-stderr stderr
81163# 2. Create the reference error message.
81164cat >expout <<'_ATEOF'
811651.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"
81175at_fn_check_prepare_trace "calc.at:621"
81176( $at_check_trace; cat stderr
81177) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81178at_status=$? at_failed=false
81179$at_check_filter
81180at_fn_diff_devnull "$at_stderr" || at_failed=:
81181$at_diff expout "$at_stdout" || at_failed=:
81182at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
81183$at_failed && at_fn_log_failure
81184$at_traceon; }
81185
81186
81187cat >input <<'_ATEOF'
811881//2
81189_ATEOF
81190
81191{ set +x
81192$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81193at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81194( $at_check_trace;  $PREPARSER ./calc input
81195) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81196at_status=$? at_failed=false
81197$at_check_filter
81198echo stderr:; tee stderr <"$at_stderr"
81199at_fn_diff_devnull "$at_stdout" || at_failed=:
81200at_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"
81206at_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>&-
81209at_status=$? at_failed=false
81210$at_check_filter
81211echo stderr:; tee stderr <"$at_stderr"
81212at_fn_diff_devnull "$at_stdout" || at_failed=:
81213at_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.
81222sed '/^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
81237mv at-stderr stderr
81238# 2. Create the reference error message.
81239cat >expout <<'_ATEOF'
812401.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"
81250at_fn_check_prepare_trace "calc.at:621"
81251( $at_check_trace; cat stderr
81252) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81253at_status=$? at_failed=false
81254$at_check_filter
81255at_fn_diff_devnull "$at_stderr" || at_failed=:
81256$at_diff expout "$at_stdout" || at_failed=:
81257at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
81258$at_failed && at_fn_log_failure
81259$at_traceon; }
81260
81261
81262cat >input <<'_ATEOF'
81263error
81264_ATEOF
81265
81266{ set +x
81267$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81268at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81269( $at_check_trace;  $PREPARSER ./calc input
81270) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81271at_status=$? at_failed=false
81272$at_check_filter
81273echo stderr:; tee stderr <"$at_stderr"
81274at_fn_diff_devnull "$at_stdout" || at_failed=:
81275at_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"
81281at_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>&-
81284at_status=$? at_failed=false
81285$at_check_filter
81286echo stderr:; tee stderr <"$at_stderr"
81287at_fn_diff_devnull "$at_stdout" || at_failed=:
81288at_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.
81297sed '/^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
81312mv at-stderr stderr
81313# 2. Create the reference error message.
81314cat >expout <<'_ATEOF'
813151.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"
81325at_fn_check_prepare_trace "calc.at:621"
81326( $at_check_trace; cat stderr
81327) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81328at_status=$? at_failed=false
81329$at_check_filter
81330at_fn_diff_devnull "$at_stderr" || at_failed=:
81331$at_diff expout "$at_stdout" || at_failed=:
81332at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
81333$at_failed && at_fn_log_failure
81334$at_traceon; }
81335
81336
81337cat >input <<'_ATEOF'
813381 = 2 = 3
81339_ATEOF
81340
81341{ set +x
81342$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81343at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81344( $at_check_trace;  $PREPARSER ./calc input
81345) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81346at_status=$? at_failed=false
81347$at_check_filter
81348echo stderr:; tee stderr <"$at_stderr"
81349at_fn_diff_devnull "$at_stdout" || at_failed=:
81350at_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"
81356at_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>&-
81359at_status=$? at_failed=false
81360$at_check_filter
81361echo stderr:; tee stderr <"$at_stderr"
81362at_fn_diff_devnull "$at_stdout" || at_failed=:
81363at_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.
81372sed '/^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
81387mv at-stderr stderr
81388# 2. Create the reference error message.
81389cat >expout <<'_ATEOF'
813901.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"
81400at_fn_check_prepare_trace "calc.at:621"
81401( $at_check_trace; cat stderr
81402) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81403at_status=$? at_failed=false
81404$at_check_filter
81405at_fn_diff_devnull "$at_stderr" || at_failed=:
81406$at_diff expout "$at_stdout" || at_failed=:
81407at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
81408$at_failed && at_fn_log_failure
81409$at_traceon; }
81410
81411
81412cat >input <<'_ATEOF'
81413
81414+1
81415_ATEOF
81416
81417{ set +x
81418$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81419at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81420( $at_check_trace;  $PREPARSER ./calc input
81421) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81422at_status=$? at_failed=false
81423$at_check_filter
81424echo stderr:; tee stderr <"$at_stderr"
81425at_fn_diff_devnull "$at_stdout" || at_failed=:
81426at_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"
81432at_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>&-
81435at_status=$? at_failed=false
81436$at_check_filter
81437echo stderr:; tee stderr <"$at_stderr"
81438at_fn_diff_devnull "$at_stdout" || at_failed=:
81439at_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.
81448sed '/^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
81463mv at-stderr stderr
81464# 2. Create the reference error message.
81465cat >expout <<'_ATEOF'
814662.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"
81476at_fn_check_prepare_trace "calc.at:621"
81477( $at_check_trace; cat stderr
81478) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81479at_status=$? at_failed=false
81480$at_check_filter
81481at_fn_diff_devnull "$at_stderr" || at_failed=:
81482$at_diff expout "$at_stdout" || at_failed=:
81483at_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"
81491at_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>&-
81494at_status=$? at_failed=false
81495$at_check_filter
81496echo stderr:; tee stderr <"$at_stderr"
81497at_fn_diff_devnull "$at_stdout" || at_failed=:
81498at_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"
81504at_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>&-
81507at_status=$? at_failed=false
81508$at_check_filter
81509echo stderr:; tee stderr <"$at_stderr"
81510at_fn_diff_devnull "$at_stdout" || at_failed=:
81511at_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.
81520sed '/^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
81535mv at-stderr stderr
81536# 2. Create the reference error message.
81537cat >expout <<'_ATEOF'
815381.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"
81548at_fn_check_prepare_trace "calc.at:621"
81549( $at_check_trace; cat stderr
81550) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81551at_status=$? at_failed=false
81552$at_check_filter
81553at_fn_diff_devnull "$at_stderr" || at_failed=:
81554$at_diff expout "$at_stdout" || at_failed=:
81555at_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#
81577cat >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"
81583at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81584( $at_check_trace;  $PREPARSER ./calc input
81585) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81586at_status=$? at_failed=false
81587$at_check_filter
81588echo stderr:; tee stderr <"$at_stderr"
81589at_fn_diff_devnull "$at_stdout" || at_failed=:
81590at_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"
81596at_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>&-
81599at_status=$? at_failed=false
81600$at_check_filter
81601echo stderr:; tee stderr <"$at_stderr"
81602at_fn_diff_devnull "$at_stdout" || at_failed=:
81603at_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.
81612sed '/^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
81627mv at-stderr stderr
81628# 2. Create the reference error message.
81629cat >expout <<'_ATEOF'
816301.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
816311.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
816321.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
816331.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
81634calc: 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"
81644at_fn_check_prepare_trace "calc.at:621"
81645( $at_check_trace; cat stderr
81646) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81647at_status=$? at_failed=false
81648$at_check_filter
81649at_fn_diff_devnull "$at_stderr" || at_failed=:
81650$at_diff expout "$at_stdout" || at_failed=:
81651at_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.
81659cat >input <<'_ATEOF'
81660(!) + (1 2) = 1
81661_ATEOF
81662
81663{ set +x
81664$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81665at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81666( $at_check_trace;  $PREPARSER ./calc input
81667) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81668at_status=$? at_failed=false
81669$at_check_filter
81670echo stderr:; tee stderr <"$at_stderr"
81671at_fn_diff_devnull "$at_stdout" || at_failed=:
81672at_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"
81678at_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>&-
81681at_status=$? at_failed=false
81682$at_check_filter
81683echo stderr:; tee stderr <"$at_stderr"
81684at_fn_diff_devnull "$at_stdout" || at_failed=:
81685at_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.
81694sed '/^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
81709mv at-stderr stderr
81710# 2. Create the reference error message.
81711cat >expout <<'_ATEOF'
817121.10: syntax error, unexpected number
81713calc: 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"
81723at_fn_check_prepare_trace "calc.at:621"
81724( $at_check_trace; cat stderr
81725) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81726at_status=$? at_failed=false
81727$at_check_filter
81728at_fn_diff_devnull "$at_stderr" || at_failed=:
81729$at_diff expout "$at_stdout" || at_failed=:
81730at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
81731$at_failed && at_fn_log_failure
81732$at_traceon; }
81733
81734
81735cat >input <<'_ATEOF'
81736(- *) + (1 2) = 1
81737_ATEOF
81738
81739{ set +x
81740$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81741at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81742( $at_check_trace;  $PREPARSER ./calc input
81743) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81744at_status=$? at_failed=false
81745$at_check_filter
81746echo stderr:; tee stderr <"$at_stderr"
81747at_fn_diff_devnull "$at_stdout" || at_failed=:
81748at_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"
81754at_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>&-
81757at_status=$? at_failed=false
81758$at_check_filter
81759echo stderr:; tee stderr <"$at_stderr"
81760at_fn_diff_devnull "$at_stdout" || at_failed=:
81761at_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.
81770sed '/^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
81785mv at-stderr stderr
81786# 2. Create the reference error message.
81787cat >expout <<'_ATEOF'
817881.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
817891.12: syntax error, unexpected number
81790calc: 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"
81800at_fn_check_prepare_trace "calc.at:621"
81801( $at_check_trace; cat stderr
81802) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81803at_status=$? at_failed=false
81804$at_check_filter
81805at_fn_diff_devnull "$at_stderr" || at_failed=:
81806$at_diff expout "$at_stdout" || at_failed=:
81807at_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.
81815cat >input <<'_ATEOF'
81816(* *) + (*) + (*)
81817_ATEOF
81818
81819{ set +x
81820$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
81821at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
81822( $at_check_trace;  $PREPARSER ./calc input
81823) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81824at_status=$? at_failed=false
81825$at_check_filter
81826echo stderr:; tee stderr <"$at_stderr"
81827at_fn_diff_devnull "$at_stdout" || at_failed=:
81828at_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"
81834at_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>&-
81837at_status=$? at_failed=false
81838$at_check_filter
81839echo stderr:; tee stderr <"$at_stderr"
81840at_fn_diff_devnull "$at_stdout" || at_failed=:
81841at_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.
81850sed '/^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
81865mv at-stderr stderr
81866# 2. Create the reference error message.
81867cat >expout <<'_ATEOF'
818681.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
818691.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
818701.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"
81880at_fn_check_prepare_trace "calc.at:621"
81881( $at_check_trace; cat stderr
81882) >>"$at_stdout" 2>>"$at_stderr" 5>&-
81883at_status=$? at_failed=false
81884$at_check_filter
81885at_fn_diff_devnull "$at_stderr" || at_failed=:
81886$at_diff expout "$at_stdout" || at_failed=:
81887at_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
81898read at_status <"$at_status_file"
81899#AT_STOP_217
81900#AT_START_218
81901at_fn_group_banner 218 'calc.at:638' \
81902  "Calculator %glr-parser " "                        " 12
81903at_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
81917cat >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
81958FILE *input;
81959static int power (int base, int exponent);
81960
81961static void yyerror ( const char *msg);
81962int 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%%
81980input:
81981  line
81982| input line         {  }
81983;
81984
81985line:
81986  '\n'
81987| exp '\n'           { USE ($1); }
81988;
81989
81990exp:
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
82011static int
82012power (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.  */
82024static
82025void yyerror ( const char *msg)
82026{
82027  fprintf (stderr, "%s\n", msg);
82028}
82029#include <ctype.h>
82030
82031int yylex (void);
82032static int get_char (void);
82033static void unget_char ( int c);
82034
82035
82036static int
82037get_char (void)
82038{
82039  int res = getc (input);
82040  ;
82041
82042  return res;
82043}
82044
82045static void
82046unget_char ( int c)
82047{
82048  ;
82049
82050  ungetc (c, input);
82051}
82052
82053static int
82054read_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
82085int 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
82121semantic_value global_result = 0;
82122int global_count = 0;
82123
82124/* A C main function.  */
82125int
82126main (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
82165if 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"
82173at_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>&-
82177at_status=$? at_failed=false
82178$at_check_filter
82179echo stderr:; cat "$at_stderr"
82180echo stdout:; cat "$at_stdout"
82181at_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"
82187at_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>&-
82190at_status=$? at_failed=false
82191$at_check_filter
82192echo stderr:; cat "$at_stderr"
82193echo stdout:; cat "$at_stdout"
82194at_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"
82203at_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>&-
82208at_status=$? at_failed=false
82209$at_check_filter
82210at_fn_diff_devnull "$at_stderr" || at_failed=:
82211$at_diff expout "$at_stdout" || at_failed=:
82212at_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"
82221at_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>&-
82226at_status=$? at_failed=false
82227$at_check_filter
82228at_fn_diff_devnull "$at_stderr" || at_failed=:
82229$at_diff expout "$at_stdout" || at_failed=:
82230at_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
82236fi
82237{ set +x
82238$as_echo "$at_srcdir/calc.at:638: bison -o calc.c calc.y"
82239at_fn_check_prepare_trace "calc.at:638"
82240( $at_check_trace; bison -o calc.c calc.y
82241) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82242at_status=$? at_failed=false
82243$at_check_filter
82244at_fn_diff_devnull "$at_stderr" || at_failed=:
82245at_fn_diff_devnull "$at_stdout" || at_failed=:
82246at_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"
82253at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:638"
82254( $at_check_trace; $BISON_C_WORKS
82255) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82256at_status=$? at_failed=false
82257$at_check_filter
82258echo stderr:; cat "$at_stderr"
82259echo stdout:; cat "$at_stdout"
82260at_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"
82266at_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>&-
82269at_status=$? at_failed=false
82270$at_check_filter
82271echo stderr:; cat "$at_stderr"
82272echo stdout:; cat "$at_stdout"
82273at_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"
82288at_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>&-
82299at_status=$? at_failed=false
82300$at_check_filter
82301at_fn_diff_devnull "$at_stderr" || at_failed=:
82302at_fn_diff_devnull "$at_stdout" || at_failed=:
82303at_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.
82310cat >input <<'_ATEOF'
823111 + 2 * 3 = 7
823121 + 2 * -3 = -5
82313
82314-1^2 = -1
82315(-1)^2 = 1
82316
82317---1 = -1
82318
823191 - 2 - 3 = -4
823201 - (2 - 3) = 2
82321
823222^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"
82328at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82329( $at_check_trace;  $PREPARSER ./calc input
82330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82331at_status=$? at_failed=false
82332$at_check_filter
82333echo stderr:; tee stderr <"$at_stderr"
82334at_fn_diff_devnull "$at_stdout" || at_failed=:
82335at_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"
82341at_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>&-
82344at_status=$? at_failed=false
82345$at_check_filter
82346echo stderr:; tee stderr <"$at_stderr"
82347at_fn_diff_devnull "$at_stdout" || at_failed=:
82348at_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.
82356cat >input <<'_ATEOF'
823571 2
82358_ATEOF
82359
82360{ set +x
82361$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82362at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82363( $at_check_trace;  $PREPARSER ./calc input
82364) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82365at_status=$? at_failed=false
82366$at_check_filter
82367echo stderr:; tee stderr <"$at_stderr"
82368at_fn_diff_devnull "$at_stdout" || at_failed=:
82369at_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"
82375at_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>&-
82378at_status=$? at_failed=false
82379$at_check_filter
82380echo stderr:; tee stderr <"$at_stderr"
82381at_fn_diff_devnull "$at_stdout" || at_failed=:
82382at_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.
82391sed '/^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
82406mv at-stderr stderr
82407# 2. Create the reference error message.
82408cat >expout <<'_ATEOF'
824091.3: syntax error, unexpected number
82410_ATEOF
82411
82412# 3. If locations are not used, remove them.
82413sed 's/^[-0-9.]*: //' expout >at-expout
82414mv at-expout expout
82415# 4. If error-verbose is not used, strip the`, unexpected....' part.
82416sed 's/syntax error, .*$/syntax error/' expout >at-expout
82417mv at-expout expout
82418# 5. Check
82419{ set +x
82420$as_echo "$at_srcdir/calc.at:638: cat stderr"
82421at_fn_check_prepare_trace "calc.at:638"
82422( $at_check_trace; cat stderr
82423) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82424at_status=$? at_failed=false
82425$at_check_filter
82426at_fn_diff_devnull "$at_stderr" || at_failed=:
82427$at_diff expout "$at_stdout" || at_failed=:
82428at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
82429$at_failed && at_fn_log_failure
82430$at_traceon; }
82431
82432
82433cat >input <<'_ATEOF'
824341//2
82435_ATEOF
82436
82437{ set +x
82438$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82439at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82440( $at_check_trace;  $PREPARSER ./calc input
82441) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82442at_status=$? at_failed=false
82443$at_check_filter
82444echo stderr:; tee stderr <"$at_stderr"
82445at_fn_diff_devnull "$at_stdout" || at_failed=:
82446at_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"
82452at_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>&-
82455at_status=$? at_failed=false
82456$at_check_filter
82457echo stderr:; tee stderr <"$at_stderr"
82458at_fn_diff_devnull "$at_stdout" || at_failed=:
82459at_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.
82468sed '/^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
82483mv at-stderr stderr
82484# 2. Create the reference error message.
82485cat >expout <<'_ATEOF'
824861.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
82487_ATEOF
82488
82489# 3. If locations are not used, remove them.
82490sed 's/^[-0-9.]*: //' expout >at-expout
82491mv at-expout expout
82492# 4. If error-verbose is not used, strip the`, unexpected....' part.
82493sed 's/syntax error, .*$/syntax error/' expout >at-expout
82494mv at-expout expout
82495# 5. Check
82496{ set +x
82497$as_echo "$at_srcdir/calc.at:638: cat stderr"
82498at_fn_check_prepare_trace "calc.at:638"
82499( $at_check_trace; cat stderr
82500) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82501at_status=$? at_failed=false
82502$at_check_filter
82503at_fn_diff_devnull "$at_stderr" || at_failed=:
82504$at_diff expout "$at_stdout" || at_failed=:
82505at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
82506$at_failed && at_fn_log_failure
82507$at_traceon; }
82508
82509
82510cat >input <<'_ATEOF'
82511error
82512_ATEOF
82513
82514{ set +x
82515$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82516at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82517( $at_check_trace;  $PREPARSER ./calc input
82518) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82519at_status=$? at_failed=false
82520$at_check_filter
82521echo stderr:; tee stderr <"$at_stderr"
82522at_fn_diff_devnull "$at_stdout" || at_failed=:
82523at_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"
82529at_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>&-
82532at_status=$? at_failed=false
82533$at_check_filter
82534echo stderr:; tee stderr <"$at_stderr"
82535at_fn_diff_devnull "$at_stdout" || at_failed=:
82536at_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.
82545sed '/^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
82560mv at-stderr stderr
82561# 2. Create the reference error message.
82562cat >expout <<'_ATEOF'
825631.1: syntax error, unexpected $undefined
82564_ATEOF
82565
82566# 3. If locations are not used, remove them.
82567sed 's/^[-0-9.]*: //' expout >at-expout
82568mv at-expout expout
82569# 4. If error-verbose is not used, strip the`, unexpected....' part.
82570sed 's/syntax error, .*$/syntax error/' expout >at-expout
82571mv at-expout expout
82572# 5. Check
82573{ set +x
82574$as_echo "$at_srcdir/calc.at:638: cat stderr"
82575at_fn_check_prepare_trace "calc.at:638"
82576( $at_check_trace; cat stderr
82577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82578at_status=$? at_failed=false
82579$at_check_filter
82580at_fn_diff_devnull "$at_stderr" || at_failed=:
82581$at_diff expout "$at_stdout" || at_failed=:
82582at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
82583$at_failed && at_fn_log_failure
82584$at_traceon; }
82585
82586
82587cat >input <<'_ATEOF'
825881 = 2 = 3
82589_ATEOF
82590
82591{ set +x
82592$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82593at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82594( $at_check_trace;  $PREPARSER ./calc input
82595) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82596at_status=$? at_failed=false
82597$at_check_filter
82598echo stderr:; tee stderr <"$at_stderr"
82599at_fn_diff_devnull "$at_stdout" || at_failed=:
82600at_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"
82606at_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>&-
82609at_status=$? at_failed=false
82610$at_check_filter
82611echo stderr:; tee stderr <"$at_stderr"
82612at_fn_diff_devnull "$at_stdout" || at_failed=:
82613at_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.
82622sed '/^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
82637mv at-stderr stderr
82638# 2. Create the reference error message.
82639cat >expout <<'_ATEOF'
826401.7: syntax error, unexpected '='
82641_ATEOF
82642
82643# 3. If locations are not used, remove them.
82644sed 's/^[-0-9.]*: //' expout >at-expout
82645mv at-expout expout
82646# 4. If error-verbose is not used, strip the`, unexpected....' part.
82647sed 's/syntax error, .*$/syntax error/' expout >at-expout
82648mv at-expout expout
82649# 5. Check
82650{ set +x
82651$as_echo "$at_srcdir/calc.at:638: cat stderr"
82652at_fn_check_prepare_trace "calc.at:638"
82653( $at_check_trace; cat stderr
82654) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82655at_status=$? at_failed=false
82656$at_check_filter
82657at_fn_diff_devnull "$at_stderr" || at_failed=:
82658$at_diff expout "$at_stdout" || at_failed=:
82659at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
82660$at_failed && at_fn_log_failure
82661$at_traceon; }
82662
82663
82664cat >input <<'_ATEOF'
82665
82666+1
82667_ATEOF
82668
82669{ set +x
82670$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82671at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82672( $at_check_trace;  $PREPARSER ./calc input
82673) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82674at_status=$? at_failed=false
82675$at_check_filter
82676echo stderr:; tee stderr <"$at_stderr"
82677at_fn_diff_devnull "$at_stdout" || at_failed=:
82678at_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"
82684at_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>&-
82687at_status=$? at_failed=false
82688$at_check_filter
82689echo stderr:; tee stderr <"$at_stderr"
82690at_fn_diff_devnull "$at_stdout" || at_failed=:
82691at_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.
82700sed '/^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
82715mv at-stderr stderr
82716# 2. Create the reference error message.
82717cat >expout <<'_ATEOF'
827182.1: syntax error, unexpected '+'
82719_ATEOF
82720
82721# 3. If locations are not used, remove them.
82722sed 's/^[-0-9.]*: //' expout >at-expout
82723mv at-expout expout
82724# 4. If error-verbose is not used, strip the`, unexpected....' part.
82725sed 's/syntax error, .*$/syntax error/' expout >at-expout
82726mv at-expout expout
82727# 5. Check
82728{ set +x
82729$as_echo "$at_srcdir/calc.at:638: cat stderr"
82730at_fn_check_prepare_trace "calc.at:638"
82731( $at_check_trace; cat stderr
82732) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82733at_status=$? at_failed=false
82734$at_check_filter
82735at_fn_diff_devnull "$at_stderr" || at_failed=:
82736$at_diff expout "$at_stdout" || at_failed=:
82737at_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"
82745at_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>&-
82748at_status=$? at_failed=false
82749$at_check_filter
82750echo stderr:; tee stderr <"$at_stderr"
82751at_fn_diff_devnull "$at_stdout" || at_failed=:
82752at_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"
82758at_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>&-
82761at_status=$? at_failed=false
82762$at_check_filter
82763echo stderr:; tee stderr <"$at_stderr"
82764at_fn_diff_devnull "$at_stdout" || at_failed=:
82765at_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.
82774sed '/^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
82789mv at-stderr stderr
82790# 2. Create the reference error message.
82791cat >expout <<'_ATEOF'
827921.1: syntax error, unexpected end of input
82793_ATEOF
82794
82795# 3. If locations are not used, remove them.
82796sed 's/^[-0-9.]*: //' expout >at-expout
82797mv at-expout expout
82798# 4. If error-verbose is not used, strip the`, unexpected....' part.
82799sed 's/syntax error, .*$/syntax error/' expout >at-expout
82800mv at-expout expout
82801# 5. Check
82802{ set +x
82803$as_echo "$at_srcdir/calc.at:638: cat stderr"
82804at_fn_check_prepare_trace "calc.at:638"
82805( $at_check_trace; cat stderr
82806) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82807at_status=$? at_failed=false
82808$at_check_filter
82809at_fn_diff_devnull "$at_stderr" || at_failed=:
82810$at_diff expout "$at_stdout" || at_failed=:
82811at_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#
82833cat >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"
82839at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82840( $at_check_trace;  $PREPARSER ./calc input
82841) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82842at_status=$? at_failed=false
82843$at_check_filter
82844echo stderr:; tee stderr <"$at_stderr"
82845at_fn_diff_devnull "$at_stdout" || at_failed=:
82846at_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"
82852at_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>&-
82855at_status=$? at_failed=false
82856$at_check_filter
82857echo stderr:; tee stderr <"$at_stderr"
82858at_fn_diff_devnull "$at_stdout" || at_failed=:
82859at_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.
82868sed '/^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
82883mv at-stderr stderr
82884# 2. Create the reference error message.
82885cat >expout <<'_ATEOF'
828861.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
828871.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
828881.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
828891.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
82890calc: error: 4444 != 1
82891_ATEOF
82892
82893# 3. If locations are not used, remove them.
82894sed 's/^[-0-9.]*: //' expout >at-expout
82895mv at-expout expout
82896# 4. If error-verbose is not used, strip the`, unexpected....' part.
82897sed 's/syntax error, .*$/syntax error/' expout >at-expout
82898mv at-expout expout
82899# 5. Check
82900{ set +x
82901$as_echo "$at_srcdir/calc.at:638: cat stderr"
82902at_fn_check_prepare_trace "calc.at:638"
82903( $at_check_trace; cat stderr
82904) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82905at_status=$? at_failed=false
82906$at_check_filter
82907at_fn_diff_devnull "$at_stderr" || at_failed=:
82908$at_diff expout "$at_stdout" || at_failed=:
82909at_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.
82917cat >input <<'_ATEOF'
82918(!) + (1 2) = 1
82919_ATEOF
82920
82921{ set +x
82922$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
82923at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
82924( $at_check_trace;  $PREPARSER ./calc input
82925) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82926at_status=$? at_failed=false
82927$at_check_filter
82928echo stderr:; tee stderr <"$at_stderr"
82929at_fn_diff_devnull "$at_stdout" || at_failed=:
82930at_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"
82936at_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>&-
82939at_status=$? at_failed=false
82940$at_check_filter
82941echo stderr:; tee stderr <"$at_stderr"
82942at_fn_diff_devnull "$at_stdout" || at_failed=:
82943at_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.
82952sed '/^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
82967mv at-stderr stderr
82968# 2. Create the reference error message.
82969cat >expout <<'_ATEOF'
829701.10: syntax error, unexpected number
82971calc: error: 2222 != 1
82972_ATEOF
82973
82974# 3. If locations are not used, remove them.
82975sed 's/^[-0-9.]*: //' expout >at-expout
82976mv at-expout expout
82977# 4. If error-verbose is not used, strip the`, unexpected....' part.
82978sed 's/syntax error, .*$/syntax error/' expout >at-expout
82979mv at-expout expout
82980# 5. Check
82981{ set +x
82982$as_echo "$at_srcdir/calc.at:638: cat stderr"
82983at_fn_check_prepare_trace "calc.at:638"
82984( $at_check_trace; cat stderr
82985) >>"$at_stdout" 2>>"$at_stderr" 5>&-
82986at_status=$? at_failed=false
82987$at_check_filter
82988at_fn_diff_devnull "$at_stderr" || at_failed=:
82989$at_diff expout "$at_stdout" || at_failed=:
82990at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
82991$at_failed && at_fn_log_failure
82992$at_traceon; }
82993
82994
82995cat >input <<'_ATEOF'
82996(- *) + (1 2) = 1
82997_ATEOF
82998
82999{ set +x
83000$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
83001at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
83002( $at_check_trace;  $PREPARSER ./calc input
83003) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83004at_status=$? at_failed=false
83005$at_check_filter
83006echo stderr:; tee stderr <"$at_stderr"
83007at_fn_diff_devnull "$at_stdout" || at_failed=:
83008at_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"
83014at_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>&-
83017at_status=$? at_failed=false
83018$at_check_filter
83019echo stderr:; tee stderr <"$at_stderr"
83020at_fn_diff_devnull "$at_stdout" || at_failed=:
83021at_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.
83030sed '/^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
83045mv at-stderr stderr
83046# 2. Create the reference error message.
83047cat >expout <<'_ATEOF'
830481.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
830491.12: syntax error, unexpected number
83050calc: error: 2222 != 1
83051_ATEOF
83052
83053# 3. If locations are not used, remove them.
83054sed 's/^[-0-9.]*: //' expout >at-expout
83055mv at-expout expout
83056# 4. If error-verbose is not used, strip the`, unexpected....' part.
83057sed 's/syntax error, .*$/syntax error/' expout >at-expout
83058mv at-expout expout
83059# 5. Check
83060{ set +x
83061$as_echo "$at_srcdir/calc.at:638: cat stderr"
83062at_fn_check_prepare_trace "calc.at:638"
83063( $at_check_trace; cat stderr
83064) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83065at_status=$? at_failed=false
83066$at_check_filter
83067at_fn_diff_devnull "$at_stderr" || at_failed=:
83068$at_diff expout "$at_stdout" || at_failed=:
83069at_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.
83077cat >input <<'_ATEOF'
83078(* *) + (*) + (*)
83079_ATEOF
83080
83081{ set +x
83082$as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
83083at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
83084( $at_check_trace;  $PREPARSER ./calc input
83085) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83086at_status=$? at_failed=false
83087$at_check_filter
83088echo stderr:; tee stderr <"$at_stderr"
83089at_fn_diff_devnull "$at_stdout" || at_failed=:
83090at_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"
83096at_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>&-
83099at_status=$? at_failed=false
83100$at_check_filter
83101echo stderr:; tee stderr <"$at_stderr"
83102at_fn_diff_devnull "$at_stdout" || at_failed=:
83103at_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.
83112sed '/^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
83127mv at-stderr stderr
83128# 2. Create the reference error message.
83129cat >expout <<'_ATEOF'
831301.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
831311.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
831321.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
83133_ATEOF
83134
83135# 3. If locations are not used, remove them.
83136sed 's/^[-0-9.]*: //' expout >at-expout
83137mv at-expout expout
83138# 4. If error-verbose is not used, strip the`, unexpected....' part.
83139sed 's/syntax error, .*$/syntax error/' expout >at-expout
83140mv at-expout expout
83141# 5. Check
83142{ set +x
83143$as_echo "$at_srcdir/calc.at:638: cat stderr"
83144at_fn_check_prepare_trace "calc.at:638"
83145( $at_check_trace; cat stderr
83146) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83147at_status=$? at_failed=false
83148$at_check_filter
83149at_fn_diff_devnull "$at_stderr" || at_failed=:
83150$at_diff expout "$at_stdout" || at_failed=:
83151at_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
83162read at_status <"$at_status_file"
83163#AT_STOP_218
83164#AT_START_219
83165at_fn_group_banner 219 'calc.at:640' \
83166  "Calculator %glr-parser %defines" "                " 12
83167at_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
83181cat >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
83222FILE *input;
83223static int power (int base, int exponent);
83224
83225static void yyerror ( const char *msg);
83226int 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%%
83244input:
83245  line
83246| input line         {  }
83247;
83248
83249line:
83250  '\n'
83251| exp '\n'           { USE ($1); }
83252;
83253
83254exp:
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
83275static int
83276power (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.  */
83288static
83289void yyerror ( const char *msg)
83290{
83291  fprintf (stderr, "%s\n", msg);
83292}
83293_ATEOF
83294
83295
83296
83297cat >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
83308int yylex (void);
83309static int get_char (void);
83310static void unget_char ( int c);
83311
83312
83313static int
83314get_char (void)
83315{
83316  int res = getc (input);
83317  ;
83318
83319  return res;
83320}
83321
83322static void
83323unget_char ( int c)
83324{
83325  ;
83326
83327  ungetc (c, input);
83328}
83329
83330static int
83331read_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
83362int 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
83390cat >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
83409semantic_value global_result = 0;
83410int global_count = 0;
83411
83412/* A C main function.  */
83413int
83414main (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
83452if 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"
83460at_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>&-
83464at_status=$? at_failed=false
83465$at_check_filter
83466echo stderr:; cat "$at_stderr"
83467echo stdout:; cat "$at_stdout"
83468at_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"
83474at_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>&-
83477at_status=$? at_failed=false
83478$at_check_filter
83479echo stderr:; cat "$at_stderr"
83480echo stdout:; cat "$at_stdout"
83481at_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"
83490at_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>&-
83495at_status=$? at_failed=false
83496$at_check_filter
83497at_fn_diff_devnull "$at_stderr" || at_failed=:
83498$at_diff expout "$at_stdout" || at_failed=:
83499at_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"
83508at_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>&-
83513at_status=$? at_failed=false
83514$at_check_filter
83515at_fn_diff_devnull "$at_stderr" || at_failed=:
83516$at_diff expout "$at_stdout" || at_failed=:
83517at_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
83523fi
83524{ set +x
83525$as_echo "$at_srcdir/calc.at:640: bison -o calc.c calc.y"
83526at_fn_check_prepare_trace "calc.at:640"
83527( $at_check_trace; bison -o calc.c calc.y
83528) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83529at_status=$? at_failed=false
83530$at_check_filter
83531at_fn_diff_devnull "$at_stderr" || at_failed=:
83532at_fn_diff_devnull "$at_stdout" || at_failed=:
83533at_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"
83540at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640"
83541( $at_check_trace; $BISON_C_WORKS
83542) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83543at_status=$? at_failed=false
83544$at_check_filter
83545echo stderr:; cat "$at_stderr"
83546echo stdout:; cat "$at_stdout"
83547at_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"
83553at_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>&-
83556at_status=$? at_failed=false
83557$at_check_filter
83558echo stderr:; cat "$at_stderr"
83559echo stdout:; cat "$at_stdout"
83560at_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"
83575at_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>&-
83586at_status=$? at_failed=false
83587$at_check_filter
83588at_fn_diff_devnull "$at_stderr" || at_failed=:
83589at_fn_diff_devnull "$at_stdout" || at_failed=:
83590at_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"
83604at_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>&-
83615at_status=$? at_failed=false
83616$at_check_filter
83617at_fn_diff_devnull "$at_stderr" || at_failed=:
83618at_fn_diff_devnull "$at_stdout" || at_failed=:
83619at_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.
83625cat >input <<'_ATEOF'
836261 + 2 * 3 = 7
836271 + 2 * -3 = -5
83628
83629-1^2 = -1
83630(-1)^2 = 1
83631
83632---1 = -1
83633
836341 - 2 - 3 = -4
836351 - (2 - 3) = 2
83636
836372^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"
83643at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83644( $at_check_trace;  $PREPARSER ./calc input
83645) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83646at_status=$? at_failed=false
83647$at_check_filter
83648echo stderr:; tee stderr <"$at_stderr"
83649at_fn_diff_devnull "$at_stdout" || at_failed=:
83650at_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"
83656at_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>&-
83659at_status=$? at_failed=false
83660$at_check_filter
83661echo stderr:; tee stderr <"$at_stderr"
83662at_fn_diff_devnull "$at_stdout" || at_failed=:
83663at_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.
83671cat >input <<'_ATEOF'
836721 2
83673_ATEOF
83674
83675{ set +x
83676$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
83677at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83678( $at_check_trace;  $PREPARSER ./calc input
83679) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83680at_status=$? at_failed=false
83681$at_check_filter
83682echo stderr:; tee stderr <"$at_stderr"
83683at_fn_diff_devnull "$at_stdout" || at_failed=:
83684at_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"
83690at_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>&-
83693at_status=$? at_failed=false
83694$at_check_filter
83695echo stderr:; tee stderr <"$at_stderr"
83696at_fn_diff_devnull "$at_stdout" || at_failed=:
83697at_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.
83706sed '/^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
83721mv at-stderr stderr
83722# 2. Create the reference error message.
83723cat >expout <<'_ATEOF'
837241.3: syntax error, unexpected number
83725_ATEOF
83726
83727# 3. If locations are not used, remove them.
83728sed 's/^[-0-9.]*: //' expout >at-expout
83729mv at-expout expout
83730# 4. If error-verbose is not used, strip the`, unexpected....' part.
83731sed 's/syntax error, .*$/syntax error/' expout >at-expout
83732mv at-expout expout
83733# 5. Check
83734{ set +x
83735$as_echo "$at_srcdir/calc.at:640: cat stderr"
83736at_fn_check_prepare_trace "calc.at:640"
83737( $at_check_trace; cat stderr
83738) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83739at_status=$? at_failed=false
83740$at_check_filter
83741at_fn_diff_devnull "$at_stderr" || at_failed=:
83742$at_diff expout "$at_stdout" || at_failed=:
83743at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
83744$at_failed && at_fn_log_failure
83745$at_traceon; }
83746
83747
83748cat >input <<'_ATEOF'
837491//2
83750_ATEOF
83751
83752{ set +x
83753$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
83754at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83755( $at_check_trace;  $PREPARSER ./calc input
83756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83757at_status=$? at_failed=false
83758$at_check_filter
83759echo stderr:; tee stderr <"$at_stderr"
83760at_fn_diff_devnull "$at_stdout" || at_failed=:
83761at_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"
83767at_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>&-
83770at_status=$? at_failed=false
83771$at_check_filter
83772echo stderr:; tee stderr <"$at_stderr"
83773at_fn_diff_devnull "$at_stdout" || at_failed=:
83774at_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.
83783sed '/^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
83798mv at-stderr stderr
83799# 2. Create the reference error message.
83800cat >expout <<'_ATEOF'
838011.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
83802_ATEOF
83803
83804# 3. If locations are not used, remove them.
83805sed 's/^[-0-9.]*: //' expout >at-expout
83806mv at-expout expout
83807# 4. If error-verbose is not used, strip the`, unexpected....' part.
83808sed 's/syntax error, .*$/syntax error/' expout >at-expout
83809mv at-expout expout
83810# 5. Check
83811{ set +x
83812$as_echo "$at_srcdir/calc.at:640: cat stderr"
83813at_fn_check_prepare_trace "calc.at:640"
83814( $at_check_trace; cat stderr
83815) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83816at_status=$? at_failed=false
83817$at_check_filter
83818at_fn_diff_devnull "$at_stderr" || at_failed=:
83819$at_diff expout "$at_stdout" || at_failed=:
83820at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
83821$at_failed && at_fn_log_failure
83822$at_traceon; }
83823
83824
83825cat >input <<'_ATEOF'
83826error
83827_ATEOF
83828
83829{ set +x
83830$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
83831at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83832( $at_check_trace;  $PREPARSER ./calc input
83833) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83834at_status=$? at_failed=false
83835$at_check_filter
83836echo stderr:; tee stderr <"$at_stderr"
83837at_fn_diff_devnull "$at_stdout" || at_failed=:
83838at_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"
83844at_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>&-
83847at_status=$? at_failed=false
83848$at_check_filter
83849echo stderr:; tee stderr <"$at_stderr"
83850at_fn_diff_devnull "$at_stdout" || at_failed=:
83851at_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.
83860sed '/^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
83875mv at-stderr stderr
83876# 2. Create the reference error message.
83877cat >expout <<'_ATEOF'
838781.1: syntax error, unexpected $undefined
83879_ATEOF
83880
83881# 3. If locations are not used, remove them.
83882sed 's/^[-0-9.]*: //' expout >at-expout
83883mv at-expout expout
83884# 4. If error-verbose is not used, strip the`, unexpected....' part.
83885sed 's/syntax error, .*$/syntax error/' expout >at-expout
83886mv at-expout expout
83887# 5. Check
83888{ set +x
83889$as_echo "$at_srcdir/calc.at:640: cat stderr"
83890at_fn_check_prepare_trace "calc.at:640"
83891( $at_check_trace; cat stderr
83892) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83893at_status=$? at_failed=false
83894$at_check_filter
83895at_fn_diff_devnull "$at_stderr" || at_failed=:
83896$at_diff expout "$at_stdout" || at_failed=:
83897at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
83898$at_failed && at_fn_log_failure
83899$at_traceon; }
83900
83901
83902cat >input <<'_ATEOF'
839031 = 2 = 3
83904_ATEOF
83905
83906{ set +x
83907$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
83908at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83909( $at_check_trace;  $PREPARSER ./calc input
83910) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83911at_status=$? at_failed=false
83912$at_check_filter
83913echo stderr:; tee stderr <"$at_stderr"
83914at_fn_diff_devnull "$at_stdout" || at_failed=:
83915at_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"
83921at_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>&-
83924at_status=$? at_failed=false
83925$at_check_filter
83926echo stderr:; tee stderr <"$at_stderr"
83927at_fn_diff_devnull "$at_stdout" || at_failed=:
83928at_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.
83937sed '/^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
83952mv at-stderr stderr
83953# 2. Create the reference error message.
83954cat >expout <<'_ATEOF'
839551.7: syntax error, unexpected '='
83956_ATEOF
83957
83958# 3. If locations are not used, remove them.
83959sed 's/^[-0-9.]*: //' expout >at-expout
83960mv at-expout expout
83961# 4. If error-verbose is not used, strip the`, unexpected....' part.
83962sed 's/syntax error, .*$/syntax error/' expout >at-expout
83963mv at-expout expout
83964# 5. Check
83965{ set +x
83966$as_echo "$at_srcdir/calc.at:640: cat stderr"
83967at_fn_check_prepare_trace "calc.at:640"
83968( $at_check_trace; cat stderr
83969) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83970at_status=$? at_failed=false
83971$at_check_filter
83972at_fn_diff_devnull "$at_stderr" || at_failed=:
83973$at_diff expout "$at_stdout" || at_failed=:
83974at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
83975$at_failed && at_fn_log_failure
83976$at_traceon; }
83977
83978
83979cat >input <<'_ATEOF'
83980
83981+1
83982_ATEOF
83983
83984{ set +x
83985$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
83986at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
83987( $at_check_trace;  $PREPARSER ./calc input
83988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
83989at_status=$? at_failed=false
83990$at_check_filter
83991echo stderr:; tee stderr <"$at_stderr"
83992at_fn_diff_devnull "$at_stdout" || at_failed=:
83993at_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"
83999at_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>&-
84002at_status=$? at_failed=false
84003$at_check_filter
84004echo stderr:; tee stderr <"$at_stderr"
84005at_fn_diff_devnull "$at_stdout" || at_failed=:
84006at_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.
84015sed '/^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
84030mv at-stderr stderr
84031# 2. Create the reference error message.
84032cat >expout <<'_ATEOF'
840332.1: syntax error, unexpected '+'
84034_ATEOF
84035
84036# 3. If locations are not used, remove them.
84037sed 's/^[-0-9.]*: //' expout >at-expout
84038mv at-expout expout
84039# 4. If error-verbose is not used, strip the`, unexpected....' part.
84040sed 's/syntax error, .*$/syntax error/' expout >at-expout
84041mv at-expout expout
84042# 5. Check
84043{ set +x
84044$as_echo "$at_srcdir/calc.at:640: cat stderr"
84045at_fn_check_prepare_trace "calc.at:640"
84046( $at_check_trace; cat stderr
84047) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84048at_status=$? at_failed=false
84049$at_check_filter
84050at_fn_diff_devnull "$at_stderr" || at_failed=:
84051$at_diff expout "$at_stdout" || at_failed=:
84052at_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"
84060at_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>&-
84063at_status=$? at_failed=false
84064$at_check_filter
84065echo stderr:; tee stderr <"$at_stderr"
84066at_fn_diff_devnull "$at_stdout" || at_failed=:
84067at_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"
84073at_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>&-
84076at_status=$? at_failed=false
84077$at_check_filter
84078echo stderr:; tee stderr <"$at_stderr"
84079at_fn_diff_devnull "$at_stdout" || at_failed=:
84080at_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.
84089sed '/^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
84104mv at-stderr stderr
84105# 2. Create the reference error message.
84106cat >expout <<'_ATEOF'
841071.1: syntax error, unexpected end of input
84108_ATEOF
84109
84110# 3. If locations are not used, remove them.
84111sed 's/^[-0-9.]*: //' expout >at-expout
84112mv at-expout expout
84113# 4. If error-verbose is not used, strip the`, unexpected....' part.
84114sed 's/syntax error, .*$/syntax error/' expout >at-expout
84115mv at-expout expout
84116# 5. Check
84117{ set +x
84118$as_echo "$at_srcdir/calc.at:640: cat stderr"
84119at_fn_check_prepare_trace "calc.at:640"
84120( $at_check_trace; cat stderr
84121) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84122at_status=$? at_failed=false
84123$at_check_filter
84124at_fn_diff_devnull "$at_stderr" || at_failed=:
84125$at_diff expout "$at_stdout" || at_failed=:
84126at_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#
84148cat >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"
84154at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
84155( $at_check_trace;  $PREPARSER ./calc input
84156) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84157at_status=$? at_failed=false
84158$at_check_filter
84159echo stderr:; tee stderr <"$at_stderr"
84160at_fn_diff_devnull "$at_stdout" || at_failed=:
84161at_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"
84167at_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>&-
84170at_status=$? at_failed=false
84171$at_check_filter
84172echo stderr:; tee stderr <"$at_stderr"
84173at_fn_diff_devnull "$at_stdout" || at_failed=:
84174at_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.
84183sed '/^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
84198mv at-stderr stderr
84199# 2. Create the reference error message.
84200cat >expout <<'_ATEOF'
842011.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
842021.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
842031.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
842041.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
84205calc: error: 4444 != 1
84206_ATEOF
84207
84208# 3. If locations are not used, remove them.
84209sed 's/^[-0-9.]*: //' expout >at-expout
84210mv at-expout expout
84211# 4. If error-verbose is not used, strip the`, unexpected....' part.
84212sed 's/syntax error, .*$/syntax error/' expout >at-expout
84213mv at-expout expout
84214# 5. Check
84215{ set +x
84216$as_echo "$at_srcdir/calc.at:640: cat stderr"
84217at_fn_check_prepare_trace "calc.at:640"
84218( $at_check_trace; cat stderr
84219) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84220at_status=$? at_failed=false
84221$at_check_filter
84222at_fn_diff_devnull "$at_stderr" || at_failed=:
84223$at_diff expout "$at_stdout" || at_failed=:
84224at_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.
84232cat >input <<'_ATEOF'
84233(!) + (1 2) = 1
84234_ATEOF
84235
84236{ set +x
84237$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
84238at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
84239( $at_check_trace;  $PREPARSER ./calc input
84240) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84241at_status=$? at_failed=false
84242$at_check_filter
84243echo stderr:; tee stderr <"$at_stderr"
84244at_fn_diff_devnull "$at_stdout" || at_failed=:
84245at_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"
84251at_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>&-
84254at_status=$? at_failed=false
84255$at_check_filter
84256echo stderr:; tee stderr <"$at_stderr"
84257at_fn_diff_devnull "$at_stdout" || at_failed=:
84258at_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.
84267sed '/^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
84282mv at-stderr stderr
84283# 2. Create the reference error message.
84284cat >expout <<'_ATEOF'
842851.10: syntax error, unexpected number
84286calc: error: 2222 != 1
84287_ATEOF
84288
84289# 3. If locations are not used, remove them.
84290sed 's/^[-0-9.]*: //' expout >at-expout
84291mv at-expout expout
84292# 4. If error-verbose is not used, strip the`, unexpected....' part.
84293sed 's/syntax error, .*$/syntax error/' expout >at-expout
84294mv at-expout expout
84295# 5. Check
84296{ set +x
84297$as_echo "$at_srcdir/calc.at:640: cat stderr"
84298at_fn_check_prepare_trace "calc.at:640"
84299( $at_check_trace; cat stderr
84300) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84301at_status=$? at_failed=false
84302$at_check_filter
84303at_fn_diff_devnull "$at_stderr" || at_failed=:
84304$at_diff expout "$at_stdout" || at_failed=:
84305at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
84306$at_failed && at_fn_log_failure
84307$at_traceon; }
84308
84309
84310cat >input <<'_ATEOF'
84311(- *) + (1 2) = 1
84312_ATEOF
84313
84314{ set +x
84315$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
84316at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
84317( $at_check_trace;  $PREPARSER ./calc input
84318) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84319at_status=$? at_failed=false
84320$at_check_filter
84321echo stderr:; tee stderr <"$at_stderr"
84322at_fn_diff_devnull "$at_stdout" || at_failed=:
84323at_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"
84329at_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>&-
84332at_status=$? at_failed=false
84333$at_check_filter
84334echo stderr:; tee stderr <"$at_stderr"
84335at_fn_diff_devnull "$at_stdout" || at_failed=:
84336at_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.
84345sed '/^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
84360mv at-stderr stderr
84361# 2. Create the reference error message.
84362cat >expout <<'_ATEOF'
843631.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
843641.12: syntax error, unexpected number
84365calc: error: 2222 != 1
84366_ATEOF
84367
84368# 3. If locations are not used, remove them.
84369sed 's/^[-0-9.]*: //' expout >at-expout
84370mv at-expout expout
84371# 4. If error-verbose is not used, strip the`, unexpected....' part.
84372sed 's/syntax error, .*$/syntax error/' expout >at-expout
84373mv at-expout expout
84374# 5. Check
84375{ set +x
84376$as_echo "$at_srcdir/calc.at:640: cat stderr"
84377at_fn_check_prepare_trace "calc.at:640"
84378( $at_check_trace; cat stderr
84379) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84380at_status=$? at_failed=false
84381$at_check_filter
84382at_fn_diff_devnull "$at_stderr" || at_failed=:
84383$at_diff expout "$at_stdout" || at_failed=:
84384at_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.
84392cat >input <<'_ATEOF'
84393(* *) + (*) + (*)
84394_ATEOF
84395
84396{ set +x
84397$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
84398at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
84399( $at_check_trace;  $PREPARSER ./calc input
84400) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84401at_status=$? at_failed=false
84402$at_check_filter
84403echo stderr:; tee stderr <"$at_stderr"
84404at_fn_diff_devnull "$at_stdout" || at_failed=:
84405at_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"
84411at_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>&-
84414at_status=$? at_failed=false
84415$at_check_filter
84416echo stderr:; tee stderr <"$at_stderr"
84417at_fn_diff_devnull "$at_stdout" || at_failed=:
84418at_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.
84427sed '/^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
84442mv at-stderr stderr
84443# 2. Create the reference error message.
84444cat >expout <<'_ATEOF'
844451.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
844461.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
844471.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
84448_ATEOF
84449
84450# 3. If locations are not used, remove them.
84451sed 's/^[-0-9.]*: //' expout >at-expout
84452mv at-expout expout
84453# 4. If error-verbose is not used, strip the`, unexpected....' part.
84454sed 's/syntax error, .*$/syntax error/' expout >at-expout
84455mv at-expout expout
84456# 5. Check
84457{ set +x
84458$as_echo "$at_srcdir/calc.at:640: cat stderr"
84459at_fn_check_prepare_trace "calc.at:640"
84460( $at_check_trace; cat stderr
84461) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84462at_status=$? at_failed=false
84463$at_check_filter
84464at_fn_diff_devnull "$at_stderr" || at_failed=:
84465$at_diff expout "$at_stdout" || at_failed=:
84466at_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
84477read at_status <"$at_status_file"
84478#AT_STOP_219
84479#AT_START_220
84480at_fn_group_banner 220 'calc.at:641' \
84481  "Calculator %glr-parser %locations" "              " 12
84482at_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
84496cat >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
84537FILE *input;
84538static int power (int base, int exponent);
84539
84540static void yyerror ( const char *msg);
84541int 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%%
84559input:
84560  line
84561| input line         {  }
84562;
84563
84564line:
84565  '\n'
84566| exp '\n'           { USE ($1); }
84567;
84568
84569exp:
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
84590static int
84591power (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.  */
84603static
84604void 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
84612int yylex (void);
84613static int get_char (void);
84614static void unget_char ( int c);
84615
84616
84617static YYLTYPE last_yylloc;
84618
84619static int
84620get_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
84637static void
84638unget_char ( int c)
84639{
84640  ;
84641
84642  /* Wrong when C == `\n'. */
84643  (yylloc) = last_yylloc;
84644
84645  ungetc (c, input);
84646}
84647
84648static int
84649read_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
84680int 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
84718semantic_value global_result = 0;
84719int global_count = 0;
84720
84721/* A C main function.  */
84722int
84723main (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
84762if 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"
84770at_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>&-
84774at_status=$? at_failed=false
84775$at_check_filter
84776echo stderr:; cat "$at_stderr"
84777echo stdout:; cat "$at_stdout"
84778at_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"
84784at_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>&-
84787at_status=$? at_failed=false
84788$at_check_filter
84789echo stderr:; cat "$at_stderr"
84790echo stdout:; cat "$at_stdout"
84791at_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"
84800at_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>&-
84805at_status=$? at_failed=false
84806$at_check_filter
84807at_fn_diff_devnull "$at_stderr" || at_failed=:
84808$at_diff expout "$at_stdout" || at_failed=:
84809at_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"
84818at_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>&-
84823at_status=$? at_failed=false
84824$at_check_filter
84825at_fn_diff_devnull "$at_stderr" || at_failed=:
84826$at_diff expout "$at_stdout" || at_failed=:
84827at_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
84833fi
84834{ set +x
84835$as_echo "$at_srcdir/calc.at:641: bison -o calc.c calc.y"
84836at_fn_check_prepare_trace "calc.at:641"
84837( $at_check_trace; bison -o calc.c calc.y
84838) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84839at_status=$? at_failed=false
84840$at_check_filter
84841at_fn_diff_devnull "$at_stderr" || at_failed=:
84842at_fn_diff_devnull "$at_stdout" || at_failed=:
84843at_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"
84850at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641"
84851( $at_check_trace; $BISON_C_WORKS
84852) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84853at_status=$? at_failed=false
84854$at_check_filter
84855echo stderr:; cat "$at_stderr"
84856echo stdout:; cat "$at_stdout"
84857at_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"
84863at_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>&-
84866at_status=$? at_failed=false
84867$at_check_filter
84868echo stderr:; cat "$at_stderr"
84869echo stdout:; cat "$at_stdout"
84870at_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"
84885at_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>&-
84896at_status=$? at_failed=false
84897$at_check_filter
84898at_fn_diff_devnull "$at_stderr" || at_failed=:
84899at_fn_diff_devnull "$at_stdout" || at_failed=:
84900at_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.
84907cat >input <<'_ATEOF'
849081 + 2 * 3 = 7
849091 + 2 * -3 = -5
84910
84911-1^2 = -1
84912(-1)^2 = 1
84913
84914---1 = -1
84915
849161 - 2 - 3 = -4
849171 - (2 - 3) = 2
84918
849192^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"
84925at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
84926( $at_check_trace;  $PREPARSER ./calc input
84927) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84928at_status=$? at_failed=false
84929$at_check_filter
84930echo stderr:; tee stderr <"$at_stderr"
84931at_fn_diff_devnull "$at_stdout" || at_failed=:
84932at_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"
84938at_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>&-
84941at_status=$? at_failed=false
84942$at_check_filter
84943echo stderr:; tee stderr <"$at_stderr"
84944at_fn_diff_devnull "$at_stdout" || at_failed=:
84945at_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.
84953cat >input <<'_ATEOF'
849541 2
84955_ATEOF
84956
84957{ set +x
84958$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
84959at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
84960( $at_check_trace;  $PREPARSER ./calc input
84961) >>"$at_stdout" 2>>"$at_stderr" 5>&-
84962at_status=$? at_failed=false
84963$at_check_filter
84964echo stderr:; tee stderr <"$at_stderr"
84965at_fn_diff_devnull "$at_stdout" || at_failed=:
84966at_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"
84972at_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>&-
84975at_status=$? at_failed=false
84976$at_check_filter
84977echo stderr:; tee stderr <"$at_stderr"
84978at_fn_diff_devnull "$at_stdout" || at_failed=:
84979at_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.
84988sed '/^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
85003mv at-stderr stderr
85004# 2. Create the reference error message.
85005cat >expout <<'_ATEOF'
850061.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.
85012sed 's/syntax error, .*$/syntax error/' expout >at-expout
85013mv at-expout expout
85014# 5. Check
85015{ set +x
85016$as_echo "$at_srcdir/calc.at:641: cat stderr"
85017at_fn_check_prepare_trace "calc.at:641"
85018( $at_check_trace; cat stderr
85019) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85020at_status=$? at_failed=false
85021$at_check_filter
85022at_fn_diff_devnull "$at_stderr" || at_failed=:
85023$at_diff expout "$at_stdout" || at_failed=:
85024at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
85025$at_failed && at_fn_log_failure
85026$at_traceon; }
85027
85028
85029cat >input <<'_ATEOF'
850301//2
85031_ATEOF
85032
85033{ set +x
85034$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85035at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85036( $at_check_trace;  $PREPARSER ./calc input
85037) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85038at_status=$? at_failed=false
85039$at_check_filter
85040echo stderr:; tee stderr <"$at_stderr"
85041at_fn_diff_devnull "$at_stdout" || at_failed=:
85042at_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"
85048at_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>&-
85051at_status=$? at_failed=false
85052$at_check_filter
85053echo stderr:; tee stderr <"$at_stderr"
85054at_fn_diff_devnull "$at_stdout" || at_failed=:
85055at_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.
85064sed '/^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
85079mv at-stderr stderr
85080# 2. Create the reference error message.
85081cat >expout <<'_ATEOF'
850821.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.
85088sed 's/syntax error, .*$/syntax error/' expout >at-expout
85089mv at-expout expout
85090# 5. Check
85091{ set +x
85092$as_echo "$at_srcdir/calc.at:641: cat stderr"
85093at_fn_check_prepare_trace "calc.at:641"
85094( $at_check_trace; cat stderr
85095) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85096at_status=$? at_failed=false
85097$at_check_filter
85098at_fn_diff_devnull "$at_stderr" || at_failed=:
85099$at_diff expout "$at_stdout" || at_failed=:
85100at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
85101$at_failed && at_fn_log_failure
85102$at_traceon; }
85103
85104
85105cat >input <<'_ATEOF'
85106error
85107_ATEOF
85108
85109{ set +x
85110$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85111at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85112( $at_check_trace;  $PREPARSER ./calc input
85113) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85114at_status=$? at_failed=false
85115$at_check_filter
85116echo stderr:; tee stderr <"$at_stderr"
85117at_fn_diff_devnull "$at_stdout" || at_failed=:
85118at_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"
85124at_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>&-
85127at_status=$? at_failed=false
85128$at_check_filter
85129echo stderr:; tee stderr <"$at_stderr"
85130at_fn_diff_devnull "$at_stdout" || at_failed=:
85131at_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.
85140sed '/^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
85155mv at-stderr stderr
85156# 2. Create the reference error message.
85157cat >expout <<'_ATEOF'
851581.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.
85164sed 's/syntax error, .*$/syntax error/' expout >at-expout
85165mv at-expout expout
85166# 5. Check
85167{ set +x
85168$as_echo "$at_srcdir/calc.at:641: cat stderr"
85169at_fn_check_prepare_trace "calc.at:641"
85170( $at_check_trace; cat stderr
85171) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85172at_status=$? at_failed=false
85173$at_check_filter
85174at_fn_diff_devnull "$at_stderr" || at_failed=:
85175$at_diff expout "$at_stdout" || at_failed=:
85176at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
85177$at_failed && at_fn_log_failure
85178$at_traceon; }
85179
85180
85181cat >input <<'_ATEOF'
851821 = 2 = 3
85183_ATEOF
85184
85185{ set +x
85186$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85187at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85188( $at_check_trace;  $PREPARSER ./calc input
85189) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85190at_status=$? at_failed=false
85191$at_check_filter
85192echo stderr:; tee stderr <"$at_stderr"
85193at_fn_diff_devnull "$at_stdout" || at_failed=:
85194at_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"
85200at_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>&-
85203at_status=$? at_failed=false
85204$at_check_filter
85205echo stderr:; tee stderr <"$at_stderr"
85206at_fn_diff_devnull "$at_stdout" || at_failed=:
85207at_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.
85216sed '/^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
85231mv at-stderr stderr
85232# 2. Create the reference error message.
85233cat >expout <<'_ATEOF'
852341.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.
85240sed 's/syntax error, .*$/syntax error/' expout >at-expout
85241mv at-expout expout
85242# 5. Check
85243{ set +x
85244$as_echo "$at_srcdir/calc.at:641: cat stderr"
85245at_fn_check_prepare_trace "calc.at:641"
85246( $at_check_trace; cat stderr
85247) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85248at_status=$? at_failed=false
85249$at_check_filter
85250at_fn_diff_devnull "$at_stderr" || at_failed=:
85251$at_diff expout "$at_stdout" || at_failed=:
85252at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
85253$at_failed && at_fn_log_failure
85254$at_traceon; }
85255
85256
85257cat >input <<'_ATEOF'
85258
85259+1
85260_ATEOF
85261
85262{ set +x
85263$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85264at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85265( $at_check_trace;  $PREPARSER ./calc input
85266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85267at_status=$? at_failed=false
85268$at_check_filter
85269echo stderr:; tee stderr <"$at_stderr"
85270at_fn_diff_devnull "$at_stdout" || at_failed=:
85271at_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"
85277at_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>&-
85280at_status=$? at_failed=false
85281$at_check_filter
85282echo stderr:; tee stderr <"$at_stderr"
85283at_fn_diff_devnull "$at_stdout" || at_failed=:
85284at_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.
85293sed '/^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
85308mv at-stderr stderr
85309# 2. Create the reference error message.
85310cat >expout <<'_ATEOF'
853112.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.
85317sed 's/syntax error, .*$/syntax error/' expout >at-expout
85318mv at-expout expout
85319# 5. Check
85320{ set +x
85321$as_echo "$at_srcdir/calc.at:641: cat stderr"
85322at_fn_check_prepare_trace "calc.at:641"
85323( $at_check_trace; cat stderr
85324) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85325at_status=$? at_failed=false
85326$at_check_filter
85327at_fn_diff_devnull "$at_stderr" || at_failed=:
85328$at_diff expout "$at_stdout" || at_failed=:
85329at_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"
85337at_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>&-
85340at_status=$? at_failed=false
85341$at_check_filter
85342echo stderr:; tee stderr <"$at_stderr"
85343at_fn_diff_devnull "$at_stdout" || at_failed=:
85344at_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"
85350at_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>&-
85353at_status=$? at_failed=false
85354$at_check_filter
85355echo stderr:; tee stderr <"$at_stderr"
85356at_fn_diff_devnull "$at_stdout" || at_failed=:
85357at_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.
85366sed '/^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
85381mv at-stderr stderr
85382# 2. Create the reference error message.
85383cat >expout <<'_ATEOF'
853841.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.
85390sed 's/syntax error, .*$/syntax error/' expout >at-expout
85391mv at-expout expout
85392# 5. Check
85393{ set +x
85394$as_echo "$at_srcdir/calc.at:641: cat stderr"
85395at_fn_check_prepare_trace "calc.at:641"
85396( $at_check_trace; cat stderr
85397) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85398at_status=$? at_failed=false
85399$at_check_filter
85400at_fn_diff_devnull "$at_stderr" || at_failed=:
85401$at_diff expout "$at_stdout" || at_failed=:
85402at_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#
85424cat >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"
85430at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85431( $at_check_trace;  $PREPARSER ./calc input
85432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85433at_status=$? at_failed=false
85434$at_check_filter
85435echo stderr:; tee stderr <"$at_stderr"
85436at_fn_diff_devnull "$at_stdout" || at_failed=:
85437at_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"
85443at_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>&-
85446at_status=$? at_failed=false
85447$at_check_filter
85448echo stderr:; tee stderr <"$at_stderr"
85449at_fn_diff_devnull "$at_stdout" || at_failed=:
85450at_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.
85459sed '/^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
85474mv at-stderr stderr
85475# 2. Create the reference error message.
85476cat >expout <<'_ATEOF'
854771.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
854781.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
854791.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
854801.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
85481calc: 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.
85487sed 's/syntax error, .*$/syntax error/' expout >at-expout
85488mv at-expout expout
85489# 5. Check
85490{ set +x
85491$as_echo "$at_srcdir/calc.at:641: cat stderr"
85492at_fn_check_prepare_trace "calc.at:641"
85493( $at_check_trace; cat stderr
85494) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85495at_status=$? at_failed=false
85496$at_check_filter
85497at_fn_diff_devnull "$at_stderr" || at_failed=:
85498$at_diff expout "$at_stdout" || at_failed=:
85499at_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.
85507cat >input <<'_ATEOF'
85508(!) + (1 2) = 1
85509_ATEOF
85510
85511{ set +x
85512$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85513at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85514( $at_check_trace;  $PREPARSER ./calc input
85515) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85516at_status=$? at_failed=false
85517$at_check_filter
85518echo stderr:; tee stderr <"$at_stderr"
85519at_fn_diff_devnull "$at_stdout" || at_failed=:
85520at_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"
85526at_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>&-
85529at_status=$? at_failed=false
85530$at_check_filter
85531echo stderr:; tee stderr <"$at_stderr"
85532at_fn_diff_devnull "$at_stdout" || at_failed=:
85533at_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.
85542sed '/^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
85557mv at-stderr stderr
85558# 2. Create the reference error message.
85559cat >expout <<'_ATEOF'
855601.10: syntax error, unexpected number
85561calc: 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.
85567sed 's/syntax error, .*$/syntax error/' expout >at-expout
85568mv at-expout expout
85569# 5. Check
85570{ set +x
85571$as_echo "$at_srcdir/calc.at:641: cat stderr"
85572at_fn_check_prepare_trace "calc.at:641"
85573( $at_check_trace; cat stderr
85574) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85575at_status=$? at_failed=false
85576$at_check_filter
85577at_fn_diff_devnull "$at_stderr" || at_failed=:
85578$at_diff expout "$at_stdout" || at_failed=:
85579at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
85580$at_failed && at_fn_log_failure
85581$at_traceon; }
85582
85583
85584cat >input <<'_ATEOF'
85585(- *) + (1 2) = 1
85586_ATEOF
85587
85588{ set +x
85589$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85590at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85591( $at_check_trace;  $PREPARSER ./calc input
85592) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85593at_status=$? at_failed=false
85594$at_check_filter
85595echo stderr:; tee stderr <"$at_stderr"
85596at_fn_diff_devnull "$at_stdout" || at_failed=:
85597at_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"
85603at_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>&-
85606at_status=$? at_failed=false
85607$at_check_filter
85608echo stderr:; tee stderr <"$at_stderr"
85609at_fn_diff_devnull "$at_stdout" || at_failed=:
85610at_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.
85619sed '/^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
85634mv at-stderr stderr
85635# 2. Create the reference error message.
85636cat >expout <<'_ATEOF'
856371.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
856381.12: syntax error, unexpected number
85639calc: 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.
85645sed 's/syntax error, .*$/syntax error/' expout >at-expout
85646mv at-expout expout
85647# 5. Check
85648{ set +x
85649$as_echo "$at_srcdir/calc.at:641: cat stderr"
85650at_fn_check_prepare_trace "calc.at:641"
85651( $at_check_trace; cat stderr
85652) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85653at_status=$? at_failed=false
85654$at_check_filter
85655at_fn_diff_devnull "$at_stderr" || at_failed=:
85656$at_diff expout "$at_stdout" || at_failed=:
85657at_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.
85665cat >input <<'_ATEOF'
85666(* *) + (*) + (*)
85667_ATEOF
85668
85669{ set +x
85670$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
85671at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
85672( $at_check_trace;  $PREPARSER ./calc input
85673) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85674at_status=$? at_failed=false
85675$at_check_filter
85676echo stderr:; tee stderr <"$at_stderr"
85677at_fn_diff_devnull "$at_stdout" || at_failed=:
85678at_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"
85684at_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>&-
85687at_status=$? at_failed=false
85688$at_check_filter
85689echo stderr:; tee stderr <"$at_stderr"
85690at_fn_diff_devnull "$at_stdout" || at_failed=:
85691at_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.
85700sed '/^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
85715mv at-stderr stderr
85716# 2. Create the reference error message.
85717cat >expout <<'_ATEOF'
857181.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
857191.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
857201.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.
85726sed 's/syntax error, .*$/syntax error/' expout >at-expout
85727mv at-expout expout
85728# 5. Check
85729{ set +x
85730$as_echo "$at_srcdir/calc.at:641: cat stderr"
85731at_fn_check_prepare_trace "calc.at:641"
85732( $at_check_trace; cat stderr
85733) >>"$at_stdout" 2>>"$at_stderr" 5>&-
85734at_status=$? at_failed=false
85735$at_check_filter
85736at_fn_diff_devnull "$at_stderr" || at_failed=:
85737$at_diff expout "$at_stdout" || at_failed=:
85738at_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
85749read at_status <"$at_status_file"
85750#AT_STOP_220
85751#AT_START_221
85752at_fn_group_banner 221 'calc.at:642' \
85753  "Calculator %glr-parser %name-prefix \"calc\"" "     " 12
85754at_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
85768cat >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
85809FILE *input;
85810static int power (int base, int exponent);
85811
85812static void calcerror ( const char *msg);
85813int 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%%
85831input:
85832  line
85833| input line         {  }
85834;
85835
85836line:
85837  '\n'
85838| exp '\n'           { USE ($1); }
85839;
85840
85841exp:
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
85862static int
85863power (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.  */
85875static
85876void calcerror ( const char *msg)
85877{
85878  fprintf (stderr, "%s\n", msg);
85879}
85880#include <ctype.h>
85881
85882int calclex (void);
85883static int get_char (void);
85884static void unget_char ( int c);
85885
85886
85887static int
85888get_char (void)
85889{
85890  int res = getc (input);
85891  ;
85892
85893  return res;
85894}
85895
85896static void
85897unget_char ( int c)
85898{
85899  ;
85900
85901  ungetc (c, input);
85902}
85903
85904static int
85905read_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
85936int 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
85972semantic_value global_result = 0;
85973int global_count = 0;
85974
85975/* A C main function.  */
85976int
85977main (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
86016if 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"
86024at_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>&-
86028at_status=$? at_failed=false
86029$at_check_filter
86030echo stderr:; cat "$at_stderr"
86031echo stdout:; cat "$at_stdout"
86032at_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"
86038at_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>&-
86041at_status=$? at_failed=false
86042$at_check_filter
86043echo stderr:; cat "$at_stderr"
86044echo stdout:; cat "$at_stdout"
86045at_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"
86054at_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>&-
86059at_status=$? at_failed=false
86060$at_check_filter
86061at_fn_diff_devnull "$at_stderr" || at_failed=:
86062$at_diff expout "$at_stdout" || at_failed=:
86063at_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"
86072at_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>&-
86077at_status=$? at_failed=false
86078$at_check_filter
86079at_fn_diff_devnull "$at_stderr" || at_failed=:
86080$at_diff expout "$at_stdout" || at_failed=:
86081at_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
86087fi
86088{ set +x
86089$as_echo "$at_srcdir/calc.at:642: bison -o calc.c calc.y"
86090at_fn_check_prepare_trace "calc.at:642"
86091( $at_check_trace; bison -o calc.c calc.y
86092) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86093at_status=$? at_failed=false
86094$at_check_filter
86095at_fn_diff_devnull "$at_stderr" || at_failed=:
86096at_fn_diff_devnull "$at_stdout" || at_failed=:
86097at_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"
86104at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642"
86105( $at_check_trace; $BISON_C_WORKS
86106) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86107at_status=$? at_failed=false
86108$at_check_filter
86109echo stderr:; cat "$at_stderr"
86110echo stdout:; cat "$at_stdout"
86111at_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"
86117at_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>&-
86120at_status=$? at_failed=false
86121$at_check_filter
86122echo stderr:; cat "$at_stderr"
86123echo stdout:; cat "$at_stdout"
86124at_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"
86139at_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>&-
86150at_status=$? at_failed=false
86151$at_check_filter
86152at_fn_diff_devnull "$at_stderr" || at_failed=:
86153at_fn_diff_devnull "$at_stdout" || at_failed=:
86154at_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.
86161cat >input <<'_ATEOF'
861621 + 2 * 3 = 7
861631 + 2 * -3 = -5
86164
86165-1^2 = -1
86166(-1)^2 = 1
86167
86168---1 = -1
86169
861701 - 2 - 3 = -4
861711 - (2 - 3) = 2
86172
861732^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"
86179at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86180( $at_check_trace;  $PREPARSER ./calc input
86181) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86182at_status=$? at_failed=false
86183$at_check_filter
86184echo stderr:; tee stderr <"$at_stderr"
86185at_fn_diff_devnull "$at_stdout" || at_failed=:
86186at_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"
86192at_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>&-
86195at_status=$? at_failed=false
86196$at_check_filter
86197echo stderr:; tee stderr <"$at_stderr"
86198at_fn_diff_devnull "$at_stdout" || at_failed=:
86199at_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.
86207cat >input <<'_ATEOF'
862081 2
86209_ATEOF
86210
86211{ set +x
86212$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86213at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86214( $at_check_trace;  $PREPARSER ./calc input
86215) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86216at_status=$? at_failed=false
86217$at_check_filter
86218echo stderr:; tee stderr <"$at_stderr"
86219at_fn_diff_devnull "$at_stdout" || at_failed=:
86220at_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"
86226at_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>&-
86229at_status=$? at_failed=false
86230$at_check_filter
86231echo stderr:; tee stderr <"$at_stderr"
86232at_fn_diff_devnull "$at_stdout" || at_failed=:
86233at_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.
86242sed '/^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
86257mv at-stderr stderr
86258# 2. Create the reference error message.
86259cat >expout <<'_ATEOF'
862601.3: syntax error, unexpected number
86261_ATEOF
86262
86263# 3. If locations are not used, remove them.
86264sed 's/^[-0-9.]*: //' expout >at-expout
86265mv at-expout expout
86266# 4. If error-verbose is not used, strip the`, unexpected....' part.
86267sed 's/syntax error, .*$/syntax error/' expout >at-expout
86268mv at-expout expout
86269# 5. Check
86270{ set +x
86271$as_echo "$at_srcdir/calc.at:642: cat stderr"
86272at_fn_check_prepare_trace "calc.at:642"
86273( $at_check_trace; cat stderr
86274) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86275at_status=$? at_failed=false
86276$at_check_filter
86277at_fn_diff_devnull "$at_stderr" || at_failed=:
86278$at_diff expout "$at_stdout" || at_failed=:
86279at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
86280$at_failed && at_fn_log_failure
86281$at_traceon; }
86282
86283
86284cat >input <<'_ATEOF'
862851//2
86286_ATEOF
86287
86288{ set +x
86289$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86290at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86291( $at_check_trace;  $PREPARSER ./calc input
86292) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86293at_status=$? at_failed=false
86294$at_check_filter
86295echo stderr:; tee stderr <"$at_stderr"
86296at_fn_diff_devnull "$at_stdout" || at_failed=:
86297at_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"
86303at_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>&-
86306at_status=$? at_failed=false
86307$at_check_filter
86308echo stderr:; tee stderr <"$at_stderr"
86309at_fn_diff_devnull "$at_stdout" || at_failed=:
86310at_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.
86319sed '/^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
86334mv at-stderr stderr
86335# 2. Create the reference error message.
86336cat >expout <<'_ATEOF'
863371.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
86338_ATEOF
86339
86340# 3. If locations are not used, remove them.
86341sed 's/^[-0-9.]*: //' expout >at-expout
86342mv at-expout expout
86343# 4. If error-verbose is not used, strip the`, unexpected....' part.
86344sed 's/syntax error, .*$/syntax error/' expout >at-expout
86345mv at-expout expout
86346# 5. Check
86347{ set +x
86348$as_echo "$at_srcdir/calc.at:642: cat stderr"
86349at_fn_check_prepare_trace "calc.at:642"
86350( $at_check_trace; cat stderr
86351) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86352at_status=$? at_failed=false
86353$at_check_filter
86354at_fn_diff_devnull "$at_stderr" || at_failed=:
86355$at_diff expout "$at_stdout" || at_failed=:
86356at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
86357$at_failed && at_fn_log_failure
86358$at_traceon; }
86359
86360
86361cat >input <<'_ATEOF'
86362error
86363_ATEOF
86364
86365{ set +x
86366$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86367at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86368( $at_check_trace;  $PREPARSER ./calc input
86369) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86370at_status=$? at_failed=false
86371$at_check_filter
86372echo stderr:; tee stderr <"$at_stderr"
86373at_fn_diff_devnull "$at_stdout" || at_failed=:
86374at_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"
86380at_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>&-
86383at_status=$? at_failed=false
86384$at_check_filter
86385echo stderr:; tee stderr <"$at_stderr"
86386at_fn_diff_devnull "$at_stdout" || at_failed=:
86387at_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.
86396sed '/^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
86411mv at-stderr stderr
86412# 2. Create the reference error message.
86413cat >expout <<'_ATEOF'
864141.1: syntax error, unexpected $undefined
86415_ATEOF
86416
86417# 3. If locations are not used, remove them.
86418sed 's/^[-0-9.]*: //' expout >at-expout
86419mv at-expout expout
86420# 4. If error-verbose is not used, strip the`, unexpected....' part.
86421sed 's/syntax error, .*$/syntax error/' expout >at-expout
86422mv at-expout expout
86423# 5. Check
86424{ set +x
86425$as_echo "$at_srcdir/calc.at:642: cat stderr"
86426at_fn_check_prepare_trace "calc.at:642"
86427( $at_check_trace; cat stderr
86428) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86429at_status=$? at_failed=false
86430$at_check_filter
86431at_fn_diff_devnull "$at_stderr" || at_failed=:
86432$at_diff expout "$at_stdout" || at_failed=:
86433at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
86434$at_failed && at_fn_log_failure
86435$at_traceon; }
86436
86437
86438cat >input <<'_ATEOF'
864391 = 2 = 3
86440_ATEOF
86441
86442{ set +x
86443$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86444at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86445( $at_check_trace;  $PREPARSER ./calc input
86446) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86447at_status=$? at_failed=false
86448$at_check_filter
86449echo stderr:; tee stderr <"$at_stderr"
86450at_fn_diff_devnull "$at_stdout" || at_failed=:
86451at_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"
86457at_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>&-
86460at_status=$? at_failed=false
86461$at_check_filter
86462echo stderr:; tee stderr <"$at_stderr"
86463at_fn_diff_devnull "$at_stdout" || at_failed=:
86464at_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.
86473sed '/^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
86488mv at-stderr stderr
86489# 2. Create the reference error message.
86490cat >expout <<'_ATEOF'
864911.7: syntax error, unexpected '='
86492_ATEOF
86493
86494# 3. If locations are not used, remove them.
86495sed 's/^[-0-9.]*: //' expout >at-expout
86496mv at-expout expout
86497# 4. If error-verbose is not used, strip the`, unexpected....' part.
86498sed 's/syntax error, .*$/syntax error/' expout >at-expout
86499mv at-expout expout
86500# 5. Check
86501{ set +x
86502$as_echo "$at_srcdir/calc.at:642: cat stderr"
86503at_fn_check_prepare_trace "calc.at:642"
86504( $at_check_trace; cat stderr
86505) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86506at_status=$? at_failed=false
86507$at_check_filter
86508at_fn_diff_devnull "$at_stderr" || at_failed=:
86509$at_diff expout "$at_stdout" || at_failed=:
86510at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
86511$at_failed && at_fn_log_failure
86512$at_traceon; }
86513
86514
86515cat >input <<'_ATEOF'
86516
86517+1
86518_ATEOF
86519
86520{ set +x
86521$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86522at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86523( $at_check_trace;  $PREPARSER ./calc input
86524) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86525at_status=$? at_failed=false
86526$at_check_filter
86527echo stderr:; tee stderr <"$at_stderr"
86528at_fn_diff_devnull "$at_stdout" || at_failed=:
86529at_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"
86535at_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>&-
86538at_status=$? at_failed=false
86539$at_check_filter
86540echo stderr:; tee stderr <"$at_stderr"
86541at_fn_diff_devnull "$at_stdout" || at_failed=:
86542at_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.
86551sed '/^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
86566mv at-stderr stderr
86567# 2. Create the reference error message.
86568cat >expout <<'_ATEOF'
865692.1: syntax error, unexpected '+'
86570_ATEOF
86571
86572# 3. If locations are not used, remove them.
86573sed 's/^[-0-9.]*: //' expout >at-expout
86574mv at-expout expout
86575# 4. If error-verbose is not used, strip the`, unexpected....' part.
86576sed 's/syntax error, .*$/syntax error/' expout >at-expout
86577mv at-expout expout
86578# 5. Check
86579{ set +x
86580$as_echo "$at_srcdir/calc.at:642: cat stderr"
86581at_fn_check_prepare_trace "calc.at:642"
86582( $at_check_trace; cat stderr
86583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86584at_status=$? at_failed=false
86585$at_check_filter
86586at_fn_diff_devnull "$at_stderr" || at_failed=:
86587$at_diff expout "$at_stdout" || at_failed=:
86588at_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"
86596at_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>&-
86599at_status=$? at_failed=false
86600$at_check_filter
86601echo stderr:; tee stderr <"$at_stderr"
86602at_fn_diff_devnull "$at_stdout" || at_failed=:
86603at_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"
86609at_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>&-
86612at_status=$? at_failed=false
86613$at_check_filter
86614echo stderr:; tee stderr <"$at_stderr"
86615at_fn_diff_devnull "$at_stdout" || at_failed=:
86616at_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.
86625sed '/^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
86640mv at-stderr stderr
86641# 2. Create the reference error message.
86642cat >expout <<'_ATEOF'
866431.1: syntax error, unexpected end of input
86644_ATEOF
86645
86646# 3. If locations are not used, remove them.
86647sed 's/^[-0-9.]*: //' expout >at-expout
86648mv at-expout expout
86649# 4. If error-verbose is not used, strip the`, unexpected....' part.
86650sed 's/syntax error, .*$/syntax error/' expout >at-expout
86651mv at-expout expout
86652# 5. Check
86653{ set +x
86654$as_echo "$at_srcdir/calc.at:642: cat stderr"
86655at_fn_check_prepare_trace "calc.at:642"
86656( $at_check_trace; cat stderr
86657) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86658at_status=$? at_failed=false
86659$at_check_filter
86660at_fn_diff_devnull "$at_stderr" || at_failed=:
86661$at_diff expout "$at_stdout" || at_failed=:
86662at_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#
86684cat >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"
86690at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86691( $at_check_trace;  $PREPARSER ./calc input
86692) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86693at_status=$? at_failed=false
86694$at_check_filter
86695echo stderr:; tee stderr <"$at_stderr"
86696at_fn_diff_devnull "$at_stdout" || at_failed=:
86697at_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"
86703at_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>&-
86706at_status=$? at_failed=false
86707$at_check_filter
86708echo stderr:; tee stderr <"$at_stderr"
86709at_fn_diff_devnull "$at_stdout" || at_failed=:
86710at_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.
86719sed '/^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
86734mv at-stderr stderr
86735# 2. Create the reference error message.
86736cat >expout <<'_ATEOF'
867371.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
867381.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
867391.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
867401.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
86741calc: error: 4444 != 1
86742_ATEOF
86743
86744# 3. If locations are not used, remove them.
86745sed 's/^[-0-9.]*: //' expout >at-expout
86746mv at-expout expout
86747# 4. If error-verbose is not used, strip the`, unexpected....' part.
86748sed 's/syntax error, .*$/syntax error/' expout >at-expout
86749mv at-expout expout
86750# 5. Check
86751{ set +x
86752$as_echo "$at_srcdir/calc.at:642: cat stderr"
86753at_fn_check_prepare_trace "calc.at:642"
86754( $at_check_trace; cat stderr
86755) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86756at_status=$? at_failed=false
86757$at_check_filter
86758at_fn_diff_devnull "$at_stderr" || at_failed=:
86759$at_diff expout "$at_stdout" || at_failed=:
86760at_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.
86768cat >input <<'_ATEOF'
86769(!) + (1 2) = 1
86770_ATEOF
86771
86772{ set +x
86773$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86774at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86775( $at_check_trace;  $PREPARSER ./calc input
86776) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86777at_status=$? at_failed=false
86778$at_check_filter
86779echo stderr:; tee stderr <"$at_stderr"
86780at_fn_diff_devnull "$at_stdout" || at_failed=:
86781at_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"
86787at_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>&-
86790at_status=$? at_failed=false
86791$at_check_filter
86792echo stderr:; tee stderr <"$at_stderr"
86793at_fn_diff_devnull "$at_stdout" || at_failed=:
86794at_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.
86803sed '/^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
86818mv at-stderr stderr
86819# 2. Create the reference error message.
86820cat >expout <<'_ATEOF'
868211.10: syntax error, unexpected number
86822calc: error: 2222 != 1
86823_ATEOF
86824
86825# 3. If locations are not used, remove them.
86826sed 's/^[-0-9.]*: //' expout >at-expout
86827mv at-expout expout
86828# 4. If error-verbose is not used, strip the`, unexpected....' part.
86829sed 's/syntax error, .*$/syntax error/' expout >at-expout
86830mv at-expout expout
86831# 5. Check
86832{ set +x
86833$as_echo "$at_srcdir/calc.at:642: cat stderr"
86834at_fn_check_prepare_trace "calc.at:642"
86835( $at_check_trace; cat stderr
86836) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86837at_status=$? at_failed=false
86838$at_check_filter
86839at_fn_diff_devnull "$at_stderr" || at_failed=:
86840$at_diff expout "$at_stdout" || at_failed=:
86841at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
86842$at_failed && at_fn_log_failure
86843$at_traceon; }
86844
86845
86846cat >input <<'_ATEOF'
86847(- *) + (1 2) = 1
86848_ATEOF
86849
86850{ set +x
86851$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86852at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86853( $at_check_trace;  $PREPARSER ./calc input
86854) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86855at_status=$? at_failed=false
86856$at_check_filter
86857echo stderr:; tee stderr <"$at_stderr"
86858at_fn_diff_devnull "$at_stdout" || at_failed=:
86859at_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"
86865at_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>&-
86868at_status=$? at_failed=false
86869$at_check_filter
86870echo stderr:; tee stderr <"$at_stderr"
86871at_fn_diff_devnull "$at_stdout" || at_failed=:
86872at_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.
86881sed '/^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
86896mv at-stderr stderr
86897# 2. Create the reference error message.
86898cat >expout <<'_ATEOF'
868991.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
869001.12: syntax error, unexpected number
86901calc: error: 2222 != 1
86902_ATEOF
86903
86904# 3. If locations are not used, remove them.
86905sed 's/^[-0-9.]*: //' expout >at-expout
86906mv at-expout expout
86907# 4. If error-verbose is not used, strip the`, unexpected....' part.
86908sed 's/syntax error, .*$/syntax error/' expout >at-expout
86909mv at-expout expout
86910# 5. Check
86911{ set +x
86912$as_echo "$at_srcdir/calc.at:642: cat stderr"
86913at_fn_check_prepare_trace "calc.at:642"
86914( $at_check_trace; cat stderr
86915) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86916at_status=$? at_failed=false
86917$at_check_filter
86918at_fn_diff_devnull "$at_stderr" || at_failed=:
86919$at_diff expout "$at_stdout" || at_failed=:
86920at_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.
86928cat >input <<'_ATEOF'
86929(* *) + (*) + (*)
86930_ATEOF
86931
86932{ set +x
86933$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
86934at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
86935( $at_check_trace;  $PREPARSER ./calc input
86936) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86937at_status=$? at_failed=false
86938$at_check_filter
86939echo stderr:; tee stderr <"$at_stderr"
86940at_fn_diff_devnull "$at_stdout" || at_failed=:
86941at_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"
86947at_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>&-
86950at_status=$? at_failed=false
86951$at_check_filter
86952echo stderr:; tee stderr <"$at_stderr"
86953at_fn_diff_devnull "$at_stdout" || at_failed=:
86954at_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.
86963sed '/^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
86978mv at-stderr stderr
86979# 2. Create the reference error message.
86980cat >expout <<'_ATEOF'
869811.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
869821.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
869831.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
86984_ATEOF
86985
86986# 3. If locations are not used, remove them.
86987sed 's/^[-0-9.]*: //' expout >at-expout
86988mv at-expout expout
86989# 4. If error-verbose is not used, strip the`, unexpected....' part.
86990sed 's/syntax error, .*$/syntax error/' expout >at-expout
86991mv at-expout expout
86992# 5. Check
86993{ set +x
86994$as_echo "$at_srcdir/calc.at:642: cat stderr"
86995at_fn_check_prepare_trace "calc.at:642"
86996( $at_check_trace; cat stderr
86997) >>"$at_stdout" 2>>"$at_stderr" 5>&-
86998at_status=$? at_failed=false
86999$at_check_filter
87000at_fn_diff_devnull "$at_stderr" || at_failed=:
87001$at_diff expout "$at_stdout" || at_failed=:
87002at_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
87013read at_status <"$at_status_file"
87014#AT_STOP_221
87015#AT_START_222
87016at_fn_group_banner 222 'calc.at:643' \
87017  "Calculator %glr-parser %define api.prefix \"calc\"" "" 12
87018at_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
87032cat >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
87073FILE *input;
87074static int power (int base, int exponent);
87075
87076static void calcerror ( const char *msg);
87077int 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%%
87095input:
87096  line
87097| input line         {  }
87098;
87099
87100line:
87101  '\n'
87102| exp '\n'           { USE ($1); }
87103;
87104
87105exp:
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
87126static int
87127power (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.  */
87139static
87140void calcerror ( const char *msg)
87141{
87142  fprintf (stderr, "%s\n", msg);
87143}
87144#include <ctype.h>
87145
87146int calclex (void);
87147static int get_char (void);
87148static void unget_char ( int c);
87149
87150
87151static int
87152get_char (void)
87153{
87154  int res = getc (input);
87155  ;
87156
87157  return res;
87158}
87159
87160static void
87161unget_char ( int c)
87162{
87163  ;
87164
87165  ungetc (c, input);
87166}
87167
87168static int
87169read_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
87200int 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
87236semantic_value global_result = 0;
87237int global_count = 0;
87238
87239/* A C main function.  */
87240int
87241main (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
87280if 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"
87288at_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>&-
87292at_status=$? at_failed=false
87293$at_check_filter
87294echo stderr:; cat "$at_stderr"
87295echo stdout:; cat "$at_stdout"
87296at_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"
87302at_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>&-
87305at_status=$? at_failed=false
87306$at_check_filter
87307echo stderr:; cat "$at_stderr"
87308echo stdout:; cat "$at_stdout"
87309at_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"
87318at_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>&-
87323at_status=$? at_failed=false
87324$at_check_filter
87325at_fn_diff_devnull "$at_stderr" || at_failed=:
87326$at_diff expout "$at_stdout" || at_failed=:
87327at_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"
87336at_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>&-
87341at_status=$? at_failed=false
87342$at_check_filter
87343at_fn_diff_devnull "$at_stderr" || at_failed=:
87344$at_diff expout "$at_stdout" || at_failed=:
87345at_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
87351fi
87352{ set +x
87353$as_echo "$at_srcdir/calc.at:643: bison -o calc.c calc.y"
87354at_fn_check_prepare_trace "calc.at:643"
87355( $at_check_trace; bison -o calc.c calc.y
87356) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87357at_status=$? at_failed=false
87358$at_check_filter
87359at_fn_diff_devnull "$at_stderr" || at_failed=:
87360at_fn_diff_devnull "$at_stdout" || at_failed=:
87361at_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"
87368at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643"
87369( $at_check_trace; $BISON_C_WORKS
87370) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87371at_status=$? at_failed=false
87372$at_check_filter
87373echo stderr:; cat "$at_stderr"
87374echo stdout:; cat "$at_stdout"
87375at_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"
87381at_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>&-
87384at_status=$? at_failed=false
87385$at_check_filter
87386echo stderr:; cat "$at_stderr"
87387echo stdout:; cat "$at_stdout"
87388at_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"
87403at_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>&-
87414at_status=$? at_failed=false
87415$at_check_filter
87416at_fn_diff_devnull "$at_stderr" || at_failed=:
87417at_fn_diff_devnull "$at_stdout" || at_failed=:
87418at_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.
87425cat >input <<'_ATEOF'
874261 + 2 * 3 = 7
874271 + 2 * -3 = -5
87428
87429-1^2 = -1
87430(-1)^2 = 1
87431
87432---1 = -1
87433
874341 - 2 - 3 = -4
874351 - (2 - 3) = 2
87436
874372^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"
87443at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87444( $at_check_trace;  $PREPARSER ./calc input
87445) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87446at_status=$? at_failed=false
87447$at_check_filter
87448echo stderr:; tee stderr <"$at_stderr"
87449at_fn_diff_devnull "$at_stdout" || at_failed=:
87450at_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"
87456at_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>&-
87459at_status=$? at_failed=false
87460$at_check_filter
87461echo stderr:; tee stderr <"$at_stderr"
87462at_fn_diff_devnull "$at_stdout" || at_failed=:
87463at_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.
87471cat >input <<'_ATEOF'
874721 2
87473_ATEOF
87474
87475{ set +x
87476$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
87477at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87478( $at_check_trace;  $PREPARSER ./calc input
87479) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87480at_status=$? at_failed=false
87481$at_check_filter
87482echo stderr:; tee stderr <"$at_stderr"
87483at_fn_diff_devnull "$at_stdout" || at_failed=:
87484at_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"
87490at_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>&-
87493at_status=$? at_failed=false
87494$at_check_filter
87495echo stderr:; tee stderr <"$at_stderr"
87496at_fn_diff_devnull "$at_stdout" || at_failed=:
87497at_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.
87506sed '/^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
87521mv at-stderr stderr
87522# 2. Create the reference error message.
87523cat >expout <<'_ATEOF'
875241.3: syntax error, unexpected number
87525_ATEOF
87526
87527# 3. If locations are not used, remove them.
87528sed 's/^[-0-9.]*: //' expout >at-expout
87529mv at-expout expout
87530# 4. If error-verbose is not used, strip the`, unexpected....' part.
87531sed 's/syntax error, .*$/syntax error/' expout >at-expout
87532mv at-expout expout
87533# 5. Check
87534{ set +x
87535$as_echo "$at_srcdir/calc.at:643: cat stderr"
87536at_fn_check_prepare_trace "calc.at:643"
87537( $at_check_trace; cat stderr
87538) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87539at_status=$? at_failed=false
87540$at_check_filter
87541at_fn_diff_devnull "$at_stderr" || at_failed=:
87542$at_diff expout "$at_stdout" || at_failed=:
87543at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
87544$at_failed && at_fn_log_failure
87545$at_traceon; }
87546
87547
87548cat >input <<'_ATEOF'
875491//2
87550_ATEOF
87551
87552{ set +x
87553$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
87554at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87555( $at_check_trace;  $PREPARSER ./calc input
87556) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87557at_status=$? at_failed=false
87558$at_check_filter
87559echo stderr:; tee stderr <"$at_stderr"
87560at_fn_diff_devnull "$at_stdout" || at_failed=:
87561at_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"
87567at_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>&-
87570at_status=$? at_failed=false
87571$at_check_filter
87572echo stderr:; tee stderr <"$at_stderr"
87573at_fn_diff_devnull "$at_stdout" || at_failed=:
87574at_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.
87583sed '/^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
87598mv at-stderr stderr
87599# 2. Create the reference error message.
87600cat >expout <<'_ATEOF'
876011.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
87602_ATEOF
87603
87604# 3. If locations are not used, remove them.
87605sed 's/^[-0-9.]*: //' expout >at-expout
87606mv at-expout expout
87607# 4. If error-verbose is not used, strip the`, unexpected....' part.
87608sed 's/syntax error, .*$/syntax error/' expout >at-expout
87609mv at-expout expout
87610# 5. Check
87611{ set +x
87612$as_echo "$at_srcdir/calc.at:643: cat stderr"
87613at_fn_check_prepare_trace "calc.at:643"
87614( $at_check_trace; cat stderr
87615) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87616at_status=$? at_failed=false
87617$at_check_filter
87618at_fn_diff_devnull "$at_stderr" || at_failed=:
87619$at_diff expout "$at_stdout" || at_failed=:
87620at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
87621$at_failed && at_fn_log_failure
87622$at_traceon; }
87623
87624
87625cat >input <<'_ATEOF'
87626error
87627_ATEOF
87628
87629{ set +x
87630$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
87631at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87632( $at_check_trace;  $PREPARSER ./calc input
87633) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87634at_status=$? at_failed=false
87635$at_check_filter
87636echo stderr:; tee stderr <"$at_stderr"
87637at_fn_diff_devnull "$at_stdout" || at_failed=:
87638at_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"
87644at_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>&-
87647at_status=$? at_failed=false
87648$at_check_filter
87649echo stderr:; tee stderr <"$at_stderr"
87650at_fn_diff_devnull "$at_stdout" || at_failed=:
87651at_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.
87660sed '/^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
87675mv at-stderr stderr
87676# 2. Create the reference error message.
87677cat >expout <<'_ATEOF'
876781.1: syntax error, unexpected $undefined
87679_ATEOF
87680
87681# 3. If locations are not used, remove them.
87682sed 's/^[-0-9.]*: //' expout >at-expout
87683mv at-expout expout
87684# 4. If error-verbose is not used, strip the`, unexpected....' part.
87685sed 's/syntax error, .*$/syntax error/' expout >at-expout
87686mv at-expout expout
87687# 5. Check
87688{ set +x
87689$as_echo "$at_srcdir/calc.at:643: cat stderr"
87690at_fn_check_prepare_trace "calc.at:643"
87691( $at_check_trace; cat stderr
87692) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87693at_status=$? at_failed=false
87694$at_check_filter
87695at_fn_diff_devnull "$at_stderr" || at_failed=:
87696$at_diff expout "$at_stdout" || at_failed=:
87697at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
87698$at_failed && at_fn_log_failure
87699$at_traceon; }
87700
87701
87702cat >input <<'_ATEOF'
877031 = 2 = 3
87704_ATEOF
87705
87706{ set +x
87707$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
87708at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87709( $at_check_trace;  $PREPARSER ./calc input
87710) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87711at_status=$? at_failed=false
87712$at_check_filter
87713echo stderr:; tee stderr <"$at_stderr"
87714at_fn_diff_devnull "$at_stdout" || at_failed=:
87715at_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"
87721at_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>&-
87724at_status=$? at_failed=false
87725$at_check_filter
87726echo stderr:; tee stderr <"$at_stderr"
87727at_fn_diff_devnull "$at_stdout" || at_failed=:
87728at_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.
87737sed '/^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
87752mv at-stderr stderr
87753# 2. Create the reference error message.
87754cat >expout <<'_ATEOF'
877551.7: syntax error, unexpected '='
87756_ATEOF
87757
87758# 3. If locations are not used, remove them.
87759sed 's/^[-0-9.]*: //' expout >at-expout
87760mv at-expout expout
87761# 4. If error-verbose is not used, strip the`, unexpected....' part.
87762sed 's/syntax error, .*$/syntax error/' expout >at-expout
87763mv at-expout expout
87764# 5. Check
87765{ set +x
87766$as_echo "$at_srcdir/calc.at:643: cat stderr"
87767at_fn_check_prepare_trace "calc.at:643"
87768( $at_check_trace; cat stderr
87769) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87770at_status=$? at_failed=false
87771$at_check_filter
87772at_fn_diff_devnull "$at_stderr" || at_failed=:
87773$at_diff expout "$at_stdout" || at_failed=:
87774at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
87775$at_failed && at_fn_log_failure
87776$at_traceon; }
87777
87778
87779cat >input <<'_ATEOF'
87780
87781+1
87782_ATEOF
87783
87784{ set +x
87785$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
87786at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87787( $at_check_trace;  $PREPARSER ./calc input
87788) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87789at_status=$? at_failed=false
87790$at_check_filter
87791echo stderr:; tee stderr <"$at_stderr"
87792at_fn_diff_devnull "$at_stdout" || at_failed=:
87793at_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"
87799at_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>&-
87802at_status=$? at_failed=false
87803$at_check_filter
87804echo stderr:; tee stderr <"$at_stderr"
87805at_fn_diff_devnull "$at_stdout" || at_failed=:
87806at_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.
87815sed '/^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
87830mv at-stderr stderr
87831# 2. Create the reference error message.
87832cat >expout <<'_ATEOF'
878332.1: syntax error, unexpected '+'
87834_ATEOF
87835
87836# 3. If locations are not used, remove them.
87837sed 's/^[-0-9.]*: //' expout >at-expout
87838mv at-expout expout
87839# 4. If error-verbose is not used, strip the`, unexpected....' part.
87840sed 's/syntax error, .*$/syntax error/' expout >at-expout
87841mv at-expout expout
87842# 5. Check
87843{ set +x
87844$as_echo "$at_srcdir/calc.at:643: cat stderr"
87845at_fn_check_prepare_trace "calc.at:643"
87846( $at_check_trace; cat stderr
87847) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87848at_status=$? at_failed=false
87849$at_check_filter
87850at_fn_diff_devnull "$at_stderr" || at_failed=:
87851$at_diff expout "$at_stdout" || at_failed=:
87852at_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"
87860at_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>&-
87863at_status=$? at_failed=false
87864$at_check_filter
87865echo stderr:; tee stderr <"$at_stderr"
87866at_fn_diff_devnull "$at_stdout" || at_failed=:
87867at_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"
87873at_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>&-
87876at_status=$? at_failed=false
87877$at_check_filter
87878echo stderr:; tee stderr <"$at_stderr"
87879at_fn_diff_devnull "$at_stdout" || at_failed=:
87880at_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.
87889sed '/^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
87904mv at-stderr stderr
87905# 2. Create the reference error message.
87906cat >expout <<'_ATEOF'
879071.1: syntax error, unexpected end of input
87908_ATEOF
87909
87910# 3. If locations are not used, remove them.
87911sed 's/^[-0-9.]*: //' expout >at-expout
87912mv at-expout expout
87913# 4. If error-verbose is not used, strip the`, unexpected....' part.
87914sed 's/syntax error, .*$/syntax error/' expout >at-expout
87915mv at-expout expout
87916# 5. Check
87917{ set +x
87918$as_echo "$at_srcdir/calc.at:643: cat stderr"
87919at_fn_check_prepare_trace "calc.at:643"
87920( $at_check_trace; cat stderr
87921) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87922at_status=$? at_failed=false
87923$at_check_filter
87924at_fn_diff_devnull "$at_stderr" || at_failed=:
87925$at_diff expout "$at_stdout" || at_failed=:
87926at_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#
87948cat >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"
87954at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
87955( $at_check_trace;  $PREPARSER ./calc input
87956) >>"$at_stdout" 2>>"$at_stderr" 5>&-
87957at_status=$? at_failed=false
87958$at_check_filter
87959echo stderr:; tee stderr <"$at_stderr"
87960at_fn_diff_devnull "$at_stdout" || at_failed=:
87961at_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"
87967at_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>&-
87970at_status=$? at_failed=false
87971$at_check_filter
87972echo stderr:; tee stderr <"$at_stderr"
87973at_fn_diff_devnull "$at_stdout" || at_failed=:
87974at_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.
87983sed '/^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
87998mv at-stderr stderr
87999# 2. Create the reference error message.
88000cat >expout <<'_ATEOF'
880011.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
880021.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
880031.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
880041.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
88005calc: error: 4444 != 1
88006_ATEOF
88007
88008# 3. If locations are not used, remove them.
88009sed 's/^[-0-9.]*: //' expout >at-expout
88010mv at-expout expout
88011# 4. If error-verbose is not used, strip the`, unexpected....' part.
88012sed 's/syntax error, .*$/syntax error/' expout >at-expout
88013mv at-expout expout
88014# 5. Check
88015{ set +x
88016$as_echo "$at_srcdir/calc.at:643: cat stderr"
88017at_fn_check_prepare_trace "calc.at:643"
88018( $at_check_trace; cat stderr
88019) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88020at_status=$? at_failed=false
88021$at_check_filter
88022at_fn_diff_devnull "$at_stderr" || at_failed=:
88023$at_diff expout "$at_stdout" || at_failed=:
88024at_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.
88032cat >input <<'_ATEOF'
88033(!) + (1 2) = 1
88034_ATEOF
88035
88036{ set +x
88037$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
88038at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
88039( $at_check_trace;  $PREPARSER ./calc input
88040) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88041at_status=$? at_failed=false
88042$at_check_filter
88043echo stderr:; tee stderr <"$at_stderr"
88044at_fn_diff_devnull "$at_stdout" || at_failed=:
88045at_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"
88051at_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>&-
88054at_status=$? at_failed=false
88055$at_check_filter
88056echo stderr:; tee stderr <"$at_stderr"
88057at_fn_diff_devnull "$at_stdout" || at_failed=:
88058at_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.
88067sed '/^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
88082mv at-stderr stderr
88083# 2. Create the reference error message.
88084cat >expout <<'_ATEOF'
880851.10: syntax error, unexpected number
88086calc: error: 2222 != 1
88087_ATEOF
88088
88089# 3. If locations are not used, remove them.
88090sed 's/^[-0-9.]*: //' expout >at-expout
88091mv at-expout expout
88092# 4. If error-verbose is not used, strip the`, unexpected....' part.
88093sed 's/syntax error, .*$/syntax error/' expout >at-expout
88094mv at-expout expout
88095# 5. Check
88096{ set +x
88097$as_echo "$at_srcdir/calc.at:643: cat stderr"
88098at_fn_check_prepare_trace "calc.at:643"
88099( $at_check_trace; cat stderr
88100) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88101at_status=$? at_failed=false
88102$at_check_filter
88103at_fn_diff_devnull "$at_stderr" || at_failed=:
88104$at_diff expout "$at_stdout" || at_failed=:
88105at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
88106$at_failed && at_fn_log_failure
88107$at_traceon; }
88108
88109
88110cat >input <<'_ATEOF'
88111(- *) + (1 2) = 1
88112_ATEOF
88113
88114{ set +x
88115$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
88116at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
88117( $at_check_trace;  $PREPARSER ./calc input
88118) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88119at_status=$? at_failed=false
88120$at_check_filter
88121echo stderr:; tee stderr <"$at_stderr"
88122at_fn_diff_devnull "$at_stdout" || at_failed=:
88123at_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"
88129at_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>&-
88132at_status=$? at_failed=false
88133$at_check_filter
88134echo stderr:; tee stderr <"$at_stderr"
88135at_fn_diff_devnull "$at_stdout" || at_failed=:
88136at_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.
88145sed '/^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
88160mv at-stderr stderr
88161# 2. Create the reference error message.
88162cat >expout <<'_ATEOF'
881631.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
881641.12: syntax error, unexpected number
88165calc: error: 2222 != 1
88166_ATEOF
88167
88168# 3. If locations are not used, remove them.
88169sed 's/^[-0-9.]*: //' expout >at-expout
88170mv at-expout expout
88171# 4. If error-verbose is not used, strip the`, unexpected....' part.
88172sed 's/syntax error, .*$/syntax error/' expout >at-expout
88173mv at-expout expout
88174# 5. Check
88175{ set +x
88176$as_echo "$at_srcdir/calc.at:643: cat stderr"
88177at_fn_check_prepare_trace "calc.at:643"
88178( $at_check_trace; cat stderr
88179) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88180at_status=$? at_failed=false
88181$at_check_filter
88182at_fn_diff_devnull "$at_stderr" || at_failed=:
88183$at_diff expout "$at_stdout" || at_failed=:
88184at_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.
88192cat >input <<'_ATEOF'
88193(* *) + (*) + (*)
88194_ATEOF
88195
88196{ set +x
88197$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
88198at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
88199( $at_check_trace;  $PREPARSER ./calc input
88200) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88201at_status=$? at_failed=false
88202$at_check_filter
88203echo stderr:; tee stderr <"$at_stderr"
88204at_fn_diff_devnull "$at_stdout" || at_failed=:
88205at_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"
88211at_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>&-
88214at_status=$? at_failed=false
88215$at_check_filter
88216echo stderr:; tee stderr <"$at_stderr"
88217at_fn_diff_devnull "$at_stdout" || at_failed=:
88218at_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.
88227sed '/^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
88242mv at-stderr stderr
88243# 2. Create the reference error message.
88244cat >expout <<'_ATEOF'
882451.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
882461.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
882471.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
88248_ATEOF
88249
88250# 3. If locations are not used, remove them.
88251sed 's/^[-0-9.]*: //' expout >at-expout
88252mv at-expout expout
88253# 4. If error-verbose is not used, strip the`, unexpected....' part.
88254sed 's/syntax error, .*$/syntax error/' expout >at-expout
88255mv at-expout expout
88256# 5. Check
88257{ set +x
88258$as_echo "$at_srcdir/calc.at:643: cat stderr"
88259at_fn_check_prepare_trace "calc.at:643"
88260( $at_check_trace; cat stderr
88261) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88262at_status=$? at_failed=false
88263$at_check_filter
88264at_fn_diff_devnull "$at_stderr" || at_failed=:
88265$at_diff expout "$at_stdout" || at_failed=:
88266at_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
88277read at_status <"$at_status_file"
88278#AT_STOP_222
88279#AT_START_223
88280at_fn_group_banner 223 'calc.at:644' \
88281  "Calculator %glr-parser %verbose" "                " 12
88282at_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
88296cat >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
88337FILE *input;
88338static int power (int base, int exponent);
88339
88340static void yyerror ( const char *msg);
88341int 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%%
88359input:
88360  line
88361| input line         {  }
88362;
88363
88364line:
88365  '\n'
88366| exp '\n'           { USE ($1); }
88367;
88368
88369exp:
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
88390static int
88391power (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.  */
88403static
88404void yyerror ( const char *msg)
88405{
88406  fprintf (stderr, "%s\n", msg);
88407}
88408#include <ctype.h>
88409
88410int yylex (void);
88411static int get_char (void);
88412static void unget_char ( int c);
88413
88414
88415static int
88416get_char (void)
88417{
88418  int res = getc (input);
88419  ;
88420
88421  return res;
88422}
88423
88424static void
88425unget_char ( int c)
88426{
88427  ;
88428
88429  ungetc (c, input);
88430}
88431
88432static int
88433read_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
88464int 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
88500semantic_value global_result = 0;
88501int global_count = 0;
88502
88503/* A C main function.  */
88504int
88505main (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
88544if 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"
88552at_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>&-
88556at_status=$? at_failed=false
88557$at_check_filter
88558echo stderr:; cat "$at_stderr"
88559echo stdout:; cat "$at_stdout"
88560at_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"
88566at_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>&-
88569at_status=$? at_failed=false
88570$at_check_filter
88571echo stderr:; cat "$at_stderr"
88572echo stdout:; cat "$at_stdout"
88573at_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"
88582at_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>&-
88587at_status=$? at_failed=false
88588$at_check_filter
88589at_fn_diff_devnull "$at_stderr" || at_failed=:
88590$at_diff expout "$at_stdout" || at_failed=:
88591at_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"
88600at_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>&-
88605at_status=$? at_failed=false
88606$at_check_filter
88607at_fn_diff_devnull "$at_stderr" || at_failed=:
88608$at_diff expout "$at_stdout" || at_failed=:
88609at_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
88615fi
88616{ set +x
88617$as_echo "$at_srcdir/calc.at:644: bison -o calc.c calc.y"
88618at_fn_check_prepare_trace "calc.at:644"
88619( $at_check_trace; bison -o calc.c calc.y
88620) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88621at_status=$? at_failed=false
88622$at_check_filter
88623at_fn_diff_devnull "$at_stderr" || at_failed=:
88624at_fn_diff_devnull "$at_stdout" || at_failed=:
88625at_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"
88632at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644"
88633( $at_check_trace; $BISON_C_WORKS
88634) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88635at_status=$? at_failed=false
88636$at_check_filter
88637echo stderr:; cat "$at_stderr"
88638echo stdout:; cat "$at_stdout"
88639at_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"
88645at_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>&-
88648at_status=$? at_failed=false
88649$at_check_filter
88650echo stderr:; cat "$at_stderr"
88651echo stdout:; cat "$at_stdout"
88652at_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"
88667at_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>&-
88678at_status=$? at_failed=false
88679$at_check_filter
88680at_fn_diff_devnull "$at_stderr" || at_failed=:
88681at_fn_diff_devnull "$at_stdout" || at_failed=:
88682at_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.
88689cat >input <<'_ATEOF'
886901 + 2 * 3 = 7
886911 + 2 * -3 = -5
88692
88693-1^2 = -1
88694(-1)^2 = 1
88695
88696---1 = -1
88697
886981 - 2 - 3 = -4
886991 - (2 - 3) = 2
88700
887012^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"
88707at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
88708( $at_check_trace;  $PREPARSER ./calc input
88709) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88710at_status=$? at_failed=false
88711$at_check_filter
88712echo stderr:; tee stderr <"$at_stderr"
88713at_fn_diff_devnull "$at_stdout" || at_failed=:
88714at_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"
88720at_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>&-
88723at_status=$? at_failed=false
88724$at_check_filter
88725echo stderr:; tee stderr <"$at_stderr"
88726at_fn_diff_devnull "$at_stdout" || at_failed=:
88727at_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.
88735cat >input <<'_ATEOF'
887361 2
88737_ATEOF
88738
88739{ set +x
88740$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
88741at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
88742( $at_check_trace;  $PREPARSER ./calc input
88743) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88744at_status=$? at_failed=false
88745$at_check_filter
88746echo stderr:; tee stderr <"$at_stderr"
88747at_fn_diff_devnull "$at_stdout" || at_failed=:
88748at_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"
88754at_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>&-
88757at_status=$? at_failed=false
88758$at_check_filter
88759echo stderr:; tee stderr <"$at_stderr"
88760at_fn_diff_devnull "$at_stdout" || at_failed=:
88761at_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.
88770sed '/^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
88785mv at-stderr stderr
88786# 2. Create the reference error message.
88787cat >expout <<'_ATEOF'
887881.3: syntax error, unexpected number
88789_ATEOF
88790
88791# 3. If locations are not used, remove them.
88792sed 's/^[-0-9.]*: //' expout >at-expout
88793mv at-expout expout
88794# 4. If error-verbose is not used, strip the`, unexpected....' part.
88795sed 's/syntax error, .*$/syntax error/' expout >at-expout
88796mv at-expout expout
88797# 5. Check
88798{ set +x
88799$as_echo "$at_srcdir/calc.at:644: cat stderr"
88800at_fn_check_prepare_trace "calc.at:644"
88801( $at_check_trace; cat stderr
88802) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88803at_status=$? at_failed=false
88804$at_check_filter
88805at_fn_diff_devnull "$at_stderr" || at_failed=:
88806$at_diff expout "$at_stdout" || at_failed=:
88807at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
88808$at_failed && at_fn_log_failure
88809$at_traceon; }
88810
88811
88812cat >input <<'_ATEOF'
888131//2
88814_ATEOF
88815
88816{ set +x
88817$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
88818at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
88819( $at_check_trace;  $PREPARSER ./calc input
88820) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88821at_status=$? at_failed=false
88822$at_check_filter
88823echo stderr:; tee stderr <"$at_stderr"
88824at_fn_diff_devnull "$at_stdout" || at_failed=:
88825at_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"
88831at_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>&-
88834at_status=$? at_failed=false
88835$at_check_filter
88836echo stderr:; tee stderr <"$at_stderr"
88837at_fn_diff_devnull "$at_stdout" || at_failed=:
88838at_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.
88847sed '/^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
88862mv at-stderr stderr
88863# 2. Create the reference error message.
88864cat >expout <<'_ATEOF'
888651.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
88866_ATEOF
88867
88868# 3. If locations are not used, remove them.
88869sed 's/^[-0-9.]*: //' expout >at-expout
88870mv at-expout expout
88871# 4. If error-verbose is not used, strip the`, unexpected....' part.
88872sed 's/syntax error, .*$/syntax error/' expout >at-expout
88873mv at-expout expout
88874# 5. Check
88875{ set +x
88876$as_echo "$at_srcdir/calc.at:644: cat stderr"
88877at_fn_check_prepare_trace "calc.at:644"
88878( $at_check_trace; cat stderr
88879) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88880at_status=$? at_failed=false
88881$at_check_filter
88882at_fn_diff_devnull "$at_stderr" || at_failed=:
88883$at_diff expout "$at_stdout" || at_failed=:
88884at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
88885$at_failed && at_fn_log_failure
88886$at_traceon; }
88887
88888
88889cat >input <<'_ATEOF'
88890error
88891_ATEOF
88892
88893{ set +x
88894$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
88895at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
88896( $at_check_trace;  $PREPARSER ./calc input
88897) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88898at_status=$? at_failed=false
88899$at_check_filter
88900echo stderr:; tee stderr <"$at_stderr"
88901at_fn_diff_devnull "$at_stdout" || at_failed=:
88902at_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"
88908at_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>&-
88911at_status=$? at_failed=false
88912$at_check_filter
88913echo stderr:; tee stderr <"$at_stderr"
88914at_fn_diff_devnull "$at_stdout" || at_failed=:
88915at_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.
88924sed '/^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
88939mv at-stderr stderr
88940# 2. Create the reference error message.
88941cat >expout <<'_ATEOF'
889421.1: syntax error, unexpected $undefined
88943_ATEOF
88944
88945# 3. If locations are not used, remove them.
88946sed 's/^[-0-9.]*: //' expout >at-expout
88947mv at-expout expout
88948# 4. If error-verbose is not used, strip the`, unexpected....' part.
88949sed 's/syntax error, .*$/syntax error/' expout >at-expout
88950mv at-expout expout
88951# 5. Check
88952{ set +x
88953$as_echo "$at_srcdir/calc.at:644: cat stderr"
88954at_fn_check_prepare_trace "calc.at:644"
88955( $at_check_trace; cat stderr
88956) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88957at_status=$? at_failed=false
88958$at_check_filter
88959at_fn_diff_devnull "$at_stderr" || at_failed=:
88960$at_diff expout "$at_stdout" || at_failed=:
88961at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
88962$at_failed && at_fn_log_failure
88963$at_traceon; }
88964
88965
88966cat >input <<'_ATEOF'
889671 = 2 = 3
88968_ATEOF
88969
88970{ set +x
88971$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
88972at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
88973( $at_check_trace;  $PREPARSER ./calc input
88974) >>"$at_stdout" 2>>"$at_stderr" 5>&-
88975at_status=$? at_failed=false
88976$at_check_filter
88977echo stderr:; tee stderr <"$at_stderr"
88978at_fn_diff_devnull "$at_stdout" || at_failed=:
88979at_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"
88985at_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>&-
88988at_status=$? at_failed=false
88989$at_check_filter
88990echo stderr:; tee stderr <"$at_stderr"
88991at_fn_diff_devnull "$at_stdout" || at_failed=:
88992at_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.
89001sed '/^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
89016mv at-stderr stderr
89017# 2. Create the reference error message.
89018cat >expout <<'_ATEOF'
890191.7: syntax error, unexpected '='
89020_ATEOF
89021
89022# 3. If locations are not used, remove them.
89023sed 's/^[-0-9.]*: //' expout >at-expout
89024mv at-expout expout
89025# 4. If error-verbose is not used, strip the`, unexpected....' part.
89026sed 's/syntax error, .*$/syntax error/' expout >at-expout
89027mv at-expout expout
89028# 5. Check
89029{ set +x
89030$as_echo "$at_srcdir/calc.at:644: cat stderr"
89031at_fn_check_prepare_trace "calc.at:644"
89032( $at_check_trace; cat stderr
89033) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89034at_status=$? at_failed=false
89035$at_check_filter
89036at_fn_diff_devnull "$at_stderr" || at_failed=:
89037$at_diff expout "$at_stdout" || at_failed=:
89038at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
89039$at_failed && at_fn_log_failure
89040$at_traceon; }
89041
89042
89043cat >input <<'_ATEOF'
89044
89045+1
89046_ATEOF
89047
89048{ set +x
89049$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
89050at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
89051( $at_check_trace;  $PREPARSER ./calc input
89052) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89053at_status=$? at_failed=false
89054$at_check_filter
89055echo stderr:; tee stderr <"$at_stderr"
89056at_fn_diff_devnull "$at_stdout" || at_failed=:
89057at_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"
89063at_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>&-
89066at_status=$? at_failed=false
89067$at_check_filter
89068echo stderr:; tee stderr <"$at_stderr"
89069at_fn_diff_devnull "$at_stdout" || at_failed=:
89070at_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.
89079sed '/^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
89094mv at-stderr stderr
89095# 2. Create the reference error message.
89096cat >expout <<'_ATEOF'
890972.1: syntax error, unexpected '+'
89098_ATEOF
89099
89100# 3. If locations are not used, remove them.
89101sed 's/^[-0-9.]*: //' expout >at-expout
89102mv at-expout expout
89103# 4. If error-verbose is not used, strip the`, unexpected....' part.
89104sed 's/syntax error, .*$/syntax error/' expout >at-expout
89105mv at-expout expout
89106# 5. Check
89107{ set +x
89108$as_echo "$at_srcdir/calc.at:644: cat stderr"
89109at_fn_check_prepare_trace "calc.at:644"
89110( $at_check_trace; cat stderr
89111) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89112at_status=$? at_failed=false
89113$at_check_filter
89114at_fn_diff_devnull "$at_stderr" || at_failed=:
89115$at_diff expout "$at_stdout" || at_failed=:
89116at_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"
89124at_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>&-
89127at_status=$? at_failed=false
89128$at_check_filter
89129echo stderr:; tee stderr <"$at_stderr"
89130at_fn_diff_devnull "$at_stdout" || at_failed=:
89131at_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"
89137at_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>&-
89140at_status=$? at_failed=false
89141$at_check_filter
89142echo stderr:; tee stderr <"$at_stderr"
89143at_fn_diff_devnull "$at_stdout" || at_failed=:
89144at_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.
89153sed '/^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
89168mv at-stderr stderr
89169# 2. Create the reference error message.
89170cat >expout <<'_ATEOF'
891711.1: syntax error, unexpected end of input
89172_ATEOF
89173
89174# 3. If locations are not used, remove them.
89175sed 's/^[-0-9.]*: //' expout >at-expout
89176mv at-expout expout
89177# 4. If error-verbose is not used, strip the`, unexpected....' part.
89178sed 's/syntax error, .*$/syntax error/' expout >at-expout
89179mv at-expout expout
89180# 5. Check
89181{ set +x
89182$as_echo "$at_srcdir/calc.at:644: cat stderr"
89183at_fn_check_prepare_trace "calc.at:644"
89184( $at_check_trace; cat stderr
89185) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89186at_status=$? at_failed=false
89187$at_check_filter
89188at_fn_diff_devnull "$at_stderr" || at_failed=:
89189$at_diff expout "$at_stdout" || at_failed=:
89190at_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#
89212cat >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"
89218at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
89219( $at_check_trace;  $PREPARSER ./calc input
89220) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89221at_status=$? at_failed=false
89222$at_check_filter
89223echo stderr:; tee stderr <"$at_stderr"
89224at_fn_diff_devnull "$at_stdout" || at_failed=:
89225at_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"
89231at_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>&-
89234at_status=$? at_failed=false
89235$at_check_filter
89236echo stderr:; tee stderr <"$at_stderr"
89237at_fn_diff_devnull "$at_stdout" || at_failed=:
89238at_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.
89247sed '/^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
89262mv at-stderr stderr
89263# 2. Create the reference error message.
89264cat >expout <<'_ATEOF'
892651.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
892661.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
892671.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
892681.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
89269calc: error: 4444 != 1
89270_ATEOF
89271
89272# 3. If locations are not used, remove them.
89273sed 's/^[-0-9.]*: //' expout >at-expout
89274mv at-expout expout
89275# 4. If error-verbose is not used, strip the`, unexpected....' part.
89276sed 's/syntax error, .*$/syntax error/' expout >at-expout
89277mv at-expout expout
89278# 5. Check
89279{ set +x
89280$as_echo "$at_srcdir/calc.at:644: cat stderr"
89281at_fn_check_prepare_trace "calc.at:644"
89282( $at_check_trace; cat stderr
89283) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89284at_status=$? at_failed=false
89285$at_check_filter
89286at_fn_diff_devnull "$at_stderr" || at_failed=:
89287$at_diff expout "$at_stdout" || at_failed=:
89288at_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.
89296cat >input <<'_ATEOF'
89297(!) + (1 2) = 1
89298_ATEOF
89299
89300{ set +x
89301$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
89302at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
89303( $at_check_trace;  $PREPARSER ./calc input
89304) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89305at_status=$? at_failed=false
89306$at_check_filter
89307echo stderr:; tee stderr <"$at_stderr"
89308at_fn_diff_devnull "$at_stdout" || at_failed=:
89309at_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"
89315at_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>&-
89318at_status=$? at_failed=false
89319$at_check_filter
89320echo stderr:; tee stderr <"$at_stderr"
89321at_fn_diff_devnull "$at_stdout" || at_failed=:
89322at_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.
89331sed '/^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
89346mv at-stderr stderr
89347# 2. Create the reference error message.
89348cat >expout <<'_ATEOF'
893491.10: syntax error, unexpected number
89350calc: error: 2222 != 1
89351_ATEOF
89352
89353# 3. If locations are not used, remove them.
89354sed 's/^[-0-9.]*: //' expout >at-expout
89355mv at-expout expout
89356# 4. If error-verbose is not used, strip the`, unexpected....' part.
89357sed 's/syntax error, .*$/syntax error/' expout >at-expout
89358mv at-expout expout
89359# 5. Check
89360{ set +x
89361$as_echo "$at_srcdir/calc.at:644: cat stderr"
89362at_fn_check_prepare_trace "calc.at:644"
89363( $at_check_trace; cat stderr
89364) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89365at_status=$? at_failed=false
89366$at_check_filter
89367at_fn_diff_devnull "$at_stderr" || at_failed=:
89368$at_diff expout "$at_stdout" || at_failed=:
89369at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
89370$at_failed && at_fn_log_failure
89371$at_traceon; }
89372
89373
89374cat >input <<'_ATEOF'
89375(- *) + (1 2) = 1
89376_ATEOF
89377
89378{ set +x
89379$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
89380at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
89381( $at_check_trace;  $PREPARSER ./calc input
89382) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89383at_status=$? at_failed=false
89384$at_check_filter
89385echo stderr:; tee stderr <"$at_stderr"
89386at_fn_diff_devnull "$at_stdout" || at_failed=:
89387at_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"
89393at_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>&-
89396at_status=$? at_failed=false
89397$at_check_filter
89398echo stderr:; tee stderr <"$at_stderr"
89399at_fn_diff_devnull "$at_stdout" || at_failed=:
89400at_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.
89409sed '/^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
89424mv at-stderr stderr
89425# 2. Create the reference error message.
89426cat >expout <<'_ATEOF'
894271.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
894281.12: syntax error, unexpected number
89429calc: error: 2222 != 1
89430_ATEOF
89431
89432# 3. If locations are not used, remove them.
89433sed 's/^[-0-9.]*: //' expout >at-expout
89434mv at-expout expout
89435# 4. If error-verbose is not used, strip the`, unexpected....' part.
89436sed 's/syntax error, .*$/syntax error/' expout >at-expout
89437mv at-expout expout
89438# 5. Check
89439{ set +x
89440$as_echo "$at_srcdir/calc.at:644: cat stderr"
89441at_fn_check_prepare_trace "calc.at:644"
89442( $at_check_trace; cat stderr
89443) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89444at_status=$? at_failed=false
89445$at_check_filter
89446at_fn_diff_devnull "$at_stderr" || at_failed=:
89447$at_diff expout "$at_stdout" || at_failed=:
89448at_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.
89456cat >input <<'_ATEOF'
89457(* *) + (*) + (*)
89458_ATEOF
89459
89460{ set +x
89461$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
89462at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
89463( $at_check_trace;  $PREPARSER ./calc input
89464) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89465at_status=$? at_failed=false
89466$at_check_filter
89467echo stderr:; tee stderr <"$at_stderr"
89468at_fn_diff_devnull "$at_stdout" || at_failed=:
89469at_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"
89475at_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>&-
89478at_status=$? at_failed=false
89479$at_check_filter
89480echo stderr:; tee stderr <"$at_stderr"
89481at_fn_diff_devnull "$at_stdout" || at_failed=:
89482at_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.
89491sed '/^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
89506mv at-stderr stderr
89507# 2. Create the reference error message.
89508cat >expout <<'_ATEOF'
895091.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
895101.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
895111.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
89512_ATEOF
89513
89514# 3. If locations are not used, remove them.
89515sed 's/^[-0-9.]*: //' expout >at-expout
89516mv at-expout expout
89517# 4. If error-verbose is not used, strip the`, unexpected....' part.
89518sed 's/syntax error, .*$/syntax error/' expout >at-expout
89519mv at-expout expout
89520# 5. Check
89521{ set +x
89522$as_echo "$at_srcdir/calc.at:644: cat stderr"
89523at_fn_check_prepare_trace "calc.at:644"
89524( $at_check_trace; cat stderr
89525) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89526at_status=$? at_failed=false
89527$at_check_filter
89528at_fn_diff_devnull "$at_stderr" || at_failed=:
89529$at_diff expout "$at_stdout" || at_failed=:
89530at_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
89541read at_status <"$at_status_file"
89542#AT_STOP_223
89543#AT_START_224
89544at_fn_group_banner 224 'calc.at:645' \
89545  "Calculator %glr-parser %yacc" "                   " 12
89546at_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
89560cat >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
89601FILE *input;
89602static int power (int base, int exponent);
89603
89604static void yyerror ( const char *msg);
89605int 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%%
89623input:
89624  line
89625| input line         {  }
89626;
89627
89628line:
89629  '\n'
89630| exp '\n'           { USE ($1); }
89631;
89632
89633exp:
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
89654static int
89655power (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.  */
89667static
89668void yyerror ( const char *msg)
89669{
89670  fprintf (stderr, "%s\n", msg);
89671}
89672#include <ctype.h>
89673
89674int yylex (void);
89675static int get_char (void);
89676static void unget_char ( int c);
89677
89678
89679static int
89680get_char (void)
89681{
89682  int res = getc (input);
89683  ;
89684
89685  return res;
89686}
89687
89688static void
89689unget_char ( int c)
89690{
89691  ;
89692
89693  ungetc (c, input);
89694}
89695
89696static int
89697read_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
89728int 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
89764semantic_value global_result = 0;
89765int global_count = 0;
89766
89767/* A C main function.  */
89768int
89769main (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
89808if 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"
89816at_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>&-
89820at_status=$? at_failed=false
89821$at_check_filter
89822echo stderr:; cat "$at_stderr"
89823echo stdout:; cat "$at_stdout"
89824at_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"
89830at_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>&-
89833at_status=$? at_failed=false
89834$at_check_filter
89835echo stderr:; cat "$at_stderr"
89836echo stdout:; cat "$at_stdout"
89837at_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"
89846at_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>&-
89851at_status=$? at_failed=false
89852$at_check_filter
89853at_fn_diff_devnull "$at_stderr" || at_failed=:
89854$at_diff expout "$at_stdout" || at_failed=:
89855at_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"
89864at_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>&-
89869at_status=$? at_failed=false
89870$at_check_filter
89871at_fn_diff_devnull "$at_stderr" || at_failed=:
89872$at_diff expout "$at_stdout" || at_failed=:
89873at_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
89879fi
89880{ set +x
89881$as_echo "$at_srcdir/calc.at:645: bison -o calc.c calc.y"
89882at_fn_check_prepare_trace "calc.at:645"
89883( $at_check_trace; bison -o calc.c calc.y
89884) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89885at_status=$? at_failed=false
89886$at_check_filter
89887at_fn_diff_devnull "$at_stderr" || at_failed=:
89888at_fn_diff_devnull "$at_stdout" || at_failed=:
89889at_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"
89896at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645"
89897( $at_check_trace; $BISON_C_WORKS
89898) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89899at_status=$? at_failed=false
89900$at_check_filter
89901echo stderr:; cat "$at_stderr"
89902echo stdout:; cat "$at_stdout"
89903at_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"
89909at_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>&-
89912at_status=$? at_failed=false
89913$at_check_filter
89914echo stderr:; cat "$at_stderr"
89915echo stdout:; cat "$at_stdout"
89916at_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"
89931at_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>&-
89942at_status=$? at_failed=false
89943$at_check_filter
89944at_fn_diff_devnull "$at_stderr" || at_failed=:
89945at_fn_diff_devnull "$at_stdout" || at_failed=:
89946at_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.
89953cat >input <<'_ATEOF'
899541 + 2 * 3 = 7
899551 + 2 * -3 = -5
89956
89957-1^2 = -1
89958(-1)^2 = 1
89959
89960---1 = -1
89961
899621 - 2 - 3 = -4
899631 - (2 - 3) = 2
89964
899652^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"
89971at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
89972( $at_check_trace;  $PREPARSER ./calc input
89973) >>"$at_stdout" 2>>"$at_stderr" 5>&-
89974at_status=$? at_failed=false
89975$at_check_filter
89976echo stderr:; tee stderr <"$at_stderr"
89977at_fn_diff_devnull "$at_stdout" || at_failed=:
89978at_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"
89984at_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>&-
89987at_status=$? at_failed=false
89988$at_check_filter
89989echo stderr:; tee stderr <"$at_stderr"
89990at_fn_diff_devnull "$at_stdout" || at_failed=:
89991at_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.
89999cat >input <<'_ATEOF'
900001 2
90001_ATEOF
90002
90003{ set +x
90004$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90005at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90006( $at_check_trace;  $PREPARSER ./calc input
90007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90008at_status=$? at_failed=false
90009$at_check_filter
90010echo stderr:; tee stderr <"$at_stderr"
90011at_fn_diff_devnull "$at_stdout" || at_failed=:
90012at_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"
90018at_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>&-
90021at_status=$? at_failed=false
90022$at_check_filter
90023echo stderr:; tee stderr <"$at_stderr"
90024at_fn_diff_devnull "$at_stdout" || at_failed=:
90025at_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.
90034sed '/^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
90049mv at-stderr stderr
90050# 2. Create the reference error message.
90051cat >expout <<'_ATEOF'
900521.3: syntax error, unexpected number
90053_ATEOF
90054
90055# 3. If locations are not used, remove them.
90056sed 's/^[-0-9.]*: //' expout >at-expout
90057mv at-expout expout
90058# 4. If error-verbose is not used, strip the`, unexpected....' part.
90059sed 's/syntax error, .*$/syntax error/' expout >at-expout
90060mv at-expout expout
90061# 5. Check
90062{ set +x
90063$as_echo "$at_srcdir/calc.at:645: cat stderr"
90064at_fn_check_prepare_trace "calc.at:645"
90065( $at_check_trace; cat stderr
90066) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90067at_status=$? at_failed=false
90068$at_check_filter
90069at_fn_diff_devnull "$at_stderr" || at_failed=:
90070$at_diff expout "$at_stdout" || at_failed=:
90071at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
90072$at_failed && at_fn_log_failure
90073$at_traceon; }
90074
90075
90076cat >input <<'_ATEOF'
900771//2
90078_ATEOF
90079
90080{ set +x
90081$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90082at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90083( $at_check_trace;  $PREPARSER ./calc input
90084) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90085at_status=$? at_failed=false
90086$at_check_filter
90087echo stderr:; tee stderr <"$at_stderr"
90088at_fn_diff_devnull "$at_stdout" || at_failed=:
90089at_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"
90095at_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>&-
90098at_status=$? at_failed=false
90099$at_check_filter
90100echo stderr:; tee stderr <"$at_stderr"
90101at_fn_diff_devnull "$at_stdout" || at_failed=:
90102at_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.
90111sed '/^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
90126mv at-stderr stderr
90127# 2. Create the reference error message.
90128cat >expout <<'_ATEOF'
901291.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
90130_ATEOF
90131
90132# 3. If locations are not used, remove them.
90133sed 's/^[-0-9.]*: //' expout >at-expout
90134mv at-expout expout
90135# 4. If error-verbose is not used, strip the`, unexpected....' part.
90136sed 's/syntax error, .*$/syntax error/' expout >at-expout
90137mv at-expout expout
90138# 5. Check
90139{ set +x
90140$as_echo "$at_srcdir/calc.at:645: cat stderr"
90141at_fn_check_prepare_trace "calc.at:645"
90142( $at_check_trace; cat stderr
90143) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90144at_status=$? at_failed=false
90145$at_check_filter
90146at_fn_diff_devnull "$at_stderr" || at_failed=:
90147$at_diff expout "$at_stdout" || at_failed=:
90148at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
90149$at_failed && at_fn_log_failure
90150$at_traceon; }
90151
90152
90153cat >input <<'_ATEOF'
90154error
90155_ATEOF
90156
90157{ set +x
90158$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90159at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90160( $at_check_trace;  $PREPARSER ./calc input
90161) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90162at_status=$? at_failed=false
90163$at_check_filter
90164echo stderr:; tee stderr <"$at_stderr"
90165at_fn_diff_devnull "$at_stdout" || at_failed=:
90166at_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"
90172at_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>&-
90175at_status=$? at_failed=false
90176$at_check_filter
90177echo stderr:; tee stderr <"$at_stderr"
90178at_fn_diff_devnull "$at_stdout" || at_failed=:
90179at_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.
90188sed '/^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
90203mv at-stderr stderr
90204# 2. Create the reference error message.
90205cat >expout <<'_ATEOF'
902061.1: syntax error, unexpected $undefined
90207_ATEOF
90208
90209# 3. If locations are not used, remove them.
90210sed 's/^[-0-9.]*: //' expout >at-expout
90211mv at-expout expout
90212# 4. If error-verbose is not used, strip the`, unexpected....' part.
90213sed 's/syntax error, .*$/syntax error/' expout >at-expout
90214mv at-expout expout
90215# 5. Check
90216{ set +x
90217$as_echo "$at_srcdir/calc.at:645: cat stderr"
90218at_fn_check_prepare_trace "calc.at:645"
90219( $at_check_trace; cat stderr
90220) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90221at_status=$? at_failed=false
90222$at_check_filter
90223at_fn_diff_devnull "$at_stderr" || at_failed=:
90224$at_diff expout "$at_stdout" || at_failed=:
90225at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
90226$at_failed && at_fn_log_failure
90227$at_traceon; }
90228
90229
90230cat >input <<'_ATEOF'
902311 = 2 = 3
90232_ATEOF
90233
90234{ set +x
90235$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90236at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90237( $at_check_trace;  $PREPARSER ./calc input
90238) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90239at_status=$? at_failed=false
90240$at_check_filter
90241echo stderr:; tee stderr <"$at_stderr"
90242at_fn_diff_devnull "$at_stdout" || at_failed=:
90243at_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"
90249at_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>&-
90252at_status=$? at_failed=false
90253$at_check_filter
90254echo stderr:; tee stderr <"$at_stderr"
90255at_fn_diff_devnull "$at_stdout" || at_failed=:
90256at_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.
90265sed '/^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
90280mv at-stderr stderr
90281# 2. Create the reference error message.
90282cat >expout <<'_ATEOF'
902831.7: syntax error, unexpected '='
90284_ATEOF
90285
90286# 3. If locations are not used, remove them.
90287sed 's/^[-0-9.]*: //' expout >at-expout
90288mv at-expout expout
90289# 4. If error-verbose is not used, strip the`, unexpected....' part.
90290sed 's/syntax error, .*$/syntax error/' expout >at-expout
90291mv at-expout expout
90292# 5. Check
90293{ set +x
90294$as_echo "$at_srcdir/calc.at:645: cat stderr"
90295at_fn_check_prepare_trace "calc.at:645"
90296( $at_check_trace; cat stderr
90297) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90298at_status=$? at_failed=false
90299$at_check_filter
90300at_fn_diff_devnull "$at_stderr" || at_failed=:
90301$at_diff expout "$at_stdout" || at_failed=:
90302at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
90303$at_failed && at_fn_log_failure
90304$at_traceon; }
90305
90306
90307cat >input <<'_ATEOF'
90308
90309+1
90310_ATEOF
90311
90312{ set +x
90313$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90314at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90315( $at_check_trace;  $PREPARSER ./calc input
90316) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90317at_status=$? at_failed=false
90318$at_check_filter
90319echo stderr:; tee stderr <"$at_stderr"
90320at_fn_diff_devnull "$at_stdout" || at_failed=:
90321at_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"
90327at_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>&-
90330at_status=$? at_failed=false
90331$at_check_filter
90332echo stderr:; tee stderr <"$at_stderr"
90333at_fn_diff_devnull "$at_stdout" || at_failed=:
90334at_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.
90343sed '/^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
90358mv at-stderr stderr
90359# 2. Create the reference error message.
90360cat >expout <<'_ATEOF'
903612.1: syntax error, unexpected '+'
90362_ATEOF
90363
90364# 3. If locations are not used, remove them.
90365sed 's/^[-0-9.]*: //' expout >at-expout
90366mv at-expout expout
90367# 4. If error-verbose is not used, strip the`, unexpected....' part.
90368sed 's/syntax error, .*$/syntax error/' expout >at-expout
90369mv at-expout expout
90370# 5. Check
90371{ set +x
90372$as_echo "$at_srcdir/calc.at:645: cat stderr"
90373at_fn_check_prepare_trace "calc.at:645"
90374( $at_check_trace; cat stderr
90375) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90376at_status=$? at_failed=false
90377$at_check_filter
90378at_fn_diff_devnull "$at_stderr" || at_failed=:
90379$at_diff expout "$at_stdout" || at_failed=:
90380at_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"
90388at_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>&-
90391at_status=$? at_failed=false
90392$at_check_filter
90393echo stderr:; tee stderr <"$at_stderr"
90394at_fn_diff_devnull "$at_stdout" || at_failed=:
90395at_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"
90401at_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>&-
90404at_status=$? at_failed=false
90405$at_check_filter
90406echo stderr:; tee stderr <"$at_stderr"
90407at_fn_diff_devnull "$at_stdout" || at_failed=:
90408at_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.
90417sed '/^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
90432mv at-stderr stderr
90433# 2. Create the reference error message.
90434cat >expout <<'_ATEOF'
904351.1: syntax error, unexpected end of input
90436_ATEOF
90437
90438# 3. If locations are not used, remove them.
90439sed 's/^[-0-9.]*: //' expout >at-expout
90440mv at-expout expout
90441# 4. If error-verbose is not used, strip the`, unexpected....' part.
90442sed 's/syntax error, .*$/syntax error/' expout >at-expout
90443mv at-expout expout
90444# 5. Check
90445{ set +x
90446$as_echo "$at_srcdir/calc.at:645: cat stderr"
90447at_fn_check_prepare_trace "calc.at:645"
90448( $at_check_trace; cat stderr
90449) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90450at_status=$? at_failed=false
90451$at_check_filter
90452at_fn_diff_devnull "$at_stderr" || at_failed=:
90453$at_diff expout "$at_stdout" || at_failed=:
90454at_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#
90476cat >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"
90482at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90483( $at_check_trace;  $PREPARSER ./calc input
90484) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90485at_status=$? at_failed=false
90486$at_check_filter
90487echo stderr:; tee stderr <"$at_stderr"
90488at_fn_diff_devnull "$at_stdout" || at_failed=:
90489at_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"
90495at_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>&-
90498at_status=$? at_failed=false
90499$at_check_filter
90500echo stderr:; tee stderr <"$at_stderr"
90501at_fn_diff_devnull "$at_stdout" || at_failed=:
90502at_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.
90511sed '/^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
90526mv at-stderr stderr
90527# 2. Create the reference error message.
90528cat >expout <<'_ATEOF'
905291.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
905301.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
905311.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
905321.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
90533calc: error: 4444 != 1
90534_ATEOF
90535
90536# 3. If locations are not used, remove them.
90537sed 's/^[-0-9.]*: //' expout >at-expout
90538mv at-expout expout
90539# 4. If error-verbose is not used, strip the`, unexpected....' part.
90540sed 's/syntax error, .*$/syntax error/' expout >at-expout
90541mv at-expout expout
90542# 5. Check
90543{ set +x
90544$as_echo "$at_srcdir/calc.at:645: cat stderr"
90545at_fn_check_prepare_trace "calc.at:645"
90546( $at_check_trace; cat stderr
90547) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90548at_status=$? at_failed=false
90549$at_check_filter
90550at_fn_diff_devnull "$at_stderr" || at_failed=:
90551$at_diff expout "$at_stdout" || at_failed=:
90552at_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.
90560cat >input <<'_ATEOF'
90561(!) + (1 2) = 1
90562_ATEOF
90563
90564{ set +x
90565$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90566at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90567( $at_check_trace;  $PREPARSER ./calc input
90568) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90569at_status=$? at_failed=false
90570$at_check_filter
90571echo stderr:; tee stderr <"$at_stderr"
90572at_fn_diff_devnull "$at_stdout" || at_failed=:
90573at_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"
90579at_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>&-
90582at_status=$? at_failed=false
90583$at_check_filter
90584echo stderr:; tee stderr <"$at_stderr"
90585at_fn_diff_devnull "$at_stdout" || at_failed=:
90586at_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.
90595sed '/^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
90610mv at-stderr stderr
90611# 2. Create the reference error message.
90612cat >expout <<'_ATEOF'
906131.10: syntax error, unexpected number
90614calc: error: 2222 != 1
90615_ATEOF
90616
90617# 3. If locations are not used, remove them.
90618sed 's/^[-0-9.]*: //' expout >at-expout
90619mv at-expout expout
90620# 4. If error-verbose is not used, strip the`, unexpected....' part.
90621sed 's/syntax error, .*$/syntax error/' expout >at-expout
90622mv at-expout expout
90623# 5. Check
90624{ set +x
90625$as_echo "$at_srcdir/calc.at:645: cat stderr"
90626at_fn_check_prepare_trace "calc.at:645"
90627( $at_check_trace; cat stderr
90628) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90629at_status=$? at_failed=false
90630$at_check_filter
90631at_fn_diff_devnull "$at_stderr" || at_failed=:
90632$at_diff expout "$at_stdout" || at_failed=:
90633at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
90634$at_failed && at_fn_log_failure
90635$at_traceon; }
90636
90637
90638cat >input <<'_ATEOF'
90639(- *) + (1 2) = 1
90640_ATEOF
90641
90642{ set +x
90643$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90644at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90645( $at_check_trace;  $PREPARSER ./calc input
90646) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90647at_status=$? at_failed=false
90648$at_check_filter
90649echo stderr:; tee stderr <"$at_stderr"
90650at_fn_diff_devnull "$at_stdout" || at_failed=:
90651at_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"
90657at_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>&-
90660at_status=$? at_failed=false
90661$at_check_filter
90662echo stderr:; tee stderr <"$at_stderr"
90663at_fn_diff_devnull "$at_stdout" || at_failed=:
90664at_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.
90673sed '/^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
90688mv at-stderr stderr
90689# 2. Create the reference error message.
90690cat >expout <<'_ATEOF'
906911.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
906921.12: syntax error, unexpected number
90693calc: error: 2222 != 1
90694_ATEOF
90695
90696# 3. If locations are not used, remove them.
90697sed 's/^[-0-9.]*: //' expout >at-expout
90698mv at-expout expout
90699# 4. If error-verbose is not used, strip the`, unexpected....' part.
90700sed 's/syntax error, .*$/syntax error/' expout >at-expout
90701mv at-expout expout
90702# 5. Check
90703{ set +x
90704$as_echo "$at_srcdir/calc.at:645: cat stderr"
90705at_fn_check_prepare_trace "calc.at:645"
90706( $at_check_trace; cat stderr
90707) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90708at_status=$? at_failed=false
90709$at_check_filter
90710at_fn_diff_devnull "$at_stderr" || at_failed=:
90711$at_diff expout "$at_stdout" || at_failed=:
90712at_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.
90720cat >input <<'_ATEOF'
90721(* *) + (*) + (*)
90722_ATEOF
90723
90724{ set +x
90725$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
90726at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
90727( $at_check_trace;  $PREPARSER ./calc input
90728) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90729at_status=$? at_failed=false
90730$at_check_filter
90731echo stderr:; tee stderr <"$at_stderr"
90732at_fn_diff_devnull "$at_stdout" || at_failed=:
90733at_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"
90739at_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>&-
90742at_status=$? at_failed=false
90743$at_check_filter
90744echo stderr:; tee stderr <"$at_stderr"
90745at_fn_diff_devnull "$at_stdout" || at_failed=:
90746at_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.
90755sed '/^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
90770mv at-stderr stderr
90771# 2. Create the reference error message.
90772cat >expout <<'_ATEOF'
907731.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
907741.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
907751.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
90776_ATEOF
90777
90778# 3. If locations are not used, remove them.
90779sed 's/^[-0-9.]*: //' expout >at-expout
90780mv at-expout expout
90781# 4. If error-verbose is not used, strip the`, unexpected....' part.
90782sed 's/syntax error, .*$/syntax error/' expout >at-expout
90783mv at-expout expout
90784# 5. Check
90785{ set +x
90786$as_echo "$at_srcdir/calc.at:645: cat stderr"
90787at_fn_check_prepare_trace "calc.at:645"
90788( $at_check_trace; cat stderr
90789) >>"$at_stdout" 2>>"$at_stderr" 5>&-
90790at_status=$? at_failed=false
90791$at_check_filter
90792at_fn_diff_devnull "$at_stderr" || at_failed=:
90793$at_diff expout "$at_stdout" || at_failed=:
90794at_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
90805read at_status <"$at_status_file"
90806#AT_STOP_224
90807#AT_START_225
90808at_fn_group_banner 225 'calc.at:646' \
90809  "Calculator %glr-parser %error-verbose" "          " 12
90810at_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
90824cat >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
90865FILE *input;
90866static int power (int base, int exponent);
90867
90868static void yyerror ( const char *msg);
90869int 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%%
90887input:
90888  line
90889| input line         {  }
90890;
90891
90892line:
90893  '\n'
90894| exp '\n'           { USE ($1); }
90895;
90896
90897exp:
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
90918static int
90919power (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.  */
90931static
90932void yyerror ( const char *msg)
90933{
90934  fprintf (stderr, "%s\n", msg);
90935}
90936#include <ctype.h>
90937
90938int yylex (void);
90939static int get_char (void);
90940static void unget_char ( int c);
90941
90942
90943static int
90944get_char (void)
90945{
90946  int res = getc (input);
90947  ;
90948
90949  return res;
90950}
90951
90952static void
90953unget_char ( int c)
90954{
90955  ;
90956
90957  ungetc (c, input);
90958}
90959
90960static int
90961read_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
90992int 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
91028semantic_value global_result = 0;
91029int global_count = 0;
91030
91031/* A C main function.  */
91032int
91033main (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
91072if 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"
91080at_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>&-
91084at_status=$? at_failed=false
91085$at_check_filter
91086echo stderr:; cat "$at_stderr"
91087echo stdout:; cat "$at_stdout"
91088at_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"
91094at_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>&-
91097at_status=$? at_failed=false
91098$at_check_filter
91099echo stderr:; cat "$at_stderr"
91100echo stdout:; cat "$at_stdout"
91101at_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"
91110at_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>&-
91115at_status=$? at_failed=false
91116$at_check_filter
91117at_fn_diff_devnull "$at_stderr" || at_failed=:
91118$at_diff expout "$at_stdout" || at_failed=:
91119at_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"
91128at_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>&-
91133at_status=$? at_failed=false
91134$at_check_filter
91135at_fn_diff_devnull "$at_stderr" || at_failed=:
91136$at_diff expout "$at_stdout" || at_failed=:
91137at_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
91143fi
91144{ set +x
91145$as_echo "$at_srcdir/calc.at:646: bison -o calc.c calc.y"
91146at_fn_check_prepare_trace "calc.at:646"
91147( $at_check_trace; bison -o calc.c calc.y
91148) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91149at_status=$? at_failed=false
91150$at_check_filter
91151at_fn_diff_devnull "$at_stderr" || at_failed=:
91152at_fn_diff_devnull "$at_stdout" || at_failed=:
91153at_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"
91160at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:646"
91161( $at_check_trace; $BISON_C_WORKS
91162) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91163at_status=$? at_failed=false
91164$at_check_filter
91165echo stderr:; cat "$at_stderr"
91166echo stdout:; cat "$at_stdout"
91167at_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"
91173at_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>&-
91176at_status=$? at_failed=false
91177$at_check_filter
91178echo stderr:; cat "$at_stderr"
91179echo stdout:; cat "$at_stdout"
91180at_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"
91195at_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>&-
91206at_status=$? at_failed=false
91207$at_check_filter
91208at_fn_diff_devnull "$at_stderr" || at_failed=:
91209at_fn_diff_devnull "$at_stdout" || at_failed=:
91210at_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.
91217cat >input <<'_ATEOF'
912181 + 2 * 3 = 7
912191 + 2 * -3 = -5
91220
91221-1^2 = -1
91222(-1)^2 = 1
91223
91224---1 = -1
91225
912261 - 2 - 3 = -4
912271 - (2 - 3) = 2
91228
912292^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"
91235at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91236( $at_check_trace;  $PREPARSER ./calc input
91237) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91238at_status=$? at_failed=false
91239$at_check_filter
91240echo stderr:; tee stderr <"$at_stderr"
91241at_fn_diff_devnull "$at_stdout" || at_failed=:
91242at_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"
91248at_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>&-
91251at_status=$? at_failed=false
91252$at_check_filter
91253echo stderr:; tee stderr <"$at_stderr"
91254at_fn_diff_devnull "$at_stdout" || at_failed=:
91255at_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.
91263cat >input <<'_ATEOF'
912641 2
91265_ATEOF
91266
91267{ set +x
91268$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91269at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91270( $at_check_trace;  $PREPARSER ./calc input
91271) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91272at_status=$? at_failed=false
91273$at_check_filter
91274echo stderr:; tee stderr <"$at_stderr"
91275at_fn_diff_devnull "$at_stdout" || at_failed=:
91276at_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"
91282at_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>&-
91285at_status=$? at_failed=false
91286$at_check_filter
91287echo stderr:; tee stderr <"$at_stderr"
91288at_fn_diff_devnull "$at_stdout" || at_failed=:
91289at_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.
91298sed '/^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
91313mv at-stderr stderr
91314# 2. Create the reference error message.
91315cat >expout <<'_ATEOF'
913161.3: syntax error, unexpected number
91317_ATEOF
91318
91319# 3. If locations are not used, remove them.
91320sed 's/^[-0-9.]*: //' expout >at-expout
91321mv 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"
91327at_fn_check_prepare_trace "calc.at:646"
91328( $at_check_trace; cat stderr
91329) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91330at_status=$? at_failed=false
91331$at_check_filter
91332at_fn_diff_devnull "$at_stderr" || at_failed=:
91333$at_diff expout "$at_stdout" || at_failed=:
91334at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
91335$at_failed && at_fn_log_failure
91336$at_traceon; }
91337
91338
91339cat >input <<'_ATEOF'
913401//2
91341_ATEOF
91342
91343{ set +x
91344$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91345at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91346( $at_check_trace;  $PREPARSER ./calc input
91347) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91348at_status=$? at_failed=false
91349$at_check_filter
91350echo stderr:; tee stderr <"$at_stderr"
91351at_fn_diff_devnull "$at_stdout" || at_failed=:
91352at_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"
91358at_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>&-
91361at_status=$? at_failed=false
91362$at_check_filter
91363echo stderr:; tee stderr <"$at_stderr"
91364at_fn_diff_devnull "$at_stdout" || at_failed=:
91365at_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.
91374sed '/^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
91389mv at-stderr stderr
91390# 2. Create the reference error message.
91391cat >expout <<'_ATEOF'
913921.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
91393_ATEOF
91394
91395# 3. If locations are not used, remove them.
91396sed 's/^[-0-9.]*: //' expout >at-expout
91397mv 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"
91403at_fn_check_prepare_trace "calc.at:646"
91404( $at_check_trace; cat stderr
91405) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91406at_status=$? at_failed=false
91407$at_check_filter
91408at_fn_diff_devnull "$at_stderr" || at_failed=:
91409$at_diff expout "$at_stdout" || at_failed=:
91410at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
91411$at_failed && at_fn_log_failure
91412$at_traceon; }
91413
91414
91415cat >input <<'_ATEOF'
91416error
91417_ATEOF
91418
91419{ set +x
91420$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91421at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91422( $at_check_trace;  $PREPARSER ./calc input
91423) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91424at_status=$? at_failed=false
91425$at_check_filter
91426echo stderr:; tee stderr <"$at_stderr"
91427at_fn_diff_devnull "$at_stdout" || at_failed=:
91428at_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"
91434at_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>&-
91437at_status=$? at_failed=false
91438$at_check_filter
91439echo stderr:; tee stderr <"$at_stderr"
91440at_fn_diff_devnull "$at_stdout" || at_failed=:
91441at_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.
91450sed '/^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
91465mv at-stderr stderr
91466# 2. Create the reference error message.
91467cat >expout <<'_ATEOF'
914681.1: syntax error, unexpected $undefined
91469_ATEOF
91470
91471# 3. If locations are not used, remove them.
91472sed 's/^[-0-9.]*: //' expout >at-expout
91473mv 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"
91479at_fn_check_prepare_trace "calc.at:646"
91480( $at_check_trace; cat stderr
91481) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91482at_status=$? at_failed=false
91483$at_check_filter
91484at_fn_diff_devnull "$at_stderr" || at_failed=:
91485$at_diff expout "$at_stdout" || at_failed=:
91486at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
91487$at_failed && at_fn_log_failure
91488$at_traceon; }
91489
91490
91491cat >input <<'_ATEOF'
914921 = 2 = 3
91493_ATEOF
91494
91495{ set +x
91496$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91497at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91498( $at_check_trace;  $PREPARSER ./calc input
91499) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91500at_status=$? at_failed=false
91501$at_check_filter
91502echo stderr:; tee stderr <"$at_stderr"
91503at_fn_diff_devnull "$at_stdout" || at_failed=:
91504at_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"
91510at_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>&-
91513at_status=$? at_failed=false
91514$at_check_filter
91515echo stderr:; tee stderr <"$at_stderr"
91516at_fn_diff_devnull "$at_stdout" || at_failed=:
91517at_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.
91526sed '/^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
91541mv at-stderr stderr
91542# 2. Create the reference error message.
91543cat >expout <<'_ATEOF'
915441.7: syntax error, unexpected '='
91545_ATEOF
91546
91547# 3. If locations are not used, remove them.
91548sed 's/^[-0-9.]*: //' expout >at-expout
91549mv 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"
91555at_fn_check_prepare_trace "calc.at:646"
91556( $at_check_trace; cat stderr
91557) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91558at_status=$? at_failed=false
91559$at_check_filter
91560at_fn_diff_devnull "$at_stderr" || at_failed=:
91561$at_diff expout "$at_stdout" || at_failed=:
91562at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
91563$at_failed && at_fn_log_failure
91564$at_traceon; }
91565
91566
91567cat >input <<'_ATEOF'
91568
91569+1
91570_ATEOF
91571
91572{ set +x
91573$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91574at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91575( $at_check_trace;  $PREPARSER ./calc input
91576) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91577at_status=$? at_failed=false
91578$at_check_filter
91579echo stderr:; tee stderr <"$at_stderr"
91580at_fn_diff_devnull "$at_stdout" || at_failed=:
91581at_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"
91587at_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>&-
91590at_status=$? at_failed=false
91591$at_check_filter
91592echo stderr:; tee stderr <"$at_stderr"
91593at_fn_diff_devnull "$at_stdout" || at_failed=:
91594at_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.
91603sed '/^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
91618mv at-stderr stderr
91619# 2. Create the reference error message.
91620cat >expout <<'_ATEOF'
916212.1: syntax error, unexpected '+'
91622_ATEOF
91623
91624# 3. If locations are not used, remove them.
91625sed 's/^[-0-9.]*: //' expout >at-expout
91626mv 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"
91632at_fn_check_prepare_trace "calc.at:646"
91633( $at_check_trace; cat stderr
91634) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91635at_status=$? at_failed=false
91636$at_check_filter
91637at_fn_diff_devnull "$at_stderr" || at_failed=:
91638$at_diff expout "$at_stdout" || at_failed=:
91639at_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"
91647at_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>&-
91650at_status=$? at_failed=false
91651$at_check_filter
91652echo stderr:; tee stderr <"$at_stderr"
91653at_fn_diff_devnull "$at_stdout" || at_failed=:
91654at_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"
91660at_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>&-
91663at_status=$? at_failed=false
91664$at_check_filter
91665echo stderr:; tee stderr <"$at_stderr"
91666at_fn_diff_devnull "$at_stdout" || at_failed=:
91667at_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.
91676sed '/^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
91691mv at-stderr stderr
91692# 2. Create the reference error message.
91693cat >expout <<'_ATEOF'
916941.1: syntax error, unexpected end of input
91695_ATEOF
91696
91697# 3. If locations are not used, remove them.
91698sed 's/^[-0-9.]*: //' expout >at-expout
91699mv 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"
91705at_fn_check_prepare_trace "calc.at:646"
91706( $at_check_trace; cat stderr
91707) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91708at_status=$? at_failed=false
91709$at_check_filter
91710at_fn_diff_devnull "$at_stderr" || at_failed=:
91711$at_diff expout "$at_stdout" || at_failed=:
91712at_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#
91734cat >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"
91740at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91741( $at_check_trace;  $PREPARSER ./calc input
91742) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91743at_status=$? at_failed=false
91744$at_check_filter
91745echo stderr:; tee stderr <"$at_stderr"
91746at_fn_diff_devnull "$at_stdout" || at_failed=:
91747at_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"
91753at_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>&-
91756at_status=$? at_failed=false
91757$at_check_filter
91758echo stderr:; tee stderr <"$at_stderr"
91759at_fn_diff_devnull "$at_stdout" || at_failed=:
91760at_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.
91769sed '/^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
91784mv at-stderr stderr
91785# 2. Create the reference error message.
91786cat >expout <<'_ATEOF'
917871.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
917881.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
917891.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
917901.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
91791calc: error: 4444 != 1
91792_ATEOF
91793
91794# 3. If locations are not used, remove them.
91795sed 's/^[-0-9.]*: //' expout >at-expout
91796mv 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"
91802at_fn_check_prepare_trace "calc.at:646"
91803( $at_check_trace; cat stderr
91804) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91805at_status=$? at_failed=false
91806$at_check_filter
91807at_fn_diff_devnull "$at_stderr" || at_failed=:
91808$at_diff expout "$at_stdout" || at_failed=:
91809at_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.
91817cat >input <<'_ATEOF'
91818(!) + (1 2) = 1
91819_ATEOF
91820
91821{ set +x
91822$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91823at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91824( $at_check_trace;  $PREPARSER ./calc input
91825) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91826at_status=$? at_failed=false
91827$at_check_filter
91828echo stderr:; tee stderr <"$at_stderr"
91829at_fn_diff_devnull "$at_stdout" || at_failed=:
91830at_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"
91836at_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>&-
91839at_status=$? at_failed=false
91840$at_check_filter
91841echo stderr:; tee stderr <"$at_stderr"
91842at_fn_diff_devnull "$at_stdout" || at_failed=:
91843at_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.
91852sed '/^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
91867mv at-stderr stderr
91868# 2. Create the reference error message.
91869cat >expout <<'_ATEOF'
918701.10: syntax error, unexpected number
91871calc: error: 2222 != 1
91872_ATEOF
91873
91874# 3. If locations are not used, remove them.
91875sed 's/^[-0-9.]*: //' expout >at-expout
91876mv 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"
91882at_fn_check_prepare_trace "calc.at:646"
91883( $at_check_trace; cat stderr
91884) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91885at_status=$? at_failed=false
91886$at_check_filter
91887at_fn_diff_devnull "$at_stderr" || at_failed=:
91888$at_diff expout "$at_stdout" || at_failed=:
91889at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
91890$at_failed && at_fn_log_failure
91891$at_traceon; }
91892
91893
91894cat >input <<'_ATEOF'
91895(- *) + (1 2) = 1
91896_ATEOF
91897
91898{ set +x
91899$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91900at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91901( $at_check_trace;  $PREPARSER ./calc input
91902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91903at_status=$? at_failed=false
91904$at_check_filter
91905echo stderr:; tee stderr <"$at_stderr"
91906at_fn_diff_devnull "$at_stdout" || at_failed=:
91907at_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"
91913at_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>&-
91916at_status=$? at_failed=false
91917$at_check_filter
91918echo stderr:; tee stderr <"$at_stderr"
91919at_fn_diff_devnull "$at_stdout" || at_failed=:
91920at_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.
91929sed '/^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
91944mv at-stderr stderr
91945# 2. Create the reference error message.
91946cat >expout <<'_ATEOF'
919471.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
919481.12: syntax error, unexpected number
91949calc: error: 2222 != 1
91950_ATEOF
91951
91952# 3. If locations are not used, remove them.
91953sed 's/^[-0-9.]*: //' expout >at-expout
91954mv 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"
91960at_fn_check_prepare_trace "calc.at:646"
91961( $at_check_trace; cat stderr
91962) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91963at_status=$? at_failed=false
91964$at_check_filter
91965at_fn_diff_devnull "$at_stderr" || at_failed=:
91966$at_diff expout "$at_stdout" || at_failed=:
91967at_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.
91975cat >input <<'_ATEOF'
91976(* *) + (*) + (*)
91977_ATEOF
91978
91979{ set +x
91980$as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
91981at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
91982( $at_check_trace;  $PREPARSER ./calc input
91983) >>"$at_stdout" 2>>"$at_stderr" 5>&-
91984at_status=$? at_failed=false
91985$at_check_filter
91986echo stderr:; tee stderr <"$at_stderr"
91987at_fn_diff_devnull "$at_stdout" || at_failed=:
91988at_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"
91994at_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>&-
91997at_status=$? at_failed=false
91998$at_check_filter
91999echo stderr:; tee stderr <"$at_stderr"
92000at_fn_diff_devnull "$at_stdout" || at_failed=:
92001at_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.
92010sed '/^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
92025mv at-stderr stderr
92026# 2. Create the reference error message.
92027cat >expout <<'_ATEOF'
920281.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
920291.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
920301.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
92031_ATEOF
92032
92033# 3. If locations are not used, remove them.
92034sed 's/^[-0-9.]*: //' expout >at-expout
92035mv 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"
92041at_fn_check_prepare_trace "calc.at:646"
92042( $at_check_trace; cat stderr
92043) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92044at_status=$? at_failed=false
92045$at_check_filter
92046at_fn_diff_devnull "$at_stderr" || at_failed=:
92047$at_diff expout "$at_stdout" || at_failed=:
92048at_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
92059read at_status <"$at_status_file"
92060#AT_STOP_225
92061#AT_START_226
92062at_fn_group_banner 226 'calc.at:648' \
92063  "Calculator %glr-parser %define api.pure %locations" "" 12
92064at_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
92078cat >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
92119FILE *input;
92120static int power (int base, int exponent);
92121
92122static void yyerror (YYLTYPE const * const llocp,  const char *msg);
92123int 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%%
92141input:
92142  line
92143| input line         {  }
92144;
92145
92146line:
92147  '\n'
92148| exp '\n'           { USE ($1); }
92149;
92150
92151exp:
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
92172static int
92173power (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.  */
92185static
92186void 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
92194int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
92195static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
92196static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
92197
92198
92199static YYLTYPE last_yylloc;
92200
92201static int
92202get_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
92219static void
92220unget_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
92230static int
92231read_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
92262int 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
92300semantic_value global_result = 0;
92301int global_count = 0;
92302
92303/* A C main function.  */
92304int
92305main (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
92344if 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"
92352at_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>&-
92356at_status=$? at_failed=false
92357$at_check_filter
92358echo stderr:; cat "$at_stderr"
92359echo stdout:; cat "$at_stdout"
92360at_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"
92366at_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>&-
92369at_status=$? at_failed=false
92370$at_check_filter
92371echo stderr:; cat "$at_stderr"
92372echo stdout:; cat "$at_stdout"
92373at_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"
92382at_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>&-
92387at_status=$? at_failed=false
92388$at_check_filter
92389at_fn_diff_devnull "$at_stderr" || at_failed=:
92390$at_diff expout "$at_stdout" || at_failed=:
92391at_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"
92400at_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>&-
92405at_status=$? at_failed=false
92406$at_check_filter
92407at_fn_diff_devnull "$at_stderr" || at_failed=:
92408$at_diff expout "$at_stdout" || at_failed=:
92409at_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
92415fi
92416{ set +x
92417$as_echo "$at_srcdir/calc.at:648: bison -o calc.c calc.y"
92418at_fn_check_prepare_trace "calc.at:648"
92419( $at_check_trace; bison -o calc.c calc.y
92420) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92421at_status=$? at_failed=false
92422$at_check_filter
92423at_fn_diff_devnull "$at_stderr" || at_failed=:
92424at_fn_diff_devnull "$at_stdout" || at_failed=:
92425at_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"
92432at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648"
92433( $at_check_trace; $BISON_C_WORKS
92434) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92435at_status=$? at_failed=false
92436$at_check_filter
92437echo stderr:; cat "$at_stderr"
92438echo stdout:; cat "$at_stdout"
92439at_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"
92445at_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>&-
92448at_status=$? at_failed=false
92449$at_check_filter
92450echo stderr:; cat "$at_stderr"
92451echo stdout:; cat "$at_stdout"
92452at_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"
92467at_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>&-
92478at_status=$? at_failed=false
92479$at_check_filter
92480at_fn_diff_devnull "$at_stderr" || at_failed=:
92481at_fn_diff_devnull "$at_stdout" || at_failed=:
92482at_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.
92489cat >input <<'_ATEOF'
924901 + 2 * 3 = 7
924911 + 2 * -3 = -5
92492
92493-1^2 = -1
92494(-1)^2 = 1
92495
92496---1 = -1
92497
924981 - 2 - 3 = -4
924991 - (2 - 3) = 2
92500
925012^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"
92507at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92508( $at_check_trace;  $PREPARSER ./calc input
92509) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92510at_status=$? at_failed=false
92511$at_check_filter
92512echo stderr:; tee stderr <"$at_stderr"
92513at_fn_diff_devnull "$at_stdout" || at_failed=:
92514at_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"
92520at_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>&-
92523at_status=$? at_failed=false
92524$at_check_filter
92525echo stderr:; tee stderr <"$at_stderr"
92526at_fn_diff_devnull "$at_stdout" || at_failed=:
92527at_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.
92535cat >input <<'_ATEOF'
925361 2
92537_ATEOF
92538
92539{ set +x
92540$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
92541at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92542( $at_check_trace;  $PREPARSER ./calc input
92543) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92544at_status=$? at_failed=false
92545$at_check_filter
92546echo stderr:; tee stderr <"$at_stderr"
92547at_fn_diff_devnull "$at_stdout" || at_failed=:
92548at_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"
92554at_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>&-
92557at_status=$? at_failed=false
92558$at_check_filter
92559echo stderr:; tee stderr <"$at_stderr"
92560at_fn_diff_devnull "$at_stdout" || at_failed=:
92561at_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.
92570sed '/^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
92585mv at-stderr stderr
92586# 2. Create the reference error message.
92587cat >expout <<'_ATEOF'
925881.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.
92594sed 's/syntax error, .*$/syntax error/' expout >at-expout
92595mv at-expout expout
92596# 5. Check
92597{ set +x
92598$as_echo "$at_srcdir/calc.at:648: cat stderr"
92599at_fn_check_prepare_trace "calc.at:648"
92600( $at_check_trace; cat stderr
92601) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92602at_status=$? at_failed=false
92603$at_check_filter
92604at_fn_diff_devnull "$at_stderr" || at_failed=:
92605$at_diff expout "$at_stdout" || at_failed=:
92606at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
92607$at_failed && at_fn_log_failure
92608$at_traceon; }
92609
92610
92611cat >input <<'_ATEOF'
926121//2
92613_ATEOF
92614
92615{ set +x
92616$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
92617at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92618( $at_check_trace;  $PREPARSER ./calc input
92619) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92620at_status=$? at_failed=false
92621$at_check_filter
92622echo stderr:; tee stderr <"$at_stderr"
92623at_fn_diff_devnull "$at_stdout" || at_failed=:
92624at_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"
92630at_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>&-
92633at_status=$? at_failed=false
92634$at_check_filter
92635echo stderr:; tee stderr <"$at_stderr"
92636at_fn_diff_devnull "$at_stdout" || at_failed=:
92637at_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.
92646sed '/^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
92661mv at-stderr stderr
92662# 2. Create the reference error message.
92663cat >expout <<'_ATEOF'
926641.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.
92670sed 's/syntax error, .*$/syntax error/' expout >at-expout
92671mv at-expout expout
92672# 5. Check
92673{ set +x
92674$as_echo "$at_srcdir/calc.at:648: cat stderr"
92675at_fn_check_prepare_trace "calc.at:648"
92676( $at_check_trace; cat stderr
92677) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92678at_status=$? at_failed=false
92679$at_check_filter
92680at_fn_diff_devnull "$at_stderr" || at_failed=:
92681$at_diff expout "$at_stdout" || at_failed=:
92682at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
92683$at_failed && at_fn_log_failure
92684$at_traceon; }
92685
92686
92687cat >input <<'_ATEOF'
92688error
92689_ATEOF
92690
92691{ set +x
92692$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
92693at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92694( $at_check_trace;  $PREPARSER ./calc input
92695) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92696at_status=$? at_failed=false
92697$at_check_filter
92698echo stderr:; tee stderr <"$at_stderr"
92699at_fn_diff_devnull "$at_stdout" || at_failed=:
92700at_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"
92706at_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>&-
92709at_status=$? at_failed=false
92710$at_check_filter
92711echo stderr:; tee stderr <"$at_stderr"
92712at_fn_diff_devnull "$at_stdout" || at_failed=:
92713at_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.
92722sed '/^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
92737mv at-stderr stderr
92738# 2. Create the reference error message.
92739cat >expout <<'_ATEOF'
927401.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.
92746sed 's/syntax error, .*$/syntax error/' expout >at-expout
92747mv at-expout expout
92748# 5. Check
92749{ set +x
92750$as_echo "$at_srcdir/calc.at:648: cat stderr"
92751at_fn_check_prepare_trace "calc.at:648"
92752( $at_check_trace; cat stderr
92753) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92754at_status=$? at_failed=false
92755$at_check_filter
92756at_fn_diff_devnull "$at_stderr" || at_failed=:
92757$at_diff expout "$at_stdout" || at_failed=:
92758at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
92759$at_failed && at_fn_log_failure
92760$at_traceon; }
92761
92762
92763cat >input <<'_ATEOF'
927641 = 2 = 3
92765_ATEOF
92766
92767{ set +x
92768$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
92769at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92770( $at_check_trace;  $PREPARSER ./calc input
92771) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92772at_status=$? at_failed=false
92773$at_check_filter
92774echo stderr:; tee stderr <"$at_stderr"
92775at_fn_diff_devnull "$at_stdout" || at_failed=:
92776at_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"
92782at_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>&-
92785at_status=$? at_failed=false
92786$at_check_filter
92787echo stderr:; tee stderr <"$at_stderr"
92788at_fn_diff_devnull "$at_stdout" || at_failed=:
92789at_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.
92798sed '/^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
92813mv at-stderr stderr
92814# 2. Create the reference error message.
92815cat >expout <<'_ATEOF'
928161.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.
92822sed 's/syntax error, .*$/syntax error/' expout >at-expout
92823mv at-expout expout
92824# 5. Check
92825{ set +x
92826$as_echo "$at_srcdir/calc.at:648: cat stderr"
92827at_fn_check_prepare_trace "calc.at:648"
92828( $at_check_trace; cat stderr
92829) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92830at_status=$? at_failed=false
92831$at_check_filter
92832at_fn_diff_devnull "$at_stderr" || at_failed=:
92833$at_diff expout "$at_stdout" || at_failed=:
92834at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
92835$at_failed && at_fn_log_failure
92836$at_traceon; }
92837
92838
92839cat >input <<'_ATEOF'
92840
92841+1
92842_ATEOF
92843
92844{ set +x
92845$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
92846at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
92847( $at_check_trace;  $PREPARSER ./calc input
92848) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92849at_status=$? at_failed=false
92850$at_check_filter
92851echo stderr:; tee stderr <"$at_stderr"
92852at_fn_diff_devnull "$at_stdout" || at_failed=:
92853at_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"
92859at_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>&-
92862at_status=$? at_failed=false
92863$at_check_filter
92864echo stderr:; tee stderr <"$at_stderr"
92865at_fn_diff_devnull "$at_stdout" || at_failed=:
92866at_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.
92875sed '/^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
92890mv at-stderr stderr
92891# 2. Create the reference error message.
92892cat >expout <<'_ATEOF'
928932.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.
92899sed 's/syntax error, .*$/syntax error/' expout >at-expout
92900mv at-expout expout
92901# 5. Check
92902{ set +x
92903$as_echo "$at_srcdir/calc.at:648: cat stderr"
92904at_fn_check_prepare_trace "calc.at:648"
92905( $at_check_trace; cat stderr
92906) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92907at_status=$? at_failed=false
92908$at_check_filter
92909at_fn_diff_devnull "$at_stderr" || at_failed=:
92910$at_diff expout "$at_stdout" || at_failed=:
92911at_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"
92919at_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>&-
92922at_status=$? at_failed=false
92923$at_check_filter
92924echo stderr:; tee stderr <"$at_stderr"
92925at_fn_diff_devnull "$at_stdout" || at_failed=:
92926at_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"
92932at_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>&-
92935at_status=$? at_failed=false
92936$at_check_filter
92937echo stderr:; tee stderr <"$at_stderr"
92938at_fn_diff_devnull "$at_stdout" || at_failed=:
92939at_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.
92948sed '/^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
92963mv at-stderr stderr
92964# 2. Create the reference error message.
92965cat >expout <<'_ATEOF'
929661.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.
92972sed 's/syntax error, .*$/syntax error/' expout >at-expout
92973mv at-expout expout
92974# 5. Check
92975{ set +x
92976$as_echo "$at_srcdir/calc.at:648: cat stderr"
92977at_fn_check_prepare_trace "calc.at:648"
92978( $at_check_trace; cat stderr
92979) >>"$at_stdout" 2>>"$at_stderr" 5>&-
92980at_status=$? at_failed=false
92981$at_check_filter
92982at_fn_diff_devnull "$at_stderr" || at_failed=:
92983$at_diff expout "$at_stdout" || at_failed=:
92984at_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#
93006cat >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"
93012at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
93013( $at_check_trace;  $PREPARSER ./calc input
93014) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93015at_status=$? at_failed=false
93016$at_check_filter
93017echo stderr:; tee stderr <"$at_stderr"
93018at_fn_diff_devnull "$at_stdout" || at_failed=:
93019at_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"
93025at_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>&-
93028at_status=$? at_failed=false
93029$at_check_filter
93030echo stderr:; tee stderr <"$at_stderr"
93031at_fn_diff_devnull "$at_stdout" || at_failed=:
93032at_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.
93041sed '/^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
93056mv at-stderr stderr
93057# 2. Create the reference error message.
93058cat >expout <<'_ATEOF'
930591.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
930601.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
930611.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
930621.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
93063calc: 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.
93069sed 's/syntax error, .*$/syntax error/' expout >at-expout
93070mv at-expout expout
93071# 5. Check
93072{ set +x
93073$as_echo "$at_srcdir/calc.at:648: cat stderr"
93074at_fn_check_prepare_trace "calc.at:648"
93075( $at_check_trace; cat stderr
93076) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93077at_status=$? at_failed=false
93078$at_check_filter
93079at_fn_diff_devnull "$at_stderr" || at_failed=:
93080$at_diff expout "$at_stdout" || at_failed=:
93081at_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.
93089cat >input <<'_ATEOF'
93090(!) + (1 2) = 1
93091_ATEOF
93092
93093{ set +x
93094$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
93095at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
93096( $at_check_trace;  $PREPARSER ./calc input
93097) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93098at_status=$? at_failed=false
93099$at_check_filter
93100echo stderr:; tee stderr <"$at_stderr"
93101at_fn_diff_devnull "$at_stdout" || at_failed=:
93102at_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"
93108at_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>&-
93111at_status=$? at_failed=false
93112$at_check_filter
93113echo stderr:; tee stderr <"$at_stderr"
93114at_fn_diff_devnull "$at_stdout" || at_failed=:
93115at_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.
93124sed '/^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
93139mv at-stderr stderr
93140# 2. Create the reference error message.
93141cat >expout <<'_ATEOF'
931421.10: syntax error, unexpected number
93143calc: 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.
93149sed 's/syntax error, .*$/syntax error/' expout >at-expout
93150mv at-expout expout
93151# 5. Check
93152{ set +x
93153$as_echo "$at_srcdir/calc.at:648: cat stderr"
93154at_fn_check_prepare_trace "calc.at:648"
93155( $at_check_trace; cat stderr
93156) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93157at_status=$? at_failed=false
93158$at_check_filter
93159at_fn_diff_devnull "$at_stderr" || at_failed=:
93160$at_diff expout "$at_stdout" || at_failed=:
93161at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
93162$at_failed && at_fn_log_failure
93163$at_traceon; }
93164
93165
93166cat >input <<'_ATEOF'
93167(- *) + (1 2) = 1
93168_ATEOF
93169
93170{ set +x
93171$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
93172at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
93173( $at_check_trace;  $PREPARSER ./calc input
93174) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93175at_status=$? at_failed=false
93176$at_check_filter
93177echo stderr:; tee stderr <"$at_stderr"
93178at_fn_diff_devnull "$at_stdout" || at_failed=:
93179at_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"
93185at_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>&-
93188at_status=$? at_failed=false
93189$at_check_filter
93190echo stderr:; tee stderr <"$at_stderr"
93191at_fn_diff_devnull "$at_stdout" || at_failed=:
93192at_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.
93201sed '/^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
93216mv at-stderr stderr
93217# 2. Create the reference error message.
93218cat >expout <<'_ATEOF'
932191.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
932201.12: syntax error, unexpected number
93221calc: 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.
93227sed 's/syntax error, .*$/syntax error/' expout >at-expout
93228mv at-expout expout
93229# 5. Check
93230{ set +x
93231$as_echo "$at_srcdir/calc.at:648: cat stderr"
93232at_fn_check_prepare_trace "calc.at:648"
93233( $at_check_trace; cat stderr
93234) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93235at_status=$? at_failed=false
93236$at_check_filter
93237at_fn_diff_devnull "$at_stderr" || at_failed=:
93238$at_diff expout "$at_stdout" || at_failed=:
93239at_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.
93247cat >input <<'_ATEOF'
93248(* *) + (*) + (*)
93249_ATEOF
93250
93251{ set +x
93252$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
93253at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
93254( $at_check_trace;  $PREPARSER ./calc input
93255) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93256at_status=$? at_failed=false
93257$at_check_filter
93258echo stderr:; tee stderr <"$at_stderr"
93259at_fn_diff_devnull "$at_stdout" || at_failed=:
93260at_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"
93266at_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>&-
93269at_status=$? at_failed=false
93270$at_check_filter
93271echo stderr:; tee stderr <"$at_stderr"
93272at_fn_diff_devnull "$at_stdout" || at_failed=:
93273at_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.
93282sed '/^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
93297mv at-stderr stderr
93298# 2. Create the reference error message.
93299cat >expout <<'_ATEOF'
933001.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
933011.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
933021.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.
93308sed 's/syntax error, .*$/syntax error/' expout >at-expout
93309mv at-expout expout
93310# 5. Check
93311{ set +x
93312$as_echo "$at_srcdir/calc.at:648: cat stderr"
93313at_fn_check_prepare_trace "calc.at:648"
93314( $at_check_trace; cat stderr
93315) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93316at_status=$? at_failed=false
93317$at_check_filter
93318at_fn_diff_devnull "$at_stderr" || at_failed=:
93319$at_diff expout "$at_stdout" || at_failed=:
93320at_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
93331read at_status <"$at_status_file"
93332#AT_STOP_226
93333#AT_START_227
93334at_fn_group_banner 227 'calc.at:649' \
93335  "Calculator %glr-parser %error-verbose %locations" "" 12
93336at_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
93350cat >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
93391FILE *input;
93392static int power (int base, int exponent);
93393
93394static void yyerror ( const char *msg);
93395int 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%%
93413input:
93414  line
93415| input line         {  }
93416;
93417
93418line:
93419  '\n'
93420| exp '\n'           { USE ($1); }
93421;
93422
93423exp:
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
93444static int
93445power (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.  */
93457static
93458void 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
93466int yylex (void);
93467static int get_char (void);
93468static void unget_char ( int c);
93469
93470
93471static YYLTYPE last_yylloc;
93472
93473static int
93474get_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
93491static void
93492unget_char ( int c)
93493{
93494  ;
93495
93496  /* Wrong when C == `\n'. */
93497  (yylloc) = last_yylloc;
93498
93499  ungetc (c, input);
93500}
93501
93502static int
93503read_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
93534int 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
93572semantic_value global_result = 0;
93573int global_count = 0;
93574
93575/* A C main function.  */
93576int
93577main (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
93616if 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"
93624at_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>&-
93628at_status=$? at_failed=false
93629$at_check_filter
93630echo stderr:; cat "$at_stderr"
93631echo stdout:; cat "$at_stdout"
93632at_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"
93638at_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>&-
93641at_status=$? at_failed=false
93642$at_check_filter
93643echo stderr:; cat "$at_stderr"
93644echo stdout:; cat "$at_stdout"
93645at_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"
93654at_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>&-
93659at_status=$? at_failed=false
93660$at_check_filter
93661at_fn_diff_devnull "$at_stderr" || at_failed=:
93662$at_diff expout "$at_stdout" || at_failed=:
93663at_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"
93672at_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>&-
93677at_status=$? at_failed=false
93678$at_check_filter
93679at_fn_diff_devnull "$at_stderr" || at_failed=:
93680$at_diff expout "$at_stdout" || at_failed=:
93681at_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
93687fi
93688{ set +x
93689$as_echo "$at_srcdir/calc.at:649: bison -o calc.c calc.y"
93690at_fn_check_prepare_trace "calc.at:649"
93691( $at_check_trace; bison -o calc.c calc.y
93692) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93693at_status=$? at_failed=false
93694$at_check_filter
93695at_fn_diff_devnull "$at_stderr" || at_failed=:
93696at_fn_diff_devnull "$at_stdout" || at_failed=:
93697at_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"
93704at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:649"
93705( $at_check_trace; $BISON_C_WORKS
93706) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93707at_status=$? at_failed=false
93708$at_check_filter
93709echo stderr:; cat "$at_stderr"
93710echo stdout:; cat "$at_stdout"
93711at_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"
93717at_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>&-
93720at_status=$? at_failed=false
93721$at_check_filter
93722echo stderr:; cat "$at_stderr"
93723echo stdout:; cat "$at_stdout"
93724at_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"
93739at_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>&-
93750at_status=$? at_failed=false
93751$at_check_filter
93752at_fn_diff_devnull "$at_stderr" || at_failed=:
93753at_fn_diff_devnull "$at_stdout" || at_failed=:
93754at_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.
93761cat >input <<'_ATEOF'
937621 + 2 * 3 = 7
937631 + 2 * -3 = -5
93764
93765-1^2 = -1
93766(-1)^2 = 1
93767
93768---1 = -1
93769
937701 - 2 - 3 = -4
937711 - (2 - 3) = 2
93772
937732^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"
93779at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
93780( $at_check_trace;  $PREPARSER ./calc input
93781) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93782at_status=$? at_failed=false
93783$at_check_filter
93784echo stderr:; tee stderr <"$at_stderr"
93785at_fn_diff_devnull "$at_stdout" || at_failed=:
93786at_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"
93792at_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>&-
93795at_status=$? at_failed=false
93796$at_check_filter
93797echo stderr:; tee stderr <"$at_stderr"
93798at_fn_diff_devnull "$at_stdout" || at_failed=:
93799at_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.
93807cat >input <<'_ATEOF'
938081 2
93809_ATEOF
93810
93811{ set +x
93812$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
93813at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
93814( $at_check_trace;  $PREPARSER ./calc input
93815) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93816at_status=$? at_failed=false
93817$at_check_filter
93818echo stderr:; tee stderr <"$at_stderr"
93819at_fn_diff_devnull "$at_stdout" || at_failed=:
93820at_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"
93826at_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>&-
93829at_status=$? at_failed=false
93830$at_check_filter
93831echo stderr:; tee stderr <"$at_stderr"
93832at_fn_diff_devnull "$at_stdout" || at_failed=:
93833at_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.
93842sed '/^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
93857mv at-stderr stderr
93858# 2. Create the reference error message.
93859cat >expout <<'_ATEOF'
938601.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"
93870at_fn_check_prepare_trace "calc.at:649"
93871( $at_check_trace; cat stderr
93872) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93873at_status=$? at_failed=false
93874$at_check_filter
93875at_fn_diff_devnull "$at_stderr" || at_failed=:
93876$at_diff expout "$at_stdout" || at_failed=:
93877at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
93878$at_failed && at_fn_log_failure
93879$at_traceon; }
93880
93881
93882cat >input <<'_ATEOF'
938831//2
93884_ATEOF
93885
93886{ set +x
93887$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
93888at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
93889( $at_check_trace;  $PREPARSER ./calc input
93890) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93891at_status=$? at_failed=false
93892$at_check_filter
93893echo stderr:; tee stderr <"$at_stderr"
93894at_fn_diff_devnull "$at_stdout" || at_failed=:
93895at_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"
93901at_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>&-
93904at_status=$? at_failed=false
93905$at_check_filter
93906echo stderr:; tee stderr <"$at_stderr"
93907at_fn_diff_devnull "$at_stdout" || at_failed=:
93908at_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.
93917sed '/^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
93932mv at-stderr stderr
93933# 2. Create the reference error message.
93934cat >expout <<'_ATEOF'
939351.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"
93945at_fn_check_prepare_trace "calc.at:649"
93946( $at_check_trace; cat stderr
93947) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93948at_status=$? at_failed=false
93949$at_check_filter
93950at_fn_diff_devnull "$at_stderr" || at_failed=:
93951$at_diff expout "$at_stdout" || at_failed=:
93952at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
93953$at_failed && at_fn_log_failure
93954$at_traceon; }
93955
93956
93957cat >input <<'_ATEOF'
93958error
93959_ATEOF
93960
93961{ set +x
93962$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
93963at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
93964( $at_check_trace;  $PREPARSER ./calc input
93965) >>"$at_stdout" 2>>"$at_stderr" 5>&-
93966at_status=$? at_failed=false
93967$at_check_filter
93968echo stderr:; tee stderr <"$at_stderr"
93969at_fn_diff_devnull "$at_stdout" || at_failed=:
93970at_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"
93976at_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>&-
93979at_status=$? at_failed=false
93980$at_check_filter
93981echo stderr:; tee stderr <"$at_stderr"
93982at_fn_diff_devnull "$at_stdout" || at_failed=:
93983at_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.
93992sed '/^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
94007mv at-stderr stderr
94008# 2. Create the reference error message.
94009cat >expout <<'_ATEOF'
940101.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"
94020at_fn_check_prepare_trace "calc.at:649"
94021( $at_check_trace; cat stderr
94022) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94023at_status=$? at_failed=false
94024$at_check_filter
94025at_fn_diff_devnull "$at_stderr" || at_failed=:
94026$at_diff expout "$at_stdout" || at_failed=:
94027at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
94028$at_failed && at_fn_log_failure
94029$at_traceon; }
94030
94031
94032cat >input <<'_ATEOF'
940331 = 2 = 3
94034_ATEOF
94035
94036{ set +x
94037$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
94038at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94039( $at_check_trace;  $PREPARSER ./calc input
94040) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94041at_status=$? at_failed=false
94042$at_check_filter
94043echo stderr:; tee stderr <"$at_stderr"
94044at_fn_diff_devnull "$at_stdout" || at_failed=:
94045at_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"
94051at_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>&-
94054at_status=$? at_failed=false
94055$at_check_filter
94056echo stderr:; tee stderr <"$at_stderr"
94057at_fn_diff_devnull "$at_stdout" || at_failed=:
94058at_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.
94067sed '/^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
94082mv at-stderr stderr
94083# 2. Create the reference error message.
94084cat >expout <<'_ATEOF'
940851.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"
94095at_fn_check_prepare_trace "calc.at:649"
94096( $at_check_trace; cat stderr
94097) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94098at_status=$? at_failed=false
94099$at_check_filter
94100at_fn_diff_devnull "$at_stderr" || at_failed=:
94101$at_diff expout "$at_stdout" || at_failed=:
94102at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
94103$at_failed && at_fn_log_failure
94104$at_traceon; }
94105
94106
94107cat >input <<'_ATEOF'
94108
94109+1
94110_ATEOF
94111
94112{ set +x
94113$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
94114at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94115( $at_check_trace;  $PREPARSER ./calc input
94116) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94117at_status=$? at_failed=false
94118$at_check_filter
94119echo stderr:; tee stderr <"$at_stderr"
94120at_fn_diff_devnull "$at_stdout" || at_failed=:
94121at_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"
94127at_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>&-
94130at_status=$? at_failed=false
94131$at_check_filter
94132echo stderr:; tee stderr <"$at_stderr"
94133at_fn_diff_devnull "$at_stdout" || at_failed=:
94134at_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.
94143sed '/^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
94158mv at-stderr stderr
94159# 2. Create the reference error message.
94160cat >expout <<'_ATEOF'
941612.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"
94171at_fn_check_prepare_trace "calc.at:649"
94172( $at_check_trace; cat stderr
94173) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94174at_status=$? at_failed=false
94175$at_check_filter
94176at_fn_diff_devnull "$at_stderr" || at_failed=:
94177$at_diff expout "$at_stdout" || at_failed=:
94178at_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"
94186at_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>&-
94189at_status=$? at_failed=false
94190$at_check_filter
94191echo stderr:; tee stderr <"$at_stderr"
94192at_fn_diff_devnull "$at_stdout" || at_failed=:
94193at_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"
94199at_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>&-
94202at_status=$? at_failed=false
94203$at_check_filter
94204echo stderr:; tee stderr <"$at_stderr"
94205at_fn_diff_devnull "$at_stdout" || at_failed=:
94206at_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.
94215sed '/^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
94230mv at-stderr stderr
94231# 2. Create the reference error message.
94232cat >expout <<'_ATEOF'
942331.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"
94243at_fn_check_prepare_trace "calc.at:649"
94244( $at_check_trace; cat stderr
94245) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94246at_status=$? at_failed=false
94247$at_check_filter
94248at_fn_diff_devnull "$at_stderr" || at_failed=:
94249$at_diff expout "$at_stdout" || at_failed=:
94250at_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#
94272cat >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"
94278at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94279( $at_check_trace;  $PREPARSER ./calc input
94280) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94281at_status=$? at_failed=false
94282$at_check_filter
94283echo stderr:; tee stderr <"$at_stderr"
94284at_fn_diff_devnull "$at_stdout" || at_failed=:
94285at_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"
94291at_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>&-
94294at_status=$? at_failed=false
94295$at_check_filter
94296echo stderr:; tee stderr <"$at_stderr"
94297at_fn_diff_devnull "$at_stdout" || at_failed=:
94298at_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.
94307sed '/^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
94322mv at-stderr stderr
94323# 2. Create the reference error message.
94324cat >expout <<'_ATEOF'
943251.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
943261.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
943271.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
943281.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
94329calc: 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"
94339at_fn_check_prepare_trace "calc.at:649"
94340( $at_check_trace; cat stderr
94341) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94342at_status=$? at_failed=false
94343$at_check_filter
94344at_fn_diff_devnull "$at_stderr" || at_failed=:
94345$at_diff expout "$at_stdout" || at_failed=:
94346at_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.
94354cat >input <<'_ATEOF'
94355(!) + (1 2) = 1
94356_ATEOF
94357
94358{ set +x
94359$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
94360at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94361( $at_check_trace;  $PREPARSER ./calc input
94362) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94363at_status=$? at_failed=false
94364$at_check_filter
94365echo stderr:; tee stderr <"$at_stderr"
94366at_fn_diff_devnull "$at_stdout" || at_failed=:
94367at_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"
94373at_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>&-
94376at_status=$? at_failed=false
94377$at_check_filter
94378echo stderr:; tee stderr <"$at_stderr"
94379at_fn_diff_devnull "$at_stdout" || at_failed=:
94380at_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.
94389sed '/^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
94404mv at-stderr stderr
94405# 2. Create the reference error message.
94406cat >expout <<'_ATEOF'
944071.10: syntax error, unexpected number
94408calc: 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"
94418at_fn_check_prepare_trace "calc.at:649"
94419( $at_check_trace; cat stderr
94420) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94421at_status=$? at_failed=false
94422$at_check_filter
94423at_fn_diff_devnull "$at_stderr" || at_failed=:
94424$at_diff expout "$at_stdout" || at_failed=:
94425at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
94426$at_failed && at_fn_log_failure
94427$at_traceon; }
94428
94429
94430cat >input <<'_ATEOF'
94431(- *) + (1 2) = 1
94432_ATEOF
94433
94434{ set +x
94435$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
94436at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94437( $at_check_trace;  $PREPARSER ./calc input
94438) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94439at_status=$? at_failed=false
94440$at_check_filter
94441echo stderr:; tee stderr <"$at_stderr"
94442at_fn_diff_devnull "$at_stdout" || at_failed=:
94443at_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"
94449at_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>&-
94452at_status=$? at_failed=false
94453$at_check_filter
94454echo stderr:; tee stderr <"$at_stderr"
94455at_fn_diff_devnull "$at_stdout" || at_failed=:
94456at_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.
94465sed '/^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
94480mv at-stderr stderr
94481# 2. Create the reference error message.
94482cat >expout <<'_ATEOF'
944831.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
944841.12: syntax error, unexpected number
94485calc: 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"
94495at_fn_check_prepare_trace "calc.at:649"
94496( $at_check_trace; cat stderr
94497) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94498at_status=$? at_failed=false
94499$at_check_filter
94500at_fn_diff_devnull "$at_stderr" || at_failed=:
94501$at_diff expout "$at_stdout" || at_failed=:
94502at_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.
94510cat >input <<'_ATEOF'
94511(* *) + (*) + (*)
94512_ATEOF
94513
94514{ set +x
94515$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
94516at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
94517( $at_check_trace;  $PREPARSER ./calc input
94518) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94519at_status=$? at_failed=false
94520$at_check_filter
94521echo stderr:; tee stderr <"$at_stderr"
94522at_fn_diff_devnull "$at_stdout" || at_failed=:
94523at_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"
94529at_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>&-
94532at_status=$? at_failed=false
94533$at_check_filter
94534echo stderr:; tee stderr <"$at_stderr"
94535at_fn_diff_devnull "$at_stdout" || at_failed=:
94536at_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.
94545sed '/^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
94560mv at-stderr stderr
94561# 2. Create the reference error message.
94562cat >expout <<'_ATEOF'
945631.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
945641.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
945651.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"
94575at_fn_check_prepare_trace "calc.at:649"
94576( $at_check_trace; cat stderr
94577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94578at_status=$? at_failed=false
94579$at_check_filter
94580at_fn_diff_devnull "$at_stderr" || at_failed=:
94581$at_diff expout "$at_stdout" || at_failed=:
94582at_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
94593read at_status <"$at_status_file"
94594#AT_STOP_227
94595#AT_START_228
94596at_fn_group_banner 228 'calc.at:651' \
94597  "Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
94598at_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
94612cat >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
94653FILE *input;
94654static int power (int base, int exponent);
94655
94656static void calcerror ( const char *msg);
94657int 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%%
94675input:
94676  line
94677| input line         {  }
94678;
94679
94680line:
94681  '\n'
94682| exp '\n'           { USE ($1); }
94683;
94684
94685exp:
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
94706static int
94707power (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.  */
94719static
94720void 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
94730cat >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
94741int calclex (void);
94742static int get_char (void);
94743static void unget_char ( int c);
94744
94745
94746static YYLTYPE last_yylloc;
94747
94748static int
94749get_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
94766static void
94767unget_char ( int c)
94768{
94769  ;
94770
94771  /* Wrong when C == `\n'. */
94772  (calclloc) = last_yylloc;
94773
94774  ungetc (c, input);
94775}
94776
94777static int
94778read_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
94809int 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
94839cat >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
94858semantic_value global_result = 0;
94859int global_count = 0;
94860
94861/* A C main function.  */
94862int
94863main (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
94901if 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"
94909at_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>&-
94913at_status=$? at_failed=false
94914$at_check_filter
94915echo stderr:; cat "$at_stderr"
94916echo stdout:; cat "$at_stdout"
94917at_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"
94923at_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>&-
94926at_status=$? at_failed=false
94927$at_check_filter
94928echo stderr:; cat "$at_stderr"
94929echo stdout:; cat "$at_stdout"
94930at_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"
94939at_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>&-
94944at_status=$? at_failed=false
94945$at_check_filter
94946at_fn_diff_devnull "$at_stderr" || at_failed=:
94947$at_diff expout "$at_stdout" || at_failed=:
94948at_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"
94957at_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>&-
94962at_status=$? at_failed=false
94963$at_check_filter
94964at_fn_diff_devnull "$at_stderr" || at_failed=:
94965$at_diff expout "$at_stdout" || at_failed=:
94966at_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
94972fi
94973{ set +x
94974$as_echo "$at_srcdir/calc.at:651: bison -o calc.c calc.y"
94975at_fn_check_prepare_trace "calc.at:651"
94976( $at_check_trace; bison -o calc.c calc.y
94977) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94978at_status=$? at_failed=false
94979$at_check_filter
94980at_fn_diff_devnull "$at_stderr" || at_failed=:
94981at_fn_diff_devnull "$at_stdout" || at_failed=:
94982at_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"
94989at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:651"
94990( $at_check_trace; $BISON_C_WORKS
94991) >>"$at_stdout" 2>>"$at_stderr" 5>&-
94992at_status=$? at_failed=false
94993$at_check_filter
94994echo stderr:; cat "$at_stderr"
94995echo stdout:; cat "$at_stdout"
94996at_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"
95002at_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>&-
95005at_status=$? at_failed=false
95006$at_check_filter
95007echo stderr:; cat "$at_stderr"
95008echo stdout:; cat "$at_stdout"
95009at_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"
95024at_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>&-
95035at_status=$? at_failed=false
95036$at_check_filter
95037at_fn_diff_devnull "$at_stderr" || at_failed=:
95038at_fn_diff_devnull "$at_stdout" || at_failed=:
95039at_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"
95053at_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>&-
95064at_status=$? at_failed=false
95065$at_check_filter
95066at_fn_diff_devnull "$at_stderr" || at_failed=:
95067at_fn_diff_devnull "$at_stdout" || at_failed=:
95068at_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.
95074cat >input <<'_ATEOF'
950751 + 2 * 3 = 7
950761 + 2 * -3 = -5
95077
95078-1^2 = -1
95079(-1)^2 = 1
95080
95081---1 = -1
95082
950831 - 2 - 3 = -4
950841 - (2 - 3) = 2
95085
950862^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"
95092at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95093( $at_check_trace;  $PREPARSER ./calc input
95094) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95095at_status=$? at_failed=false
95096$at_check_filter
95097echo stderr:; tee stderr <"$at_stderr"
95098at_fn_diff_devnull "$at_stdout" || at_failed=:
95099at_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"
95105at_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>&-
95108at_status=$? at_failed=false
95109$at_check_filter
95110echo stderr:; tee stderr <"$at_stderr"
95111at_fn_diff_devnull "$at_stdout" || at_failed=:
95112at_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.
95120cat >input <<'_ATEOF'
951211 2
95122_ATEOF
95123
95124{ set +x
95125$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95126at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95127( $at_check_trace;  $PREPARSER ./calc input
95128) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95129at_status=$? at_failed=false
95130$at_check_filter
95131echo stderr:; tee stderr <"$at_stderr"
95132at_fn_diff_devnull "$at_stdout" || at_failed=:
95133at_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"
95139at_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>&-
95142at_status=$? at_failed=false
95143$at_check_filter
95144echo stderr:; tee stderr <"$at_stderr"
95145at_fn_diff_devnull "$at_stdout" || at_failed=:
95146at_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.
95155sed '/^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
95170mv at-stderr stderr
95171# 2. Create the reference error message.
95172cat >expout <<'_ATEOF'
951731.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"
95183at_fn_check_prepare_trace "calc.at:651"
95184( $at_check_trace; cat stderr
95185) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95186at_status=$? at_failed=false
95187$at_check_filter
95188at_fn_diff_devnull "$at_stderr" || at_failed=:
95189$at_diff expout "$at_stdout" || at_failed=:
95190at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
95191$at_failed && at_fn_log_failure
95192$at_traceon; }
95193
95194
95195cat >input <<'_ATEOF'
951961//2
95197_ATEOF
95198
95199{ set +x
95200$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95201at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95202( $at_check_trace;  $PREPARSER ./calc input
95203) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95204at_status=$? at_failed=false
95205$at_check_filter
95206echo stderr:; tee stderr <"$at_stderr"
95207at_fn_diff_devnull "$at_stdout" || at_failed=:
95208at_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"
95214at_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>&-
95217at_status=$? at_failed=false
95218$at_check_filter
95219echo stderr:; tee stderr <"$at_stderr"
95220at_fn_diff_devnull "$at_stdout" || at_failed=:
95221at_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.
95230sed '/^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
95245mv at-stderr stderr
95246# 2. Create the reference error message.
95247cat >expout <<'_ATEOF'
952481.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"
95258at_fn_check_prepare_trace "calc.at:651"
95259( $at_check_trace; cat stderr
95260) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95261at_status=$? at_failed=false
95262$at_check_filter
95263at_fn_diff_devnull "$at_stderr" || at_failed=:
95264$at_diff expout "$at_stdout" || at_failed=:
95265at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
95266$at_failed && at_fn_log_failure
95267$at_traceon; }
95268
95269
95270cat >input <<'_ATEOF'
95271error
95272_ATEOF
95273
95274{ set +x
95275$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95276at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95277( $at_check_trace;  $PREPARSER ./calc input
95278) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95279at_status=$? at_failed=false
95280$at_check_filter
95281echo stderr:; tee stderr <"$at_stderr"
95282at_fn_diff_devnull "$at_stdout" || at_failed=:
95283at_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"
95289at_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>&-
95292at_status=$? at_failed=false
95293$at_check_filter
95294echo stderr:; tee stderr <"$at_stderr"
95295at_fn_diff_devnull "$at_stdout" || at_failed=:
95296at_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.
95305sed '/^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
95320mv at-stderr stderr
95321# 2. Create the reference error message.
95322cat >expout <<'_ATEOF'
953231.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"
95333at_fn_check_prepare_trace "calc.at:651"
95334( $at_check_trace; cat stderr
95335) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95336at_status=$? at_failed=false
95337$at_check_filter
95338at_fn_diff_devnull "$at_stderr" || at_failed=:
95339$at_diff expout "$at_stdout" || at_failed=:
95340at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
95341$at_failed && at_fn_log_failure
95342$at_traceon; }
95343
95344
95345cat >input <<'_ATEOF'
953461 = 2 = 3
95347_ATEOF
95348
95349{ set +x
95350$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95351at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95352( $at_check_trace;  $PREPARSER ./calc input
95353) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95354at_status=$? at_failed=false
95355$at_check_filter
95356echo stderr:; tee stderr <"$at_stderr"
95357at_fn_diff_devnull "$at_stdout" || at_failed=:
95358at_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"
95364at_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>&-
95367at_status=$? at_failed=false
95368$at_check_filter
95369echo stderr:; tee stderr <"$at_stderr"
95370at_fn_diff_devnull "$at_stdout" || at_failed=:
95371at_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.
95380sed '/^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
95395mv at-stderr stderr
95396# 2. Create the reference error message.
95397cat >expout <<'_ATEOF'
953981.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"
95408at_fn_check_prepare_trace "calc.at:651"
95409( $at_check_trace; cat stderr
95410) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95411at_status=$? at_failed=false
95412$at_check_filter
95413at_fn_diff_devnull "$at_stderr" || at_failed=:
95414$at_diff expout "$at_stdout" || at_failed=:
95415at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
95416$at_failed && at_fn_log_failure
95417$at_traceon; }
95418
95419
95420cat >input <<'_ATEOF'
95421
95422+1
95423_ATEOF
95424
95425{ set +x
95426$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95427at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95428( $at_check_trace;  $PREPARSER ./calc input
95429) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95430at_status=$? at_failed=false
95431$at_check_filter
95432echo stderr:; tee stderr <"$at_stderr"
95433at_fn_diff_devnull "$at_stdout" || at_failed=:
95434at_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"
95440at_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>&-
95443at_status=$? at_failed=false
95444$at_check_filter
95445echo stderr:; tee stderr <"$at_stderr"
95446at_fn_diff_devnull "$at_stdout" || at_failed=:
95447at_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.
95456sed '/^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
95471mv at-stderr stderr
95472# 2. Create the reference error message.
95473cat >expout <<'_ATEOF'
954742.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"
95484at_fn_check_prepare_trace "calc.at:651"
95485( $at_check_trace; cat stderr
95486) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95487at_status=$? at_failed=false
95488$at_check_filter
95489at_fn_diff_devnull "$at_stderr" || at_failed=:
95490$at_diff expout "$at_stdout" || at_failed=:
95491at_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"
95499at_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>&-
95502at_status=$? at_failed=false
95503$at_check_filter
95504echo stderr:; tee stderr <"$at_stderr"
95505at_fn_diff_devnull "$at_stdout" || at_failed=:
95506at_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"
95512at_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>&-
95515at_status=$? at_failed=false
95516$at_check_filter
95517echo stderr:; tee stderr <"$at_stderr"
95518at_fn_diff_devnull "$at_stdout" || at_failed=:
95519at_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.
95528sed '/^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
95543mv at-stderr stderr
95544# 2. Create the reference error message.
95545cat >expout <<'_ATEOF'
955461.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"
95556at_fn_check_prepare_trace "calc.at:651"
95557( $at_check_trace; cat stderr
95558) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95559at_status=$? at_failed=false
95560$at_check_filter
95561at_fn_diff_devnull "$at_stderr" || at_failed=:
95562$at_diff expout "$at_stdout" || at_failed=:
95563at_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#
95585cat >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"
95591at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95592( $at_check_trace;  $PREPARSER ./calc input
95593) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95594at_status=$? at_failed=false
95595$at_check_filter
95596echo stderr:; tee stderr <"$at_stderr"
95597at_fn_diff_devnull "$at_stdout" || at_failed=:
95598at_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"
95604at_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>&-
95607at_status=$? at_failed=false
95608$at_check_filter
95609echo stderr:; tee stderr <"$at_stderr"
95610at_fn_diff_devnull "$at_stdout" || at_failed=:
95611at_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.
95620sed '/^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
95635mv at-stderr stderr
95636# 2. Create the reference error message.
95637cat >expout <<'_ATEOF'
956381.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
956391.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
956401.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
956411.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
95642calc: 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"
95652at_fn_check_prepare_trace "calc.at:651"
95653( $at_check_trace; cat stderr
95654) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95655at_status=$? at_failed=false
95656$at_check_filter
95657at_fn_diff_devnull "$at_stderr" || at_failed=:
95658$at_diff expout "$at_stdout" || at_failed=:
95659at_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.
95667cat >input <<'_ATEOF'
95668(!) + (1 2) = 1
95669_ATEOF
95670
95671{ set +x
95672$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95673at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95674( $at_check_trace;  $PREPARSER ./calc input
95675) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95676at_status=$? at_failed=false
95677$at_check_filter
95678echo stderr:; tee stderr <"$at_stderr"
95679at_fn_diff_devnull "$at_stdout" || at_failed=:
95680at_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"
95686at_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>&-
95689at_status=$? at_failed=false
95690$at_check_filter
95691echo stderr:; tee stderr <"$at_stderr"
95692at_fn_diff_devnull "$at_stdout" || at_failed=:
95693at_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.
95702sed '/^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
95717mv at-stderr stderr
95718# 2. Create the reference error message.
95719cat >expout <<'_ATEOF'
957201.10: syntax error, unexpected number
95721calc: 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"
95731at_fn_check_prepare_trace "calc.at:651"
95732( $at_check_trace; cat stderr
95733) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95734at_status=$? at_failed=false
95735$at_check_filter
95736at_fn_diff_devnull "$at_stderr" || at_failed=:
95737$at_diff expout "$at_stdout" || at_failed=:
95738at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
95739$at_failed && at_fn_log_failure
95740$at_traceon; }
95741
95742
95743cat >input <<'_ATEOF'
95744(- *) + (1 2) = 1
95745_ATEOF
95746
95747{ set +x
95748$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95749at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95750( $at_check_trace;  $PREPARSER ./calc input
95751) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95752at_status=$? at_failed=false
95753$at_check_filter
95754echo stderr:; tee stderr <"$at_stderr"
95755at_fn_diff_devnull "$at_stdout" || at_failed=:
95756at_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"
95762at_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>&-
95765at_status=$? at_failed=false
95766$at_check_filter
95767echo stderr:; tee stderr <"$at_stderr"
95768at_fn_diff_devnull "$at_stdout" || at_failed=:
95769at_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.
95778sed '/^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
95793mv at-stderr stderr
95794# 2. Create the reference error message.
95795cat >expout <<'_ATEOF'
957961.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
957971.12: syntax error, unexpected number
95798calc: 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"
95808at_fn_check_prepare_trace "calc.at:651"
95809( $at_check_trace; cat stderr
95810) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95811at_status=$? at_failed=false
95812$at_check_filter
95813at_fn_diff_devnull "$at_stderr" || at_failed=:
95814$at_diff expout "$at_stdout" || at_failed=:
95815at_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.
95823cat >input <<'_ATEOF'
95824(* *) + (*) + (*)
95825_ATEOF
95826
95827{ set +x
95828$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
95829at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
95830( $at_check_trace;  $PREPARSER ./calc input
95831) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95832at_status=$? at_failed=false
95833$at_check_filter
95834echo stderr:; tee stderr <"$at_stderr"
95835at_fn_diff_devnull "$at_stdout" || at_failed=:
95836at_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"
95842at_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>&-
95845at_status=$? at_failed=false
95846$at_check_filter
95847echo stderr:; tee stderr <"$at_stderr"
95848at_fn_diff_devnull "$at_stdout" || at_failed=:
95849at_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.
95858sed '/^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
95873mv at-stderr stderr
95874# 2. Create the reference error message.
95875cat >expout <<'_ATEOF'
958761.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
958771.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
958781.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"
95888at_fn_check_prepare_trace "calc.at:651"
95889( $at_check_trace; cat stderr
95890) >>"$at_stdout" 2>>"$at_stderr" 5>&-
95891at_status=$? at_failed=false
95892$at_check_filter
95893at_fn_diff_devnull "$at_stderr" || at_failed=:
95894$at_diff expout "$at_stdout" || at_failed=:
95895at_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
95906read at_status <"$at_status_file"
95907#AT_STOP_228
95908#AT_START_229
95909at_fn_group_banner 229 'calc.at:653' \
95910  "Calculator %glr-parser %debug" "                  " 12
95911at_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
95925cat >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
95966FILE *input;
95967static int power (int base, int exponent);
95968
95969static void yyerror ( const char *msg);
95970int 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%%
95988input:
95989  line
95990| input line         {  }
95991;
95992
95993line:
95994  '\n'
95995| exp '\n'           { USE ($1); }
95996;
95997
95998exp:
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
96019static int
96020power (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.  */
96032static
96033void yyerror ( const char *msg)
96034{
96035  fprintf (stderr, "%s\n", msg);
96036}
96037#include <ctype.h>
96038
96039int yylex (void);
96040static int get_char (void);
96041static void unget_char ( int c);
96042
96043
96044static int
96045get_char (void)
96046{
96047  int res = getc (input);
96048  ;
96049
96050  return res;
96051}
96052
96053static void
96054unget_char ( int c)
96055{
96056  ;
96057
96058  ungetc (c, input);
96059}
96060
96061static int
96062read_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
96093int 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
96129semantic_value global_result = 0;
96130int global_count = 0;
96131
96132/* A C main function.  */
96133int
96134main (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
96173if 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"
96181at_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>&-
96185at_status=$? at_failed=false
96186$at_check_filter
96187echo stderr:; cat "$at_stderr"
96188echo stdout:; cat "$at_stdout"
96189at_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"
96195at_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>&-
96198at_status=$? at_failed=false
96199$at_check_filter
96200echo stderr:; cat "$at_stderr"
96201echo stdout:; cat "$at_stdout"
96202at_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"
96211at_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>&-
96216at_status=$? at_failed=false
96217$at_check_filter
96218at_fn_diff_devnull "$at_stderr" || at_failed=:
96219$at_diff expout "$at_stdout" || at_failed=:
96220at_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"
96229at_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>&-
96234at_status=$? at_failed=false
96235$at_check_filter
96236at_fn_diff_devnull "$at_stderr" || at_failed=:
96237$at_diff expout "$at_stdout" || at_failed=:
96238at_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
96244fi
96245{ set +x
96246$as_echo "$at_srcdir/calc.at:653: bison -o calc.c calc.y"
96247at_fn_check_prepare_trace "calc.at:653"
96248( $at_check_trace; bison -o calc.c calc.y
96249) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96250at_status=$? at_failed=false
96251$at_check_filter
96252at_fn_diff_devnull "$at_stderr" || at_failed=:
96253at_fn_diff_devnull "$at_stdout" || at_failed=:
96254at_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"
96261at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653"
96262( $at_check_trace; $BISON_C_WORKS
96263) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96264at_status=$? at_failed=false
96265$at_check_filter
96266echo stderr:; cat "$at_stderr"
96267echo stdout:; cat "$at_stdout"
96268at_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"
96274at_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>&-
96277at_status=$? at_failed=false
96278$at_check_filter
96279echo stderr:; cat "$at_stderr"
96280echo stdout:; cat "$at_stdout"
96281at_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"
96296at_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>&-
96307at_status=$? at_failed=false
96308$at_check_filter
96309at_fn_diff_devnull "$at_stderr" || at_failed=:
96310at_fn_diff_devnull "$at_stdout" || at_failed=:
96311at_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.
96318cat >input <<'_ATEOF'
963191 + 2 * 3 = 7
963201 + 2 * -3 = -5
96321
96322-1^2 = -1
96323(-1)^2 = 1
96324
96325---1 = -1
96326
963271 - 2 - 3 = -4
963281 - (2 - 3) = 2
96329
963302^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"
96336at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96337( $at_check_trace;  $PREPARSER ./calc input
96338) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96339at_status=$? at_failed=false
96340$at_check_filter
96341echo stderr:; tee stderr <"$at_stderr"
96342at_fn_diff_devnull "$at_stdout" || at_failed=:
96343at_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"
96349at_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>&-
96352at_status=$? at_failed=false
96353$at_check_filter
96354echo stderr:; tee stderr <"$at_stderr"
96355at_fn_diff_devnull "$at_stdout" || at_failed=:
96356at_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.
96364cat >input <<'_ATEOF'
963651 2
96366_ATEOF
96367
96368{ set +x
96369$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96370at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96371( $at_check_trace;  $PREPARSER ./calc input
96372) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96373at_status=$? at_failed=false
96374$at_check_filter
96375echo stderr:; tee stderr <"$at_stderr"
96376at_fn_diff_devnull "$at_stdout" || at_failed=:
96377at_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"
96383at_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>&-
96386at_status=$? at_failed=false
96387$at_check_filter
96388echo stderr:; tee stderr <"$at_stderr"
96389at_fn_diff_devnull "$at_stdout" || at_failed=:
96390at_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.
96399sed '/^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
96414mv at-stderr stderr
96415# 2. Create the reference error message.
96416cat >expout <<'_ATEOF'
964171.3: syntax error, unexpected number
96418_ATEOF
96419
96420# 3. If locations are not used, remove them.
96421sed 's/^[-0-9.]*: //' expout >at-expout
96422mv at-expout expout
96423# 4. If error-verbose is not used, strip the`, unexpected....' part.
96424sed 's/syntax error, .*$/syntax error/' expout >at-expout
96425mv at-expout expout
96426# 5. Check
96427{ set +x
96428$as_echo "$at_srcdir/calc.at:653: cat stderr"
96429at_fn_check_prepare_trace "calc.at:653"
96430( $at_check_trace; cat stderr
96431) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96432at_status=$? at_failed=false
96433$at_check_filter
96434at_fn_diff_devnull "$at_stderr" || at_failed=:
96435$at_diff expout "$at_stdout" || at_failed=:
96436at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
96437$at_failed && at_fn_log_failure
96438$at_traceon; }
96439
96440
96441cat >input <<'_ATEOF'
964421//2
96443_ATEOF
96444
96445{ set +x
96446$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96447at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96448( $at_check_trace;  $PREPARSER ./calc input
96449) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96450at_status=$? at_failed=false
96451$at_check_filter
96452echo stderr:; tee stderr <"$at_stderr"
96453at_fn_diff_devnull "$at_stdout" || at_failed=:
96454at_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"
96460at_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>&-
96463at_status=$? at_failed=false
96464$at_check_filter
96465echo stderr:; tee stderr <"$at_stderr"
96466at_fn_diff_devnull "$at_stdout" || at_failed=:
96467at_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.
96476sed '/^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
96491mv at-stderr stderr
96492# 2. Create the reference error message.
96493cat >expout <<'_ATEOF'
964941.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
96495_ATEOF
96496
96497# 3. If locations are not used, remove them.
96498sed 's/^[-0-9.]*: //' expout >at-expout
96499mv at-expout expout
96500# 4. If error-verbose is not used, strip the`, unexpected....' part.
96501sed 's/syntax error, .*$/syntax error/' expout >at-expout
96502mv at-expout expout
96503# 5. Check
96504{ set +x
96505$as_echo "$at_srcdir/calc.at:653: cat stderr"
96506at_fn_check_prepare_trace "calc.at:653"
96507( $at_check_trace; cat stderr
96508) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96509at_status=$? at_failed=false
96510$at_check_filter
96511at_fn_diff_devnull "$at_stderr" || at_failed=:
96512$at_diff expout "$at_stdout" || at_failed=:
96513at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
96514$at_failed && at_fn_log_failure
96515$at_traceon; }
96516
96517
96518cat >input <<'_ATEOF'
96519error
96520_ATEOF
96521
96522{ set +x
96523$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96524at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96525( $at_check_trace;  $PREPARSER ./calc input
96526) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96527at_status=$? at_failed=false
96528$at_check_filter
96529echo stderr:; tee stderr <"$at_stderr"
96530at_fn_diff_devnull "$at_stdout" || at_failed=:
96531at_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"
96537at_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>&-
96540at_status=$? at_failed=false
96541$at_check_filter
96542echo stderr:; tee stderr <"$at_stderr"
96543at_fn_diff_devnull "$at_stdout" || at_failed=:
96544at_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.
96553sed '/^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
96568mv at-stderr stderr
96569# 2. Create the reference error message.
96570cat >expout <<'_ATEOF'
965711.1: syntax error, unexpected $undefined
96572_ATEOF
96573
96574# 3. If locations are not used, remove them.
96575sed 's/^[-0-9.]*: //' expout >at-expout
96576mv at-expout expout
96577# 4. If error-verbose is not used, strip the`, unexpected....' part.
96578sed 's/syntax error, .*$/syntax error/' expout >at-expout
96579mv at-expout expout
96580# 5. Check
96581{ set +x
96582$as_echo "$at_srcdir/calc.at:653: cat stderr"
96583at_fn_check_prepare_trace "calc.at:653"
96584( $at_check_trace; cat stderr
96585) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96586at_status=$? at_failed=false
96587$at_check_filter
96588at_fn_diff_devnull "$at_stderr" || at_failed=:
96589$at_diff expout "$at_stdout" || at_failed=:
96590at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
96591$at_failed && at_fn_log_failure
96592$at_traceon; }
96593
96594
96595cat >input <<'_ATEOF'
965961 = 2 = 3
96597_ATEOF
96598
96599{ set +x
96600$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96601at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96602( $at_check_trace;  $PREPARSER ./calc input
96603) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96604at_status=$? at_failed=false
96605$at_check_filter
96606echo stderr:; tee stderr <"$at_stderr"
96607at_fn_diff_devnull "$at_stdout" || at_failed=:
96608at_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"
96614at_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>&-
96617at_status=$? at_failed=false
96618$at_check_filter
96619echo stderr:; tee stderr <"$at_stderr"
96620at_fn_diff_devnull "$at_stdout" || at_failed=:
96621at_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.
96630sed '/^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
96645mv at-stderr stderr
96646# 2. Create the reference error message.
96647cat >expout <<'_ATEOF'
966481.7: syntax error, unexpected '='
96649_ATEOF
96650
96651# 3. If locations are not used, remove them.
96652sed 's/^[-0-9.]*: //' expout >at-expout
96653mv at-expout expout
96654# 4. If error-verbose is not used, strip the`, unexpected....' part.
96655sed 's/syntax error, .*$/syntax error/' expout >at-expout
96656mv at-expout expout
96657# 5. Check
96658{ set +x
96659$as_echo "$at_srcdir/calc.at:653: cat stderr"
96660at_fn_check_prepare_trace "calc.at:653"
96661( $at_check_trace; cat stderr
96662) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96663at_status=$? at_failed=false
96664$at_check_filter
96665at_fn_diff_devnull "$at_stderr" || at_failed=:
96666$at_diff expout "$at_stdout" || at_failed=:
96667at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
96668$at_failed && at_fn_log_failure
96669$at_traceon; }
96670
96671
96672cat >input <<'_ATEOF'
96673
96674+1
96675_ATEOF
96676
96677{ set +x
96678$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96679at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96680( $at_check_trace;  $PREPARSER ./calc input
96681) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96682at_status=$? at_failed=false
96683$at_check_filter
96684echo stderr:; tee stderr <"$at_stderr"
96685at_fn_diff_devnull "$at_stdout" || at_failed=:
96686at_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"
96692at_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>&-
96695at_status=$? at_failed=false
96696$at_check_filter
96697echo stderr:; tee stderr <"$at_stderr"
96698at_fn_diff_devnull "$at_stdout" || at_failed=:
96699at_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.
96708sed '/^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
96723mv at-stderr stderr
96724# 2. Create the reference error message.
96725cat >expout <<'_ATEOF'
967262.1: syntax error, unexpected '+'
96727_ATEOF
96728
96729# 3. If locations are not used, remove them.
96730sed 's/^[-0-9.]*: //' expout >at-expout
96731mv at-expout expout
96732# 4. If error-verbose is not used, strip the`, unexpected....' part.
96733sed 's/syntax error, .*$/syntax error/' expout >at-expout
96734mv at-expout expout
96735# 5. Check
96736{ set +x
96737$as_echo "$at_srcdir/calc.at:653: cat stderr"
96738at_fn_check_prepare_trace "calc.at:653"
96739( $at_check_trace; cat stderr
96740) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96741at_status=$? at_failed=false
96742$at_check_filter
96743at_fn_diff_devnull "$at_stderr" || at_failed=:
96744$at_diff expout "$at_stdout" || at_failed=:
96745at_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"
96753at_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>&-
96756at_status=$? at_failed=false
96757$at_check_filter
96758echo stderr:; tee stderr <"$at_stderr"
96759at_fn_diff_devnull "$at_stdout" || at_failed=:
96760at_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"
96766at_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>&-
96769at_status=$? at_failed=false
96770$at_check_filter
96771echo stderr:; tee stderr <"$at_stderr"
96772at_fn_diff_devnull "$at_stdout" || at_failed=:
96773at_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.
96782sed '/^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
96797mv at-stderr stderr
96798# 2. Create the reference error message.
96799cat >expout <<'_ATEOF'
968001.1: syntax error, unexpected end of input
96801_ATEOF
96802
96803# 3. If locations are not used, remove them.
96804sed 's/^[-0-9.]*: //' expout >at-expout
96805mv at-expout expout
96806# 4. If error-verbose is not used, strip the`, unexpected....' part.
96807sed 's/syntax error, .*$/syntax error/' expout >at-expout
96808mv at-expout expout
96809# 5. Check
96810{ set +x
96811$as_echo "$at_srcdir/calc.at:653: cat stderr"
96812at_fn_check_prepare_trace "calc.at:653"
96813( $at_check_trace; cat stderr
96814) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96815at_status=$? at_failed=false
96816$at_check_filter
96817at_fn_diff_devnull "$at_stderr" || at_failed=:
96818$at_diff expout "$at_stdout" || at_failed=:
96819at_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#
96841cat >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"
96847at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96848( $at_check_trace;  $PREPARSER ./calc input
96849) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96850at_status=$? at_failed=false
96851$at_check_filter
96852echo stderr:; tee stderr <"$at_stderr"
96853at_fn_diff_devnull "$at_stdout" || at_failed=:
96854at_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"
96860at_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>&-
96863at_status=$? at_failed=false
96864$at_check_filter
96865echo stderr:; tee stderr <"$at_stderr"
96866at_fn_diff_devnull "$at_stdout" || at_failed=:
96867at_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.
96876sed '/^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
96891mv at-stderr stderr
96892# 2. Create the reference error message.
96893cat >expout <<'_ATEOF'
968941.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
968951.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
968961.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
968971.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
96898calc: error: 4444 != 1
96899_ATEOF
96900
96901# 3. If locations are not used, remove them.
96902sed 's/^[-0-9.]*: //' expout >at-expout
96903mv at-expout expout
96904# 4. If error-verbose is not used, strip the`, unexpected....' part.
96905sed 's/syntax error, .*$/syntax error/' expout >at-expout
96906mv at-expout expout
96907# 5. Check
96908{ set +x
96909$as_echo "$at_srcdir/calc.at:653: cat stderr"
96910at_fn_check_prepare_trace "calc.at:653"
96911( $at_check_trace; cat stderr
96912) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96913at_status=$? at_failed=false
96914$at_check_filter
96915at_fn_diff_devnull "$at_stderr" || at_failed=:
96916$at_diff expout "$at_stdout" || at_failed=:
96917at_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.
96925cat >input <<'_ATEOF'
96926(!) + (1 2) = 1
96927_ATEOF
96928
96929{ set +x
96930$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
96931at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
96932( $at_check_trace;  $PREPARSER ./calc input
96933) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96934at_status=$? at_failed=false
96935$at_check_filter
96936echo stderr:; tee stderr <"$at_stderr"
96937at_fn_diff_devnull "$at_stdout" || at_failed=:
96938at_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"
96944at_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>&-
96947at_status=$? at_failed=false
96948$at_check_filter
96949echo stderr:; tee stderr <"$at_stderr"
96950at_fn_diff_devnull "$at_stdout" || at_failed=:
96951at_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.
96960sed '/^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
96975mv at-stderr stderr
96976# 2. Create the reference error message.
96977cat >expout <<'_ATEOF'
969781.10: syntax error, unexpected number
96979calc: error: 2222 != 1
96980_ATEOF
96981
96982# 3. If locations are not used, remove them.
96983sed 's/^[-0-9.]*: //' expout >at-expout
96984mv at-expout expout
96985# 4. If error-verbose is not used, strip the`, unexpected....' part.
96986sed 's/syntax error, .*$/syntax error/' expout >at-expout
96987mv at-expout expout
96988# 5. Check
96989{ set +x
96990$as_echo "$at_srcdir/calc.at:653: cat stderr"
96991at_fn_check_prepare_trace "calc.at:653"
96992( $at_check_trace; cat stderr
96993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
96994at_status=$? at_failed=false
96995$at_check_filter
96996at_fn_diff_devnull "$at_stderr" || at_failed=:
96997$at_diff expout "$at_stdout" || at_failed=:
96998at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
96999$at_failed && at_fn_log_failure
97000$at_traceon; }
97001
97002
97003cat >input <<'_ATEOF'
97004(- *) + (1 2) = 1
97005_ATEOF
97006
97007{ set +x
97008$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
97009at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
97010( $at_check_trace;  $PREPARSER ./calc input
97011) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97012at_status=$? at_failed=false
97013$at_check_filter
97014echo stderr:; tee stderr <"$at_stderr"
97015at_fn_diff_devnull "$at_stdout" || at_failed=:
97016at_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"
97022at_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>&-
97025at_status=$? at_failed=false
97026$at_check_filter
97027echo stderr:; tee stderr <"$at_stderr"
97028at_fn_diff_devnull "$at_stdout" || at_failed=:
97029at_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.
97038sed '/^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
97053mv at-stderr stderr
97054# 2. Create the reference error message.
97055cat >expout <<'_ATEOF'
970561.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
970571.12: syntax error, unexpected number
97058calc: error: 2222 != 1
97059_ATEOF
97060
97061# 3. If locations are not used, remove them.
97062sed 's/^[-0-9.]*: //' expout >at-expout
97063mv at-expout expout
97064# 4. If error-verbose is not used, strip the`, unexpected....' part.
97065sed 's/syntax error, .*$/syntax error/' expout >at-expout
97066mv at-expout expout
97067# 5. Check
97068{ set +x
97069$as_echo "$at_srcdir/calc.at:653: cat stderr"
97070at_fn_check_prepare_trace "calc.at:653"
97071( $at_check_trace; cat stderr
97072) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97073at_status=$? at_failed=false
97074$at_check_filter
97075at_fn_diff_devnull "$at_stderr" || at_failed=:
97076$at_diff expout "$at_stdout" || at_failed=:
97077at_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.
97085cat >input <<'_ATEOF'
97086(* *) + (*) + (*)
97087_ATEOF
97088
97089{ set +x
97090$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
97091at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
97092( $at_check_trace;  $PREPARSER ./calc input
97093) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97094at_status=$? at_failed=false
97095$at_check_filter
97096echo stderr:; tee stderr <"$at_stderr"
97097at_fn_diff_devnull "$at_stdout" || at_failed=:
97098at_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"
97104at_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>&-
97107at_status=$? at_failed=false
97108$at_check_filter
97109echo stderr:; tee stderr <"$at_stderr"
97110at_fn_diff_devnull "$at_stdout" || at_failed=:
97111at_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.
97120sed '/^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
97135mv at-stderr stderr
97136# 2. Create the reference error message.
97137cat >expout <<'_ATEOF'
971381.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
971391.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
971401.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
97141_ATEOF
97142
97143# 3. If locations are not used, remove them.
97144sed 's/^[-0-9.]*: //' expout >at-expout
97145mv at-expout expout
97146# 4. If error-verbose is not used, strip the`, unexpected....' part.
97147sed 's/syntax error, .*$/syntax error/' expout >at-expout
97148mv at-expout expout
97149# 5. Check
97150{ set +x
97151$as_echo "$at_srcdir/calc.at:653: cat stderr"
97152at_fn_check_prepare_trace "calc.at:653"
97153( $at_check_trace; cat stderr
97154) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97155at_status=$? at_failed=false
97156$at_check_filter
97157at_fn_diff_devnull "$at_stderr" || at_failed=:
97158$at_diff expout "$at_stdout" || at_failed=:
97159at_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
97170read at_status <"$at_status_file"
97171#AT_STOP_229
97172#AT_START_230
97173at_fn_group_banner 230 'calc.at:654' \
97174  "Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
97175at_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
97189cat >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
97230FILE *input;
97231static int power (int base, int exponent);
97232
97233static void calcerror ( const char *msg);
97234int 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%%
97252input:
97253  line
97254| input line         {  }
97255;
97256
97257line:
97258  '\n'
97259| exp '\n'           { USE ($1); }
97260;
97261
97262exp:
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
97283static int
97284power (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.  */
97296static
97297void 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
97307cat >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
97318int calclex (void);
97319static int get_char (void);
97320static void unget_char ( int c);
97321
97322
97323static YYLTYPE last_yylloc;
97324
97325static int
97326get_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
97343static void
97344unget_char ( int c)
97345{
97346  ;
97347
97348  /* Wrong when C == `\n'. */
97349  (calclloc) = last_yylloc;
97350
97351  ungetc (c, input);
97352}
97353
97354static int
97355read_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
97386int 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
97416cat >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
97435semantic_value global_result = 0;
97436int global_count = 0;
97437
97438/* A C main function.  */
97439int
97440main (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
97478if 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"
97486at_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>&-
97490at_status=$? at_failed=false
97491$at_check_filter
97492echo stderr:; cat "$at_stderr"
97493echo stdout:; cat "$at_stdout"
97494at_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"
97500at_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>&-
97503at_status=$? at_failed=false
97504$at_check_filter
97505echo stderr:; cat "$at_stderr"
97506echo stdout:; cat "$at_stdout"
97507at_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"
97516at_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>&-
97521at_status=$? at_failed=false
97522$at_check_filter
97523at_fn_diff_devnull "$at_stderr" || at_failed=:
97524$at_diff expout "$at_stdout" || at_failed=:
97525at_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"
97534at_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>&-
97539at_status=$? at_failed=false
97540$at_check_filter
97541at_fn_diff_devnull "$at_stderr" || at_failed=:
97542$at_diff expout "$at_stdout" || at_failed=:
97543at_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
97549fi
97550{ set +x
97551$as_echo "$at_srcdir/calc.at:654: bison -o calc.c calc.y"
97552at_fn_check_prepare_trace "calc.at:654"
97553( $at_check_trace; bison -o calc.c calc.y
97554) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97555at_status=$? at_failed=false
97556$at_check_filter
97557at_fn_diff_devnull "$at_stderr" || at_failed=:
97558at_fn_diff_devnull "$at_stdout" || at_failed=:
97559at_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"
97566at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654"
97567( $at_check_trace; $BISON_C_WORKS
97568) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97569at_status=$? at_failed=false
97570$at_check_filter
97571echo stderr:; cat "$at_stderr"
97572echo stdout:; cat "$at_stdout"
97573at_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"
97579at_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>&-
97582at_status=$? at_failed=false
97583$at_check_filter
97584echo stderr:; cat "$at_stderr"
97585echo stdout:; cat "$at_stdout"
97586at_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"
97601at_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>&-
97612at_status=$? at_failed=false
97613$at_check_filter
97614at_fn_diff_devnull "$at_stderr" || at_failed=:
97615at_fn_diff_devnull "$at_stdout" || at_failed=:
97616at_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"
97630at_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>&-
97641at_status=$? at_failed=false
97642$at_check_filter
97643at_fn_diff_devnull "$at_stderr" || at_failed=:
97644at_fn_diff_devnull "$at_stdout" || at_failed=:
97645at_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.
97651cat >input <<'_ATEOF'
976521 + 2 * 3 = 7
976531 + 2 * -3 = -5
97654
97655-1^2 = -1
97656(-1)^2 = 1
97657
97658---1 = -1
97659
976601 - 2 - 3 = -4
976611 - (2 - 3) = 2
97662
976632^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"
97669at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
97670( $at_check_trace;  $PREPARSER ./calc input
97671) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97672at_status=$? at_failed=false
97673$at_check_filter
97674echo stderr:; tee stderr <"$at_stderr"
97675at_fn_diff_devnull "$at_stdout" || at_failed=:
97676at_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"
97682at_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>&-
97685at_status=$? at_failed=false
97686$at_check_filter
97687echo stderr:; tee stderr <"$at_stderr"
97688at_fn_diff_devnull "$at_stdout" || at_failed=:
97689at_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.
97697cat >input <<'_ATEOF'
976981 2
97699_ATEOF
97700
97701{ set +x
97702$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
97703at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
97704( $at_check_trace;  $PREPARSER ./calc input
97705) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97706at_status=$? at_failed=false
97707$at_check_filter
97708echo stderr:; tee stderr <"$at_stderr"
97709at_fn_diff_devnull "$at_stdout" || at_failed=:
97710at_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"
97716at_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>&-
97719at_status=$? at_failed=false
97720$at_check_filter
97721echo stderr:; tee stderr <"$at_stderr"
97722at_fn_diff_devnull "$at_stdout" || at_failed=:
97723at_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.
97732sed '/^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
97747mv at-stderr stderr
97748# 2. Create the reference error message.
97749cat >expout <<'_ATEOF'
977501.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"
97760at_fn_check_prepare_trace "calc.at:654"
97761( $at_check_trace; cat stderr
97762) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97763at_status=$? at_failed=false
97764$at_check_filter
97765at_fn_diff_devnull "$at_stderr" || at_failed=:
97766$at_diff expout "$at_stdout" || at_failed=:
97767at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
97768$at_failed && at_fn_log_failure
97769$at_traceon; }
97770
97771
97772cat >input <<'_ATEOF'
977731//2
97774_ATEOF
97775
97776{ set +x
97777$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
97778at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
97779( $at_check_trace;  $PREPARSER ./calc input
97780) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97781at_status=$? at_failed=false
97782$at_check_filter
97783echo stderr:; tee stderr <"$at_stderr"
97784at_fn_diff_devnull "$at_stdout" || at_failed=:
97785at_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"
97791at_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>&-
97794at_status=$? at_failed=false
97795$at_check_filter
97796echo stderr:; tee stderr <"$at_stderr"
97797at_fn_diff_devnull "$at_stdout" || at_failed=:
97798at_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.
97807sed '/^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
97822mv at-stderr stderr
97823# 2. Create the reference error message.
97824cat >expout <<'_ATEOF'
978251.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"
97835at_fn_check_prepare_trace "calc.at:654"
97836( $at_check_trace; cat stderr
97837) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97838at_status=$? at_failed=false
97839$at_check_filter
97840at_fn_diff_devnull "$at_stderr" || at_failed=:
97841$at_diff expout "$at_stdout" || at_failed=:
97842at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
97843$at_failed && at_fn_log_failure
97844$at_traceon; }
97845
97846
97847cat >input <<'_ATEOF'
97848error
97849_ATEOF
97850
97851{ set +x
97852$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
97853at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
97854( $at_check_trace;  $PREPARSER ./calc input
97855) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97856at_status=$? at_failed=false
97857$at_check_filter
97858echo stderr:; tee stderr <"$at_stderr"
97859at_fn_diff_devnull "$at_stdout" || at_failed=:
97860at_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"
97866at_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>&-
97869at_status=$? at_failed=false
97870$at_check_filter
97871echo stderr:; tee stderr <"$at_stderr"
97872at_fn_diff_devnull "$at_stdout" || at_failed=:
97873at_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.
97882sed '/^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
97897mv at-stderr stderr
97898# 2. Create the reference error message.
97899cat >expout <<'_ATEOF'
979001.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"
97910at_fn_check_prepare_trace "calc.at:654"
97911( $at_check_trace; cat stderr
97912) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97913at_status=$? at_failed=false
97914$at_check_filter
97915at_fn_diff_devnull "$at_stderr" || at_failed=:
97916$at_diff expout "$at_stdout" || at_failed=:
97917at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
97918$at_failed && at_fn_log_failure
97919$at_traceon; }
97920
97921
97922cat >input <<'_ATEOF'
979231 = 2 = 3
97924_ATEOF
97925
97926{ set +x
97927$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
97928at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
97929( $at_check_trace;  $PREPARSER ./calc input
97930) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97931at_status=$? at_failed=false
97932$at_check_filter
97933echo stderr:; tee stderr <"$at_stderr"
97934at_fn_diff_devnull "$at_stdout" || at_failed=:
97935at_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"
97941at_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>&-
97944at_status=$? at_failed=false
97945$at_check_filter
97946echo stderr:; tee stderr <"$at_stderr"
97947at_fn_diff_devnull "$at_stdout" || at_failed=:
97948at_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.
97957sed '/^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
97972mv at-stderr stderr
97973# 2. Create the reference error message.
97974cat >expout <<'_ATEOF'
979751.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"
97985at_fn_check_prepare_trace "calc.at:654"
97986( $at_check_trace; cat stderr
97987) >>"$at_stdout" 2>>"$at_stderr" 5>&-
97988at_status=$? at_failed=false
97989$at_check_filter
97990at_fn_diff_devnull "$at_stderr" || at_failed=:
97991$at_diff expout "$at_stdout" || at_failed=:
97992at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
97993$at_failed && at_fn_log_failure
97994$at_traceon; }
97995
97996
97997cat >input <<'_ATEOF'
97998
97999+1
98000_ATEOF
98001
98002{ set +x
98003$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
98004at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
98005( $at_check_trace;  $PREPARSER ./calc input
98006) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98007at_status=$? at_failed=false
98008$at_check_filter
98009echo stderr:; tee stderr <"$at_stderr"
98010at_fn_diff_devnull "$at_stdout" || at_failed=:
98011at_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"
98017at_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>&-
98020at_status=$? at_failed=false
98021$at_check_filter
98022echo stderr:; tee stderr <"$at_stderr"
98023at_fn_diff_devnull "$at_stdout" || at_failed=:
98024at_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.
98033sed '/^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
98048mv at-stderr stderr
98049# 2. Create the reference error message.
98050cat >expout <<'_ATEOF'
980512.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"
98061at_fn_check_prepare_trace "calc.at:654"
98062( $at_check_trace; cat stderr
98063) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98064at_status=$? at_failed=false
98065$at_check_filter
98066at_fn_diff_devnull "$at_stderr" || at_failed=:
98067$at_diff expout "$at_stdout" || at_failed=:
98068at_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"
98076at_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>&-
98079at_status=$? at_failed=false
98080$at_check_filter
98081echo stderr:; tee stderr <"$at_stderr"
98082at_fn_diff_devnull "$at_stdout" || at_failed=:
98083at_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"
98089at_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>&-
98092at_status=$? at_failed=false
98093$at_check_filter
98094echo stderr:; tee stderr <"$at_stderr"
98095at_fn_diff_devnull "$at_stdout" || at_failed=:
98096at_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.
98105sed '/^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
98120mv at-stderr stderr
98121# 2. Create the reference error message.
98122cat >expout <<'_ATEOF'
981231.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"
98133at_fn_check_prepare_trace "calc.at:654"
98134( $at_check_trace; cat stderr
98135) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98136at_status=$? at_failed=false
98137$at_check_filter
98138at_fn_diff_devnull "$at_stderr" || at_failed=:
98139$at_diff expout "$at_stdout" || at_failed=:
98140at_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#
98162cat >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"
98168at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
98169( $at_check_trace;  $PREPARSER ./calc input
98170) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98171at_status=$? at_failed=false
98172$at_check_filter
98173echo stderr:; tee stderr <"$at_stderr"
98174at_fn_diff_devnull "$at_stdout" || at_failed=:
98175at_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"
98181at_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>&-
98184at_status=$? at_failed=false
98185$at_check_filter
98186echo stderr:; tee stderr <"$at_stderr"
98187at_fn_diff_devnull "$at_stdout" || at_failed=:
98188at_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.
98197sed '/^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
98212mv at-stderr stderr
98213# 2. Create the reference error message.
98214cat >expout <<'_ATEOF'
982151.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
982161.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
982171.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
982181.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
98219calc: 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"
98229at_fn_check_prepare_trace "calc.at:654"
98230( $at_check_trace; cat stderr
98231) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98232at_status=$? at_failed=false
98233$at_check_filter
98234at_fn_diff_devnull "$at_stderr" || at_failed=:
98235$at_diff expout "$at_stdout" || at_failed=:
98236at_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.
98244cat >input <<'_ATEOF'
98245(!) + (1 2) = 1
98246_ATEOF
98247
98248{ set +x
98249$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
98250at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
98251( $at_check_trace;  $PREPARSER ./calc input
98252) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98253at_status=$? at_failed=false
98254$at_check_filter
98255echo stderr:; tee stderr <"$at_stderr"
98256at_fn_diff_devnull "$at_stdout" || at_failed=:
98257at_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"
98263at_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>&-
98266at_status=$? at_failed=false
98267$at_check_filter
98268echo stderr:; tee stderr <"$at_stderr"
98269at_fn_diff_devnull "$at_stdout" || at_failed=:
98270at_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.
98279sed '/^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
98294mv at-stderr stderr
98295# 2. Create the reference error message.
98296cat >expout <<'_ATEOF'
982971.10: syntax error, unexpected number
98298calc: 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"
98308at_fn_check_prepare_trace "calc.at:654"
98309( $at_check_trace; cat stderr
98310) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98311at_status=$? at_failed=false
98312$at_check_filter
98313at_fn_diff_devnull "$at_stderr" || at_failed=:
98314$at_diff expout "$at_stdout" || at_failed=:
98315at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
98316$at_failed && at_fn_log_failure
98317$at_traceon; }
98318
98319
98320cat >input <<'_ATEOF'
98321(- *) + (1 2) = 1
98322_ATEOF
98323
98324{ set +x
98325$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
98326at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
98327( $at_check_trace;  $PREPARSER ./calc input
98328) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98329at_status=$? at_failed=false
98330$at_check_filter
98331echo stderr:; tee stderr <"$at_stderr"
98332at_fn_diff_devnull "$at_stdout" || at_failed=:
98333at_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"
98339at_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>&-
98342at_status=$? at_failed=false
98343$at_check_filter
98344echo stderr:; tee stderr <"$at_stderr"
98345at_fn_diff_devnull "$at_stdout" || at_failed=:
98346at_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.
98355sed '/^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
98370mv at-stderr stderr
98371# 2. Create the reference error message.
98372cat >expout <<'_ATEOF'
983731.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
983741.12: syntax error, unexpected number
98375calc: 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"
98385at_fn_check_prepare_trace "calc.at:654"
98386( $at_check_trace; cat stderr
98387) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98388at_status=$? at_failed=false
98389$at_check_filter
98390at_fn_diff_devnull "$at_stderr" || at_failed=:
98391$at_diff expout "$at_stdout" || at_failed=:
98392at_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.
98400cat >input <<'_ATEOF'
98401(* *) + (*) + (*)
98402_ATEOF
98403
98404{ set +x
98405$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
98406at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
98407( $at_check_trace;  $PREPARSER ./calc input
98408) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98409at_status=$? at_failed=false
98410$at_check_filter
98411echo stderr:; tee stderr <"$at_stderr"
98412at_fn_diff_devnull "$at_stdout" || at_failed=:
98413at_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"
98419at_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>&-
98422at_status=$? at_failed=false
98423$at_check_filter
98424echo stderr:; tee stderr <"$at_stderr"
98425at_fn_diff_devnull "$at_stdout" || at_failed=:
98426at_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.
98435sed '/^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
98450mv at-stderr stderr
98451# 2. Create the reference error message.
98452cat >expout <<'_ATEOF'
984531.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
984541.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
984551.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"
98465at_fn_check_prepare_trace "calc.at:654"
98466( $at_check_trace; cat stderr
98467) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98468at_status=$? at_failed=false
98469$at_check_filter
98470at_fn_diff_devnull "$at_stderr" || at_failed=:
98471$at_diff expout "$at_stdout" || at_failed=:
98472at_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
98483read at_status <"$at_status_file"
98484#AT_STOP_230
98485#AT_START_231
98486at_fn_group_banner 231 'calc.at:655' \
98487  "Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 12
98488at_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
98502cat >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
98543FILE *input;
98544static int power (int base, int exponent);
98545
98546static void calcerror ( const char *msg);
98547int 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%%
98565input:
98566  line
98567| input line         {  }
98568;
98569
98570line:
98571  '\n'
98572| exp '\n'           { USE ($1); }
98573;
98574
98575exp:
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
98596static int
98597power (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.  */
98609static
98610void 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
98620cat >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
98631int calclex (void);
98632static int get_char (void);
98633static void unget_char ( int c);
98634
98635
98636static CALCLTYPE last_yylloc;
98637
98638static int
98639get_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
98656static void
98657unget_char ( int c)
98658{
98659  ;
98660
98661  /* Wrong when C == `\n'. */
98662  (calclloc) = last_yylloc;
98663
98664  ungetc (c, input);
98665}
98666
98667static int
98668read_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
98699int 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
98729cat >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
98748semantic_value global_result = 0;
98749int global_count = 0;
98750
98751/* A C main function.  */
98752int
98753main (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
98791if 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"
98799at_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>&-
98803at_status=$? at_failed=false
98804$at_check_filter
98805echo stderr:; cat "$at_stderr"
98806echo stdout:; cat "$at_stdout"
98807at_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"
98813at_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>&-
98816at_status=$? at_failed=false
98817$at_check_filter
98818echo stderr:; cat "$at_stderr"
98819echo stdout:; cat "$at_stdout"
98820at_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"
98829at_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>&-
98834at_status=$? at_failed=false
98835$at_check_filter
98836at_fn_diff_devnull "$at_stderr" || at_failed=:
98837$at_diff expout "$at_stdout" || at_failed=:
98838at_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"
98847at_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>&-
98852at_status=$? at_failed=false
98853$at_check_filter
98854at_fn_diff_devnull "$at_stderr" || at_failed=:
98855$at_diff expout "$at_stdout" || at_failed=:
98856at_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
98862fi
98863{ set +x
98864$as_echo "$at_srcdir/calc.at:655: bison -o calc.c calc.y"
98865at_fn_check_prepare_trace "calc.at:655"
98866( $at_check_trace; bison -o calc.c calc.y
98867) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98868at_status=$? at_failed=false
98869$at_check_filter
98870at_fn_diff_devnull "$at_stderr" || at_failed=:
98871at_fn_diff_devnull "$at_stdout" || at_failed=:
98872at_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"
98879at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:655"
98880( $at_check_trace; $BISON_C_WORKS
98881) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98882at_status=$? at_failed=false
98883$at_check_filter
98884echo stderr:; cat "$at_stderr"
98885echo stdout:; cat "$at_stdout"
98886at_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"
98892at_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>&-
98895at_status=$? at_failed=false
98896$at_check_filter
98897echo stderr:; cat "$at_stderr"
98898echo stdout:; cat "$at_stdout"
98899at_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"
98914at_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>&-
98925at_status=$? at_failed=false
98926$at_check_filter
98927at_fn_diff_devnull "$at_stderr" || at_failed=:
98928at_fn_diff_devnull "$at_stdout" || at_failed=:
98929at_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"
98943at_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>&-
98954at_status=$? at_failed=false
98955$at_check_filter
98956at_fn_diff_devnull "$at_stderr" || at_failed=:
98957at_fn_diff_devnull "$at_stdout" || at_failed=:
98958at_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.
98964cat >input <<'_ATEOF'
989651 + 2 * 3 = 7
989661 + 2 * -3 = -5
98967
98968-1^2 = -1
98969(-1)^2 = 1
98970
98971---1 = -1
98972
989731 - 2 - 3 = -4
989741 - (2 - 3) = 2
98975
989762^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"
98982at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
98983( $at_check_trace;  $PREPARSER ./calc input
98984) >>"$at_stdout" 2>>"$at_stderr" 5>&-
98985at_status=$? at_failed=false
98986$at_check_filter
98987echo stderr:; tee stderr <"$at_stderr"
98988at_fn_diff_devnull "$at_stdout" || at_failed=:
98989at_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"
98995at_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>&-
98998at_status=$? at_failed=false
98999$at_check_filter
99000echo stderr:; tee stderr <"$at_stderr"
99001at_fn_diff_devnull "$at_stdout" || at_failed=:
99002at_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.
99010cat >input <<'_ATEOF'
990111 2
99012_ATEOF
99013
99014{ set +x
99015$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99016at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99017( $at_check_trace;  $PREPARSER ./calc input
99018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99019at_status=$? at_failed=false
99020$at_check_filter
99021echo stderr:; tee stderr <"$at_stderr"
99022at_fn_diff_devnull "$at_stdout" || at_failed=:
99023at_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"
99029at_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>&-
99032at_status=$? at_failed=false
99033$at_check_filter
99034echo stderr:; tee stderr <"$at_stderr"
99035at_fn_diff_devnull "$at_stdout" || at_failed=:
99036at_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.
99045sed '/^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
99060mv at-stderr stderr
99061# 2. Create the reference error message.
99062cat >expout <<'_ATEOF'
990631.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"
99073at_fn_check_prepare_trace "calc.at:655"
99074( $at_check_trace; cat stderr
99075) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99076at_status=$? at_failed=false
99077$at_check_filter
99078at_fn_diff_devnull "$at_stderr" || at_failed=:
99079$at_diff expout "$at_stdout" || at_failed=:
99080at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
99081$at_failed && at_fn_log_failure
99082$at_traceon; }
99083
99084
99085cat >input <<'_ATEOF'
990861//2
99087_ATEOF
99088
99089{ set +x
99090$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99091at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99092( $at_check_trace;  $PREPARSER ./calc input
99093) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99094at_status=$? at_failed=false
99095$at_check_filter
99096echo stderr:; tee stderr <"$at_stderr"
99097at_fn_diff_devnull "$at_stdout" || at_failed=:
99098at_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"
99104at_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>&-
99107at_status=$? at_failed=false
99108$at_check_filter
99109echo stderr:; tee stderr <"$at_stderr"
99110at_fn_diff_devnull "$at_stdout" || at_failed=:
99111at_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.
99120sed '/^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
99135mv at-stderr stderr
99136# 2. Create the reference error message.
99137cat >expout <<'_ATEOF'
991381.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"
99148at_fn_check_prepare_trace "calc.at:655"
99149( $at_check_trace; cat stderr
99150) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99151at_status=$? at_failed=false
99152$at_check_filter
99153at_fn_diff_devnull "$at_stderr" || at_failed=:
99154$at_diff expout "$at_stdout" || at_failed=:
99155at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
99156$at_failed && at_fn_log_failure
99157$at_traceon; }
99158
99159
99160cat >input <<'_ATEOF'
99161error
99162_ATEOF
99163
99164{ set +x
99165$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99166at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99167( $at_check_trace;  $PREPARSER ./calc input
99168) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99169at_status=$? at_failed=false
99170$at_check_filter
99171echo stderr:; tee stderr <"$at_stderr"
99172at_fn_diff_devnull "$at_stdout" || at_failed=:
99173at_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"
99179at_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>&-
99182at_status=$? at_failed=false
99183$at_check_filter
99184echo stderr:; tee stderr <"$at_stderr"
99185at_fn_diff_devnull "$at_stdout" || at_failed=:
99186at_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.
99195sed '/^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
99210mv at-stderr stderr
99211# 2. Create the reference error message.
99212cat >expout <<'_ATEOF'
992131.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"
99223at_fn_check_prepare_trace "calc.at:655"
99224( $at_check_trace; cat stderr
99225) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99226at_status=$? at_failed=false
99227$at_check_filter
99228at_fn_diff_devnull "$at_stderr" || at_failed=:
99229$at_diff expout "$at_stdout" || at_failed=:
99230at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
99231$at_failed && at_fn_log_failure
99232$at_traceon; }
99233
99234
99235cat >input <<'_ATEOF'
992361 = 2 = 3
99237_ATEOF
99238
99239{ set +x
99240$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99241at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99242( $at_check_trace;  $PREPARSER ./calc input
99243) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99244at_status=$? at_failed=false
99245$at_check_filter
99246echo stderr:; tee stderr <"$at_stderr"
99247at_fn_diff_devnull "$at_stdout" || at_failed=:
99248at_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"
99254at_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>&-
99257at_status=$? at_failed=false
99258$at_check_filter
99259echo stderr:; tee stderr <"$at_stderr"
99260at_fn_diff_devnull "$at_stdout" || at_failed=:
99261at_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.
99270sed '/^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
99285mv at-stderr stderr
99286# 2. Create the reference error message.
99287cat >expout <<'_ATEOF'
992881.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"
99298at_fn_check_prepare_trace "calc.at:655"
99299( $at_check_trace; cat stderr
99300) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99301at_status=$? at_failed=false
99302$at_check_filter
99303at_fn_diff_devnull "$at_stderr" || at_failed=:
99304$at_diff expout "$at_stdout" || at_failed=:
99305at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
99306$at_failed && at_fn_log_failure
99307$at_traceon; }
99308
99309
99310cat >input <<'_ATEOF'
99311
99312+1
99313_ATEOF
99314
99315{ set +x
99316$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99317at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99318( $at_check_trace;  $PREPARSER ./calc input
99319) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99320at_status=$? at_failed=false
99321$at_check_filter
99322echo stderr:; tee stderr <"$at_stderr"
99323at_fn_diff_devnull "$at_stdout" || at_failed=:
99324at_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"
99330at_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>&-
99333at_status=$? at_failed=false
99334$at_check_filter
99335echo stderr:; tee stderr <"$at_stderr"
99336at_fn_diff_devnull "$at_stdout" || at_failed=:
99337at_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.
99346sed '/^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
99361mv at-stderr stderr
99362# 2. Create the reference error message.
99363cat >expout <<'_ATEOF'
993642.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"
99374at_fn_check_prepare_trace "calc.at:655"
99375( $at_check_trace; cat stderr
99376) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99377at_status=$? at_failed=false
99378$at_check_filter
99379at_fn_diff_devnull "$at_stderr" || at_failed=:
99380$at_diff expout "$at_stdout" || at_failed=:
99381at_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"
99389at_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>&-
99392at_status=$? at_failed=false
99393$at_check_filter
99394echo stderr:; tee stderr <"$at_stderr"
99395at_fn_diff_devnull "$at_stdout" || at_failed=:
99396at_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"
99402at_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>&-
99405at_status=$? at_failed=false
99406$at_check_filter
99407echo stderr:; tee stderr <"$at_stderr"
99408at_fn_diff_devnull "$at_stdout" || at_failed=:
99409at_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.
99418sed '/^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
99433mv at-stderr stderr
99434# 2. Create the reference error message.
99435cat >expout <<'_ATEOF'
994361.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"
99446at_fn_check_prepare_trace "calc.at:655"
99447( $at_check_trace; cat stderr
99448) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99449at_status=$? at_failed=false
99450$at_check_filter
99451at_fn_diff_devnull "$at_stderr" || at_failed=:
99452$at_diff expout "$at_stdout" || at_failed=:
99453at_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#
99475cat >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"
99481at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99482( $at_check_trace;  $PREPARSER ./calc input
99483) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99484at_status=$? at_failed=false
99485$at_check_filter
99486echo stderr:; tee stderr <"$at_stderr"
99487at_fn_diff_devnull "$at_stdout" || at_failed=:
99488at_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"
99494at_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>&-
99497at_status=$? at_failed=false
99498$at_check_filter
99499echo stderr:; tee stderr <"$at_stderr"
99500at_fn_diff_devnull "$at_stdout" || at_failed=:
99501at_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.
99510sed '/^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
99525mv at-stderr stderr
99526# 2. Create the reference error message.
99527cat >expout <<'_ATEOF'
995281.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
995291.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
995301.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
995311.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
99532calc: 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"
99542at_fn_check_prepare_trace "calc.at:655"
99543( $at_check_trace; cat stderr
99544) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99545at_status=$? at_failed=false
99546$at_check_filter
99547at_fn_diff_devnull "$at_stderr" || at_failed=:
99548$at_diff expout "$at_stdout" || at_failed=:
99549at_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.
99557cat >input <<'_ATEOF'
99558(!) + (1 2) = 1
99559_ATEOF
99560
99561{ set +x
99562$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99563at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99564( $at_check_trace;  $PREPARSER ./calc input
99565) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99566at_status=$? at_failed=false
99567$at_check_filter
99568echo stderr:; tee stderr <"$at_stderr"
99569at_fn_diff_devnull "$at_stdout" || at_failed=:
99570at_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"
99576at_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>&-
99579at_status=$? at_failed=false
99580$at_check_filter
99581echo stderr:; tee stderr <"$at_stderr"
99582at_fn_diff_devnull "$at_stdout" || at_failed=:
99583at_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.
99592sed '/^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
99607mv at-stderr stderr
99608# 2. Create the reference error message.
99609cat >expout <<'_ATEOF'
996101.10: syntax error, unexpected number
99611calc: 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"
99621at_fn_check_prepare_trace "calc.at:655"
99622( $at_check_trace; cat stderr
99623) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99624at_status=$? at_failed=false
99625$at_check_filter
99626at_fn_diff_devnull "$at_stderr" || at_failed=:
99627$at_diff expout "$at_stdout" || at_failed=:
99628at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
99629$at_failed && at_fn_log_failure
99630$at_traceon; }
99631
99632
99633cat >input <<'_ATEOF'
99634(- *) + (1 2) = 1
99635_ATEOF
99636
99637{ set +x
99638$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99639at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99640( $at_check_trace;  $PREPARSER ./calc input
99641) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99642at_status=$? at_failed=false
99643$at_check_filter
99644echo stderr:; tee stderr <"$at_stderr"
99645at_fn_diff_devnull "$at_stdout" || at_failed=:
99646at_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"
99652at_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>&-
99655at_status=$? at_failed=false
99656$at_check_filter
99657echo stderr:; tee stderr <"$at_stderr"
99658at_fn_diff_devnull "$at_stdout" || at_failed=:
99659at_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.
99668sed '/^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
99683mv at-stderr stderr
99684# 2. Create the reference error message.
99685cat >expout <<'_ATEOF'
996861.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
996871.12: syntax error, unexpected number
99688calc: 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"
99698at_fn_check_prepare_trace "calc.at:655"
99699( $at_check_trace; cat stderr
99700) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99701at_status=$? at_failed=false
99702$at_check_filter
99703at_fn_diff_devnull "$at_stderr" || at_failed=:
99704$at_diff expout "$at_stdout" || at_failed=:
99705at_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.
99713cat >input <<'_ATEOF'
99714(* *) + (*) + (*)
99715_ATEOF
99716
99717{ set +x
99718$as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
99719at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
99720( $at_check_trace;  $PREPARSER ./calc input
99721) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99722at_status=$? at_failed=false
99723$at_check_filter
99724echo stderr:; tee stderr <"$at_stderr"
99725at_fn_diff_devnull "$at_stdout" || at_failed=:
99726at_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"
99732at_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>&-
99735at_status=$? at_failed=false
99736$at_check_filter
99737echo stderr:; tee stderr <"$at_stderr"
99738at_fn_diff_devnull "$at_stdout" || at_failed=:
99739at_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.
99748sed '/^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
99763mv at-stderr stderr
99764# 2. Create the reference error message.
99765cat >expout <<'_ATEOF'
997661.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
997671.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
997681.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"
99778at_fn_check_prepare_trace "calc.at:655"
99779( $at_check_trace; cat stderr
99780) >>"$at_stdout" 2>>"$at_stderr" 5>&-
99781at_status=$? at_failed=false
99782$at_check_filter
99783at_fn_diff_devnull "$at_stderr" || at_failed=:
99784$at_diff expout "$at_stdout" || at_failed=:
99785at_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
99796read at_status <"$at_status_file"
99797#AT_STOP_231
99798#AT_START_232
99799at_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
99801at_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
99815cat >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
99856FILE *input;
99857static int power (int base, int exponent);
99858
99859static void calcerror (YYLTYPE const * const llocp,  const char *msg);
99860int 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%%
99878input:
99879  line
99880| input line         {  }
99881;
99882
99883line:
99884  '\n'
99885| exp '\n'           { USE ($1); }
99886;
99887
99888exp:
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
99909static int
99910power (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.  */
99922static
99923void 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
99933cat >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
99944int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
99945static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
99946static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
99947
99948
99949static YYLTYPE last_yylloc;
99950
99951static int
99952get_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
99969static void
99970unget_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
99980static int
99981read_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
100012int 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
100042cat >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
100061semantic_value global_result = 0;
100062int global_count = 0;
100063
100064/* A C main function.  */
100065int
100066main (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
100104if 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"
100112at_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>&-
100116at_status=$? at_failed=false
100117$at_check_filter
100118echo stderr:; cat "$at_stderr"
100119echo stdout:; cat "$at_stdout"
100120at_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"
100126at_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>&-
100129at_status=$? at_failed=false
100130$at_check_filter
100131echo stderr:; cat "$at_stderr"
100132echo stdout:; cat "$at_stdout"
100133at_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"
100142at_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>&-
100147at_status=$? at_failed=false
100148$at_check_filter
100149at_fn_diff_devnull "$at_stderr" || at_failed=:
100150$at_diff expout "$at_stdout" || at_failed=:
100151at_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"
100160at_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>&-
100165at_status=$? at_failed=false
100166$at_check_filter
100167at_fn_diff_devnull "$at_stderr" || at_failed=:
100168$at_diff expout "$at_stdout" || at_failed=:
100169at_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
100175fi
100176{ set +x
100177$as_echo "$at_srcdir/calc.at:657: bison -o calc.c calc.y"
100178at_fn_check_prepare_trace "calc.at:657"
100179( $at_check_trace; bison -o calc.c calc.y
100180) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100181at_status=$? at_failed=false
100182$at_check_filter
100183at_fn_diff_devnull "$at_stderr" || at_failed=:
100184at_fn_diff_devnull "$at_stdout" || at_failed=:
100185at_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"
100192at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:657"
100193( $at_check_trace; $BISON_C_WORKS
100194) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100195at_status=$? at_failed=false
100196$at_check_filter
100197echo stderr:; cat "$at_stderr"
100198echo stdout:; cat "$at_stdout"
100199at_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"
100205at_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>&-
100208at_status=$? at_failed=false
100209$at_check_filter
100210echo stderr:; cat "$at_stderr"
100211echo stdout:; cat "$at_stdout"
100212at_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"
100227at_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>&-
100238at_status=$? at_failed=false
100239$at_check_filter
100240at_fn_diff_devnull "$at_stderr" || at_failed=:
100241at_fn_diff_devnull "$at_stdout" || at_failed=:
100242at_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"
100256at_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>&-
100267at_status=$? at_failed=false
100268$at_check_filter
100269at_fn_diff_devnull "$at_stderr" || at_failed=:
100270at_fn_diff_devnull "$at_stdout" || at_failed=:
100271at_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.
100277cat >input <<'_ATEOF'
1002781 + 2 * 3 = 7
1002791 + 2 * -3 = -5
100280
100281-1^2 = -1
100282(-1)^2 = 1
100283
100284---1 = -1
100285
1002861 - 2 - 3 = -4
1002871 - (2 - 3) = 2
100288
1002892^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"
100295at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100296( $at_check_trace;  $PREPARSER ./calc input
100297) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100298at_status=$? at_failed=false
100299$at_check_filter
100300echo stderr:; tee stderr <"$at_stderr"
100301at_fn_diff_devnull "$at_stdout" || at_failed=:
100302at_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"
100308at_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>&-
100311at_status=$? at_failed=false
100312$at_check_filter
100313echo stderr:; tee stderr <"$at_stderr"
100314at_fn_diff_devnull "$at_stdout" || at_failed=:
100315at_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.
100323cat >input <<'_ATEOF'
1003241 2
100325_ATEOF
100326
100327{ set +x
100328$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100329at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100330( $at_check_trace;  $PREPARSER ./calc input
100331) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100332at_status=$? at_failed=false
100333$at_check_filter
100334echo stderr:; tee stderr <"$at_stderr"
100335at_fn_diff_devnull "$at_stdout" || at_failed=:
100336at_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"
100342at_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>&-
100345at_status=$? at_failed=false
100346$at_check_filter
100347echo stderr:; tee stderr <"$at_stderr"
100348at_fn_diff_devnull "$at_stdout" || at_failed=:
100349at_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.
100358sed '/^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
100373mv at-stderr stderr
100374# 2. Create the reference error message.
100375cat >expout <<'_ATEOF'
1003761.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"
100386at_fn_check_prepare_trace "calc.at:657"
100387( $at_check_trace; cat stderr
100388) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100389at_status=$? at_failed=false
100390$at_check_filter
100391at_fn_diff_devnull "$at_stderr" || at_failed=:
100392$at_diff expout "$at_stdout" || at_failed=:
100393at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
100394$at_failed && at_fn_log_failure
100395$at_traceon; }
100396
100397
100398cat >input <<'_ATEOF'
1003991//2
100400_ATEOF
100401
100402{ set +x
100403$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100404at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100405( $at_check_trace;  $PREPARSER ./calc input
100406) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100407at_status=$? at_failed=false
100408$at_check_filter
100409echo stderr:; tee stderr <"$at_stderr"
100410at_fn_diff_devnull "$at_stdout" || at_failed=:
100411at_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"
100417at_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>&-
100420at_status=$? at_failed=false
100421$at_check_filter
100422echo stderr:; tee stderr <"$at_stderr"
100423at_fn_diff_devnull "$at_stdout" || at_failed=:
100424at_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.
100433sed '/^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
100448mv at-stderr stderr
100449# 2. Create the reference error message.
100450cat >expout <<'_ATEOF'
1004511.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"
100461at_fn_check_prepare_trace "calc.at:657"
100462( $at_check_trace; cat stderr
100463) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100464at_status=$? at_failed=false
100465$at_check_filter
100466at_fn_diff_devnull "$at_stderr" || at_failed=:
100467$at_diff expout "$at_stdout" || at_failed=:
100468at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
100469$at_failed && at_fn_log_failure
100470$at_traceon; }
100471
100472
100473cat >input <<'_ATEOF'
100474error
100475_ATEOF
100476
100477{ set +x
100478$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100479at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100480( $at_check_trace;  $PREPARSER ./calc input
100481) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100482at_status=$? at_failed=false
100483$at_check_filter
100484echo stderr:; tee stderr <"$at_stderr"
100485at_fn_diff_devnull "$at_stdout" || at_failed=:
100486at_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"
100492at_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>&-
100495at_status=$? at_failed=false
100496$at_check_filter
100497echo stderr:; tee stderr <"$at_stderr"
100498at_fn_diff_devnull "$at_stdout" || at_failed=:
100499at_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.
100508sed '/^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
100523mv at-stderr stderr
100524# 2. Create the reference error message.
100525cat >expout <<'_ATEOF'
1005261.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"
100536at_fn_check_prepare_trace "calc.at:657"
100537( $at_check_trace; cat stderr
100538) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100539at_status=$? at_failed=false
100540$at_check_filter
100541at_fn_diff_devnull "$at_stderr" || at_failed=:
100542$at_diff expout "$at_stdout" || at_failed=:
100543at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
100544$at_failed && at_fn_log_failure
100545$at_traceon; }
100546
100547
100548cat >input <<'_ATEOF'
1005491 = 2 = 3
100550_ATEOF
100551
100552{ set +x
100553$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100554at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100555( $at_check_trace;  $PREPARSER ./calc input
100556) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100557at_status=$? at_failed=false
100558$at_check_filter
100559echo stderr:; tee stderr <"$at_stderr"
100560at_fn_diff_devnull "$at_stdout" || at_failed=:
100561at_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"
100567at_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>&-
100570at_status=$? at_failed=false
100571$at_check_filter
100572echo stderr:; tee stderr <"$at_stderr"
100573at_fn_diff_devnull "$at_stdout" || at_failed=:
100574at_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.
100583sed '/^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
100598mv at-stderr stderr
100599# 2. Create the reference error message.
100600cat >expout <<'_ATEOF'
1006011.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"
100611at_fn_check_prepare_trace "calc.at:657"
100612( $at_check_trace; cat stderr
100613) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100614at_status=$? at_failed=false
100615$at_check_filter
100616at_fn_diff_devnull "$at_stderr" || at_failed=:
100617$at_diff expout "$at_stdout" || at_failed=:
100618at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
100619$at_failed && at_fn_log_failure
100620$at_traceon; }
100621
100622
100623cat >input <<'_ATEOF'
100624
100625+1
100626_ATEOF
100627
100628{ set +x
100629$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100630at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100631( $at_check_trace;  $PREPARSER ./calc input
100632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100633at_status=$? at_failed=false
100634$at_check_filter
100635echo stderr:; tee stderr <"$at_stderr"
100636at_fn_diff_devnull "$at_stdout" || at_failed=:
100637at_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"
100643at_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>&-
100646at_status=$? at_failed=false
100647$at_check_filter
100648echo stderr:; tee stderr <"$at_stderr"
100649at_fn_diff_devnull "$at_stdout" || at_failed=:
100650at_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.
100659sed '/^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
100674mv at-stderr stderr
100675# 2. Create the reference error message.
100676cat >expout <<'_ATEOF'
1006772.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"
100687at_fn_check_prepare_trace "calc.at:657"
100688( $at_check_trace; cat stderr
100689) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100690at_status=$? at_failed=false
100691$at_check_filter
100692at_fn_diff_devnull "$at_stderr" || at_failed=:
100693$at_diff expout "$at_stdout" || at_failed=:
100694at_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"
100702at_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>&-
100705at_status=$? at_failed=false
100706$at_check_filter
100707echo stderr:; tee stderr <"$at_stderr"
100708at_fn_diff_devnull "$at_stdout" || at_failed=:
100709at_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"
100715at_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>&-
100718at_status=$? at_failed=false
100719$at_check_filter
100720echo stderr:; tee stderr <"$at_stderr"
100721at_fn_diff_devnull "$at_stdout" || at_failed=:
100722at_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.
100731sed '/^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
100746mv at-stderr stderr
100747# 2. Create the reference error message.
100748cat >expout <<'_ATEOF'
1007491.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"
100759at_fn_check_prepare_trace "calc.at:657"
100760( $at_check_trace; cat stderr
100761) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100762at_status=$? at_failed=false
100763$at_check_filter
100764at_fn_diff_devnull "$at_stderr" || at_failed=:
100765$at_diff expout "$at_stdout" || at_failed=:
100766at_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#
100788cat >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"
100794at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100795( $at_check_trace;  $PREPARSER ./calc input
100796) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100797at_status=$? at_failed=false
100798$at_check_filter
100799echo stderr:; tee stderr <"$at_stderr"
100800at_fn_diff_devnull "$at_stdout" || at_failed=:
100801at_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"
100807at_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>&-
100810at_status=$? at_failed=false
100811$at_check_filter
100812echo stderr:; tee stderr <"$at_stderr"
100813at_fn_diff_devnull "$at_stdout" || at_failed=:
100814at_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.
100823sed '/^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
100838mv at-stderr stderr
100839# 2. Create the reference error message.
100840cat >expout <<'_ATEOF'
1008411.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1008421.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1008431.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1008441.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
100845calc: 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"
100855at_fn_check_prepare_trace "calc.at:657"
100856( $at_check_trace; cat stderr
100857) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100858at_status=$? at_failed=false
100859$at_check_filter
100860at_fn_diff_devnull "$at_stderr" || at_failed=:
100861$at_diff expout "$at_stdout" || at_failed=:
100862at_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.
100870cat >input <<'_ATEOF'
100871(!) + (1 2) = 1
100872_ATEOF
100873
100874{ set +x
100875$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100876at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100877( $at_check_trace;  $PREPARSER ./calc input
100878) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100879at_status=$? at_failed=false
100880$at_check_filter
100881echo stderr:; tee stderr <"$at_stderr"
100882at_fn_diff_devnull "$at_stdout" || at_failed=:
100883at_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"
100889at_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>&-
100892at_status=$? at_failed=false
100893$at_check_filter
100894echo stderr:; tee stderr <"$at_stderr"
100895at_fn_diff_devnull "$at_stdout" || at_failed=:
100896at_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.
100905sed '/^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
100920mv at-stderr stderr
100921# 2. Create the reference error message.
100922cat >expout <<'_ATEOF'
1009231.10: syntax error, unexpected number
100924calc: 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"
100934at_fn_check_prepare_trace "calc.at:657"
100935( $at_check_trace; cat stderr
100936) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100937at_status=$? at_failed=false
100938$at_check_filter
100939at_fn_diff_devnull "$at_stderr" || at_failed=:
100940$at_diff expout "$at_stdout" || at_failed=:
100941at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
100942$at_failed && at_fn_log_failure
100943$at_traceon; }
100944
100945
100946cat >input <<'_ATEOF'
100947(- *) + (1 2) = 1
100948_ATEOF
100949
100950{ set +x
100951$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
100952at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
100953( $at_check_trace;  $PREPARSER ./calc input
100954) >>"$at_stdout" 2>>"$at_stderr" 5>&-
100955at_status=$? at_failed=false
100956$at_check_filter
100957echo stderr:; tee stderr <"$at_stderr"
100958at_fn_diff_devnull "$at_stdout" || at_failed=:
100959at_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"
100965at_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>&-
100968at_status=$? at_failed=false
100969$at_check_filter
100970echo stderr:; tee stderr <"$at_stderr"
100971at_fn_diff_devnull "$at_stdout" || at_failed=:
100972at_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.
100981sed '/^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
100996mv at-stderr stderr
100997# 2. Create the reference error message.
100998cat >expout <<'_ATEOF'
1009991.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1010001.12: syntax error, unexpected number
101001calc: 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"
101011at_fn_check_prepare_trace "calc.at:657"
101012( $at_check_trace; cat stderr
101013) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101014at_status=$? at_failed=false
101015$at_check_filter
101016at_fn_diff_devnull "$at_stderr" || at_failed=:
101017$at_diff expout "$at_stdout" || at_failed=:
101018at_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.
101026cat >input <<'_ATEOF'
101027(* *) + (*) + (*)
101028_ATEOF
101029
101030{ set +x
101031$as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
101032at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
101033( $at_check_trace;  $PREPARSER ./calc input
101034) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101035at_status=$? at_failed=false
101036$at_check_filter
101037echo stderr:; tee stderr <"$at_stderr"
101038at_fn_diff_devnull "$at_stdout" || at_failed=:
101039at_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"
101045at_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>&-
101048at_status=$? at_failed=false
101049$at_check_filter
101050echo stderr:; tee stderr <"$at_stderr"
101051at_fn_diff_devnull "$at_stdout" || at_failed=:
101052at_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.
101061sed '/^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
101076mv at-stderr stderr
101077# 2. Create the reference error message.
101078cat >expout <<'_ATEOF'
1010791.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1010801.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1010811.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"
101091at_fn_check_prepare_trace "calc.at:657"
101092( $at_check_trace; cat stderr
101093) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101094at_status=$? at_failed=false
101095$at_check_filter
101096at_fn_diff_devnull "$at_stderr" || at_failed=:
101097$at_diff expout "$at_stdout" || at_failed=:
101098at_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
101109read at_status <"$at_status_file"
101110#AT_STOP_232
101111#AT_START_233
101112at_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
101114at_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
101128cat >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
101169FILE *input;
101170static int power (int base, int exponent);
101171
101172static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
101173int 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%%
101191input:
101192  line
101193| input line         { ++*count; ++global_count; }
101194;
101195
101196line:
101197  '\n'
101198| exp '\n'           { *result = global_result = $1; }
101199;
101200
101201exp:
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
101222static int
101223power (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.  */
101235static
101236void 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
101248cat >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
101259int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
101260static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
101261static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
101262
101263
101264static YYLTYPE last_yylloc;
101265
101266static int
101267get_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
101284static void
101285unget_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
101295static int
101296read_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
101327int 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
101357cat >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
101376semantic_value global_result = 0;
101377int global_count = 0;
101378
101379/* A C main function.  */
101380int
101381main (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
101419if 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"
101427at_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>&-
101431at_status=$? at_failed=false
101432$at_check_filter
101433echo stderr:; cat "$at_stderr"
101434echo stdout:; cat "$at_stdout"
101435at_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"
101441at_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>&-
101444at_status=$? at_failed=false
101445$at_check_filter
101446echo stderr:; cat "$at_stderr"
101447echo stdout:; cat "$at_stdout"
101448at_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"
101457at_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>&-
101462at_status=$? at_failed=false
101463$at_check_filter
101464at_fn_diff_devnull "$at_stderr" || at_failed=:
101465$at_diff expout "$at_stdout" || at_failed=:
101466at_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"
101475at_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>&-
101480at_status=$? at_failed=false
101481$at_check_filter
101482at_fn_diff_devnull "$at_stderr" || at_failed=:
101483$at_diff expout "$at_stdout" || at_failed=:
101484at_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
101490fi
101491{ set +x
101492$as_echo "$at_srcdir/calc.at:659: bison -o calc.c calc.y"
101493at_fn_check_prepare_trace "calc.at:659"
101494( $at_check_trace; bison -o calc.c calc.y
101495) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101496at_status=$? at_failed=false
101497$at_check_filter
101498at_fn_diff_devnull "$at_stderr" || at_failed=:
101499at_fn_diff_devnull "$at_stdout" || at_failed=:
101500at_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"
101507at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659"
101508( $at_check_trace; $BISON_C_WORKS
101509) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101510at_status=$? at_failed=false
101511$at_check_filter
101512echo stderr:; cat "$at_stderr"
101513echo stdout:; cat "$at_stdout"
101514at_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"
101520at_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>&-
101523at_status=$? at_failed=false
101524$at_check_filter
101525echo stderr:; cat "$at_stderr"
101526echo stdout:; cat "$at_stdout"
101527at_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"
101542at_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>&-
101553at_status=$? at_failed=false
101554$at_check_filter
101555at_fn_diff_devnull "$at_stderr" || at_failed=:
101556at_fn_diff_devnull "$at_stdout" || at_failed=:
101557at_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"
101571at_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>&-
101582at_status=$? at_failed=false
101583$at_check_filter
101584at_fn_diff_devnull "$at_stderr" || at_failed=:
101585at_fn_diff_devnull "$at_stdout" || at_failed=:
101586at_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.
101592cat >input <<'_ATEOF'
1015931 + 2 * 3 = 7
1015941 + 2 * -3 = -5
101595
101596-1^2 = -1
101597(-1)^2 = 1
101598
101599---1 = -1
101600
1016011 - 2 - 3 = -4
1016021 - (2 - 3) = 2
101603
1016042^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"
101610at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101611( $at_check_trace;  $PREPARSER ./calc input
101612) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101613at_status=$? at_failed=false
101614$at_check_filter
101615echo stderr:; tee stderr <"$at_stderr"
101616at_fn_diff_devnull "$at_stdout" || at_failed=:
101617at_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"
101623at_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>&-
101626at_status=$? at_failed=false
101627$at_check_filter
101628echo stderr:; tee stderr <"$at_stderr"
101629at_fn_diff_devnull "$at_stdout" || at_failed=:
101630at_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.
101638cat >input <<'_ATEOF'
1016391 2
101640_ATEOF
101641
101642{ set +x
101643$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
101644at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101645( $at_check_trace;  $PREPARSER ./calc input
101646) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101647at_status=$? at_failed=false
101648$at_check_filter
101649echo stderr:; tee stderr <"$at_stderr"
101650at_fn_diff_devnull "$at_stdout" || at_failed=:
101651at_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"
101657at_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>&-
101660at_status=$? at_failed=false
101661$at_check_filter
101662echo stderr:; tee stderr <"$at_stderr"
101663at_fn_diff_devnull "$at_stdout" || at_failed=:
101664at_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.
101673sed '/^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
101688mv at-stderr stderr
101689# 2. Create the reference error message.
101690cat >expout <<'_ATEOF'
1016911.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"
101701at_fn_check_prepare_trace "calc.at:659"
101702( $at_check_trace; cat stderr
101703) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101704at_status=$? at_failed=false
101705$at_check_filter
101706at_fn_diff_devnull "$at_stderr" || at_failed=:
101707$at_diff expout "$at_stdout" || at_failed=:
101708at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
101709$at_failed && at_fn_log_failure
101710$at_traceon; }
101711
101712
101713cat >input <<'_ATEOF'
1017141//2
101715_ATEOF
101716
101717{ set +x
101718$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
101719at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101720( $at_check_trace;  $PREPARSER ./calc input
101721) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101722at_status=$? at_failed=false
101723$at_check_filter
101724echo stderr:; tee stderr <"$at_stderr"
101725at_fn_diff_devnull "$at_stdout" || at_failed=:
101726at_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"
101732at_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>&-
101735at_status=$? at_failed=false
101736$at_check_filter
101737echo stderr:; tee stderr <"$at_stderr"
101738at_fn_diff_devnull "$at_stdout" || at_failed=:
101739at_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.
101748sed '/^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
101763mv at-stderr stderr
101764# 2. Create the reference error message.
101765cat >expout <<'_ATEOF'
1017661.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"
101776at_fn_check_prepare_trace "calc.at:659"
101777( $at_check_trace; cat stderr
101778) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101779at_status=$? at_failed=false
101780$at_check_filter
101781at_fn_diff_devnull "$at_stderr" || at_failed=:
101782$at_diff expout "$at_stdout" || at_failed=:
101783at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
101784$at_failed && at_fn_log_failure
101785$at_traceon; }
101786
101787
101788cat >input <<'_ATEOF'
101789error
101790_ATEOF
101791
101792{ set +x
101793$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
101794at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101795( $at_check_trace;  $PREPARSER ./calc input
101796) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101797at_status=$? at_failed=false
101798$at_check_filter
101799echo stderr:; tee stderr <"$at_stderr"
101800at_fn_diff_devnull "$at_stdout" || at_failed=:
101801at_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"
101807at_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>&-
101810at_status=$? at_failed=false
101811$at_check_filter
101812echo stderr:; tee stderr <"$at_stderr"
101813at_fn_diff_devnull "$at_stdout" || at_failed=:
101814at_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.
101823sed '/^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
101838mv at-stderr stderr
101839# 2. Create the reference error message.
101840cat >expout <<'_ATEOF'
1018411.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"
101851at_fn_check_prepare_trace "calc.at:659"
101852( $at_check_trace; cat stderr
101853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101854at_status=$? at_failed=false
101855$at_check_filter
101856at_fn_diff_devnull "$at_stderr" || at_failed=:
101857$at_diff expout "$at_stdout" || at_failed=:
101858at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
101859$at_failed && at_fn_log_failure
101860$at_traceon; }
101861
101862
101863cat >input <<'_ATEOF'
1018641 = 2 = 3
101865_ATEOF
101866
101867{ set +x
101868$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
101869at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101870( $at_check_trace;  $PREPARSER ./calc input
101871) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101872at_status=$? at_failed=false
101873$at_check_filter
101874echo stderr:; tee stderr <"$at_stderr"
101875at_fn_diff_devnull "$at_stdout" || at_failed=:
101876at_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"
101882at_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>&-
101885at_status=$? at_failed=false
101886$at_check_filter
101887echo stderr:; tee stderr <"$at_stderr"
101888at_fn_diff_devnull "$at_stdout" || at_failed=:
101889at_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.
101898sed '/^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
101913mv at-stderr stderr
101914# 2. Create the reference error message.
101915cat >expout <<'_ATEOF'
1019161.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"
101926at_fn_check_prepare_trace "calc.at:659"
101927( $at_check_trace; cat stderr
101928) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101929at_status=$? at_failed=false
101930$at_check_filter
101931at_fn_diff_devnull "$at_stderr" || at_failed=:
101932$at_diff expout "$at_stdout" || at_failed=:
101933at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
101934$at_failed && at_fn_log_failure
101935$at_traceon; }
101936
101937
101938cat >input <<'_ATEOF'
101939
101940+1
101941_ATEOF
101942
101943{ set +x
101944$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
101945at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
101946( $at_check_trace;  $PREPARSER ./calc input
101947) >>"$at_stdout" 2>>"$at_stderr" 5>&-
101948at_status=$? at_failed=false
101949$at_check_filter
101950echo stderr:; tee stderr <"$at_stderr"
101951at_fn_diff_devnull "$at_stdout" || at_failed=:
101952at_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"
101958at_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>&-
101961at_status=$? at_failed=false
101962$at_check_filter
101963echo stderr:; tee stderr <"$at_stderr"
101964at_fn_diff_devnull "$at_stdout" || at_failed=:
101965at_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.
101974sed '/^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
101989mv at-stderr stderr
101990# 2. Create the reference error message.
101991cat >expout <<'_ATEOF'
1019922.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"
102002at_fn_check_prepare_trace "calc.at:659"
102003( $at_check_trace; cat stderr
102004) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102005at_status=$? at_failed=false
102006$at_check_filter
102007at_fn_diff_devnull "$at_stderr" || at_failed=:
102008$at_diff expout "$at_stdout" || at_failed=:
102009at_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"
102017at_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>&-
102020at_status=$? at_failed=false
102021$at_check_filter
102022echo stderr:; tee stderr <"$at_stderr"
102023at_fn_diff_devnull "$at_stdout" || at_failed=:
102024at_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"
102030at_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>&-
102033at_status=$? at_failed=false
102034$at_check_filter
102035echo stderr:; tee stderr <"$at_stderr"
102036at_fn_diff_devnull "$at_stdout" || at_failed=:
102037at_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.
102046sed '/^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
102061mv at-stderr stderr
102062# 2. Create the reference error message.
102063cat >expout <<'_ATEOF'
1020641.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"
102074at_fn_check_prepare_trace "calc.at:659"
102075( $at_check_trace; cat stderr
102076) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102077at_status=$? at_failed=false
102078$at_check_filter
102079at_fn_diff_devnull "$at_stderr" || at_failed=:
102080$at_diff expout "$at_stdout" || at_failed=:
102081at_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#
102103cat >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"
102109at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
102110( $at_check_trace;  $PREPARSER ./calc input
102111) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102112at_status=$? at_failed=false
102113$at_check_filter
102114echo stderr:; tee stderr <"$at_stderr"
102115at_fn_diff_devnull "$at_stdout" || at_failed=:
102116at_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"
102122at_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>&-
102125at_status=$? at_failed=false
102126$at_check_filter
102127echo stderr:; tee stderr <"$at_stderr"
102128at_fn_diff_devnull "$at_stdout" || at_failed=:
102129at_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.
102138sed '/^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
102153mv at-stderr stderr
102154# 2. Create the reference error message.
102155cat >expout <<'_ATEOF'
1021561.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1021571.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1021581.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1021591.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
102160calc: 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"
102170at_fn_check_prepare_trace "calc.at:659"
102171( $at_check_trace; cat stderr
102172) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102173at_status=$? at_failed=false
102174$at_check_filter
102175at_fn_diff_devnull "$at_stderr" || at_failed=:
102176$at_diff expout "$at_stdout" || at_failed=:
102177at_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.
102185cat >input <<'_ATEOF'
102186(!) + (1 2) = 1
102187_ATEOF
102188
102189{ set +x
102190$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
102191at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
102192( $at_check_trace;  $PREPARSER ./calc input
102193) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102194at_status=$? at_failed=false
102195$at_check_filter
102196echo stderr:; tee stderr <"$at_stderr"
102197at_fn_diff_devnull "$at_stdout" || at_failed=:
102198at_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"
102204at_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>&-
102207at_status=$? at_failed=false
102208$at_check_filter
102209echo stderr:; tee stderr <"$at_stderr"
102210at_fn_diff_devnull "$at_stdout" || at_failed=:
102211at_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.
102220sed '/^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
102235mv at-stderr stderr
102236# 2. Create the reference error message.
102237cat >expout <<'_ATEOF'
1022381.10: syntax error, unexpected number
102239calc: 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"
102249at_fn_check_prepare_trace "calc.at:659"
102250( $at_check_trace; cat stderr
102251) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102252at_status=$? at_failed=false
102253$at_check_filter
102254at_fn_diff_devnull "$at_stderr" || at_failed=:
102255$at_diff expout "$at_stdout" || at_failed=:
102256at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
102257$at_failed && at_fn_log_failure
102258$at_traceon; }
102259
102260
102261cat >input <<'_ATEOF'
102262(- *) + (1 2) = 1
102263_ATEOF
102264
102265{ set +x
102266$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
102267at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
102268( $at_check_trace;  $PREPARSER ./calc input
102269) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102270at_status=$? at_failed=false
102271$at_check_filter
102272echo stderr:; tee stderr <"$at_stderr"
102273at_fn_diff_devnull "$at_stdout" || at_failed=:
102274at_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"
102280at_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>&-
102283at_status=$? at_failed=false
102284$at_check_filter
102285echo stderr:; tee stderr <"$at_stderr"
102286at_fn_diff_devnull "$at_stdout" || at_failed=:
102287at_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.
102296sed '/^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
102311mv at-stderr stderr
102312# 2. Create the reference error message.
102313cat >expout <<'_ATEOF'
1023141.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1023151.12: syntax error, unexpected number
102316calc: 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"
102326at_fn_check_prepare_trace "calc.at:659"
102327( $at_check_trace; cat stderr
102328) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102329at_status=$? at_failed=false
102330$at_check_filter
102331at_fn_diff_devnull "$at_stderr" || at_failed=:
102332$at_diff expout "$at_stdout" || at_failed=:
102333at_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.
102341cat >input <<'_ATEOF'
102342(* *) + (*) + (*)
102343_ATEOF
102344
102345{ set +x
102346$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
102347at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
102348( $at_check_trace;  $PREPARSER ./calc input
102349) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102350at_status=$? at_failed=false
102351$at_check_filter
102352echo stderr:; tee stderr <"$at_stderr"
102353at_fn_diff_devnull "$at_stdout" || at_failed=:
102354at_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"
102360at_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>&-
102363at_status=$? at_failed=false
102364$at_check_filter
102365echo stderr:; tee stderr <"$at_stderr"
102366at_fn_diff_devnull "$at_stdout" || at_failed=:
102367at_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.
102376sed '/^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
102391mv at-stderr stderr
102392# 2. Create the reference error message.
102393cat >expout <<'_ATEOF'
1023941.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1023951.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1023961.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"
102406at_fn_check_prepare_trace "calc.at:659"
102407( $at_check_trace; cat stderr
102408) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102409at_status=$? at_failed=false
102410$at_check_filter
102411at_fn_diff_devnull "$at_stderr" || at_failed=:
102412$at_diff expout "$at_stdout" || at_failed=:
102413at_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
102424read at_status <"$at_status_file"
102425#AT_STOP_233
102426#AT_START_234
102427at_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
102429at_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
102443cat >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
102484FILE *input;
102485static int power (int base, int exponent);
102486
102487static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
102488int 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%%
102506input:
102507  line
102508| input line         { ++*count; ++global_count; }
102509;
102510
102511line:
102512  '\n'
102513| exp '\n'           { *result = global_result = $1; }
102514;
102515
102516exp:
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
102537static int
102538power (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.  */
102550static
102551void 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
102563cat >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
102574int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
102575static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
102576static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
102577
102578
102579static CALCLTYPE last_yylloc;
102580
102581static int
102582get_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
102599static void
102600unget_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
102610static int
102611read_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
102642int 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
102672cat >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
102691semantic_value global_result = 0;
102692int global_count = 0;
102693
102694/* A C main function.  */
102695int
102696main (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
102734if 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"
102742at_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>&-
102746at_status=$? at_failed=false
102747$at_check_filter
102748echo stderr:; cat "$at_stderr"
102749echo stdout:; cat "$at_stdout"
102750at_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"
102756at_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>&-
102759at_status=$? at_failed=false
102760$at_check_filter
102761echo stderr:; cat "$at_stderr"
102762echo stdout:; cat "$at_stdout"
102763at_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"
102772at_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>&-
102777at_status=$? at_failed=false
102778$at_check_filter
102779at_fn_diff_devnull "$at_stderr" || at_failed=:
102780$at_diff expout "$at_stdout" || at_failed=:
102781at_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"
102790at_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>&-
102795at_status=$? at_failed=false
102796$at_check_filter
102797at_fn_diff_devnull "$at_stderr" || at_failed=:
102798$at_diff expout "$at_stdout" || at_failed=:
102799at_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
102805fi
102806{ set +x
102807$as_echo "$at_srcdir/calc.at:660: bison -o calc.c calc.y"
102808at_fn_check_prepare_trace "calc.at:660"
102809( $at_check_trace; bison -o calc.c calc.y
102810) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102811at_status=$? at_failed=false
102812$at_check_filter
102813at_fn_diff_devnull "$at_stderr" || at_failed=:
102814at_fn_diff_devnull "$at_stdout" || at_failed=:
102815at_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"
102822at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:660"
102823( $at_check_trace; $BISON_C_WORKS
102824) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102825at_status=$? at_failed=false
102826$at_check_filter
102827echo stderr:; cat "$at_stderr"
102828echo stdout:; cat "$at_stdout"
102829at_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"
102835at_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>&-
102838at_status=$? at_failed=false
102839$at_check_filter
102840echo stderr:; cat "$at_stderr"
102841echo stdout:; cat "$at_stdout"
102842at_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"
102857at_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>&-
102868at_status=$? at_failed=false
102869$at_check_filter
102870at_fn_diff_devnull "$at_stderr" || at_failed=:
102871at_fn_diff_devnull "$at_stdout" || at_failed=:
102872at_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"
102886at_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>&-
102897at_status=$? at_failed=false
102898$at_check_filter
102899at_fn_diff_devnull "$at_stderr" || at_failed=:
102900at_fn_diff_devnull "$at_stdout" || at_failed=:
102901at_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.
102907cat >input <<'_ATEOF'
1029081 + 2 * 3 = 7
1029091 + 2 * -3 = -5
102910
102911-1^2 = -1
102912(-1)^2 = 1
102913
102914---1 = -1
102915
1029161 - 2 - 3 = -4
1029171 - (2 - 3) = 2
102918
1029192^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"
102925at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
102926( $at_check_trace;  $PREPARSER ./calc input
102927) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102928at_status=$? at_failed=false
102929$at_check_filter
102930echo stderr:; tee stderr <"$at_stderr"
102931at_fn_diff_devnull "$at_stdout" || at_failed=:
102932at_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"
102938at_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>&-
102941at_status=$? at_failed=false
102942$at_check_filter
102943echo stderr:; tee stderr <"$at_stderr"
102944at_fn_diff_devnull "$at_stdout" || at_failed=:
102945at_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.
102953cat >input <<'_ATEOF'
1029541 2
102955_ATEOF
102956
102957{ set +x
102958$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
102959at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
102960( $at_check_trace;  $PREPARSER ./calc input
102961) >>"$at_stdout" 2>>"$at_stderr" 5>&-
102962at_status=$? at_failed=false
102963$at_check_filter
102964echo stderr:; tee stderr <"$at_stderr"
102965at_fn_diff_devnull "$at_stdout" || at_failed=:
102966at_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"
102972at_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>&-
102975at_status=$? at_failed=false
102976$at_check_filter
102977echo stderr:; tee stderr <"$at_stderr"
102978at_fn_diff_devnull "$at_stdout" || at_failed=:
102979at_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.
102988sed '/^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
103003mv at-stderr stderr
103004# 2. Create the reference error message.
103005cat >expout <<'_ATEOF'
1030061.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"
103016at_fn_check_prepare_trace "calc.at:660"
103017( $at_check_trace; cat stderr
103018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103019at_status=$? at_failed=false
103020$at_check_filter
103021at_fn_diff_devnull "$at_stderr" || at_failed=:
103022$at_diff expout "$at_stdout" || at_failed=:
103023at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
103024$at_failed && at_fn_log_failure
103025$at_traceon; }
103026
103027
103028cat >input <<'_ATEOF'
1030291//2
103030_ATEOF
103031
103032{ set +x
103033$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103034at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103035( $at_check_trace;  $PREPARSER ./calc input
103036) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103037at_status=$? at_failed=false
103038$at_check_filter
103039echo stderr:; tee stderr <"$at_stderr"
103040at_fn_diff_devnull "$at_stdout" || at_failed=:
103041at_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"
103047at_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>&-
103050at_status=$? at_failed=false
103051$at_check_filter
103052echo stderr:; tee stderr <"$at_stderr"
103053at_fn_diff_devnull "$at_stdout" || at_failed=:
103054at_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.
103063sed '/^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
103078mv at-stderr stderr
103079# 2. Create the reference error message.
103080cat >expout <<'_ATEOF'
1030811.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"
103091at_fn_check_prepare_trace "calc.at:660"
103092( $at_check_trace; cat stderr
103093) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103094at_status=$? at_failed=false
103095$at_check_filter
103096at_fn_diff_devnull "$at_stderr" || at_failed=:
103097$at_diff expout "$at_stdout" || at_failed=:
103098at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
103099$at_failed && at_fn_log_failure
103100$at_traceon; }
103101
103102
103103cat >input <<'_ATEOF'
103104error
103105_ATEOF
103106
103107{ set +x
103108$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103109at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103110( $at_check_trace;  $PREPARSER ./calc input
103111) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103112at_status=$? at_failed=false
103113$at_check_filter
103114echo stderr:; tee stderr <"$at_stderr"
103115at_fn_diff_devnull "$at_stdout" || at_failed=:
103116at_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"
103122at_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>&-
103125at_status=$? at_failed=false
103126$at_check_filter
103127echo stderr:; tee stderr <"$at_stderr"
103128at_fn_diff_devnull "$at_stdout" || at_failed=:
103129at_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.
103138sed '/^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
103153mv at-stderr stderr
103154# 2. Create the reference error message.
103155cat >expout <<'_ATEOF'
1031561.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"
103166at_fn_check_prepare_trace "calc.at:660"
103167( $at_check_trace; cat stderr
103168) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103169at_status=$? at_failed=false
103170$at_check_filter
103171at_fn_diff_devnull "$at_stderr" || at_failed=:
103172$at_diff expout "$at_stdout" || at_failed=:
103173at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
103174$at_failed && at_fn_log_failure
103175$at_traceon; }
103176
103177
103178cat >input <<'_ATEOF'
1031791 = 2 = 3
103180_ATEOF
103181
103182{ set +x
103183$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103184at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103185( $at_check_trace;  $PREPARSER ./calc input
103186) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103187at_status=$? at_failed=false
103188$at_check_filter
103189echo stderr:; tee stderr <"$at_stderr"
103190at_fn_diff_devnull "$at_stdout" || at_failed=:
103191at_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"
103197at_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>&-
103200at_status=$? at_failed=false
103201$at_check_filter
103202echo stderr:; tee stderr <"$at_stderr"
103203at_fn_diff_devnull "$at_stdout" || at_failed=:
103204at_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.
103213sed '/^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
103228mv at-stderr stderr
103229# 2. Create the reference error message.
103230cat >expout <<'_ATEOF'
1032311.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"
103241at_fn_check_prepare_trace "calc.at:660"
103242( $at_check_trace; cat stderr
103243) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103244at_status=$? at_failed=false
103245$at_check_filter
103246at_fn_diff_devnull "$at_stderr" || at_failed=:
103247$at_diff expout "$at_stdout" || at_failed=:
103248at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
103249$at_failed && at_fn_log_failure
103250$at_traceon; }
103251
103252
103253cat >input <<'_ATEOF'
103254
103255+1
103256_ATEOF
103257
103258{ set +x
103259$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103260at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103261( $at_check_trace;  $PREPARSER ./calc input
103262) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103263at_status=$? at_failed=false
103264$at_check_filter
103265echo stderr:; tee stderr <"$at_stderr"
103266at_fn_diff_devnull "$at_stdout" || at_failed=:
103267at_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"
103273at_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>&-
103276at_status=$? at_failed=false
103277$at_check_filter
103278echo stderr:; tee stderr <"$at_stderr"
103279at_fn_diff_devnull "$at_stdout" || at_failed=:
103280at_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.
103289sed '/^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
103304mv at-stderr stderr
103305# 2. Create the reference error message.
103306cat >expout <<'_ATEOF'
1033072.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"
103317at_fn_check_prepare_trace "calc.at:660"
103318( $at_check_trace; cat stderr
103319) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103320at_status=$? at_failed=false
103321$at_check_filter
103322at_fn_diff_devnull "$at_stderr" || at_failed=:
103323$at_diff expout "$at_stdout" || at_failed=:
103324at_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"
103332at_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>&-
103335at_status=$? at_failed=false
103336$at_check_filter
103337echo stderr:; tee stderr <"$at_stderr"
103338at_fn_diff_devnull "$at_stdout" || at_failed=:
103339at_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"
103345at_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>&-
103348at_status=$? at_failed=false
103349$at_check_filter
103350echo stderr:; tee stderr <"$at_stderr"
103351at_fn_diff_devnull "$at_stdout" || at_failed=:
103352at_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.
103361sed '/^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
103376mv at-stderr stderr
103377# 2. Create the reference error message.
103378cat >expout <<'_ATEOF'
1033791.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"
103389at_fn_check_prepare_trace "calc.at:660"
103390( $at_check_trace; cat stderr
103391) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103392at_status=$? at_failed=false
103393$at_check_filter
103394at_fn_diff_devnull "$at_stderr" || at_failed=:
103395$at_diff expout "$at_stdout" || at_failed=:
103396at_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#
103418cat >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"
103424at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103425( $at_check_trace;  $PREPARSER ./calc input
103426) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103427at_status=$? at_failed=false
103428$at_check_filter
103429echo stderr:; tee stderr <"$at_stderr"
103430at_fn_diff_devnull "$at_stdout" || at_failed=:
103431at_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"
103437at_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>&-
103440at_status=$? at_failed=false
103441$at_check_filter
103442echo stderr:; tee stderr <"$at_stderr"
103443at_fn_diff_devnull "$at_stdout" || at_failed=:
103444at_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.
103453sed '/^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
103468mv at-stderr stderr
103469# 2. Create the reference error message.
103470cat >expout <<'_ATEOF'
1034711.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1034721.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1034731.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1034741.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
103475calc: 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"
103485at_fn_check_prepare_trace "calc.at:660"
103486( $at_check_trace; cat stderr
103487) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103488at_status=$? at_failed=false
103489$at_check_filter
103490at_fn_diff_devnull "$at_stderr" || at_failed=:
103491$at_diff expout "$at_stdout" || at_failed=:
103492at_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.
103500cat >input <<'_ATEOF'
103501(!) + (1 2) = 1
103502_ATEOF
103503
103504{ set +x
103505$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103506at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103507( $at_check_trace;  $PREPARSER ./calc input
103508) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103509at_status=$? at_failed=false
103510$at_check_filter
103511echo stderr:; tee stderr <"$at_stderr"
103512at_fn_diff_devnull "$at_stdout" || at_failed=:
103513at_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"
103519at_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>&-
103522at_status=$? at_failed=false
103523$at_check_filter
103524echo stderr:; tee stderr <"$at_stderr"
103525at_fn_diff_devnull "$at_stdout" || at_failed=:
103526at_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.
103535sed '/^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
103550mv at-stderr stderr
103551# 2. Create the reference error message.
103552cat >expout <<'_ATEOF'
1035531.10: syntax error, unexpected number
103554calc: 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"
103564at_fn_check_prepare_trace "calc.at:660"
103565( $at_check_trace; cat stderr
103566) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103567at_status=$? at_failed=false
103568$at_check_filter
103569at_fn_diff_devnull "$at_stderr" || at_failed=:
103570$at_diff expout "$at_stdout" || at_failed=:
103571at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
103572$at_failed && at_fn_log_failure
103573$at_traceon; }
103574
103575
103576cat >input <<'_ATEOF'
103577(- *) + (1 2) = 1
103578_ATEOF
103579
103580{ set +x
103581$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103582at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103583( $at_check_trace;  $PREPARSER ./calc input
103584) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103585at_status=$? at_failed=false
103586$at_check_filter
103587echo stderr:; tee stderr <"$at_stderr"
103588at_fn_diff_devnull "$at_stdout" || at_failed=:
103589at_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"
103595at_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>&-
103598at_status=$? at_failed=false
103599$at_check_filter
103600echo stderr:; tee stderr <"$at_stderr"
103601at_fn_diff_devnull "$at_stdout" || at_failed=:
103602at_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.
103611sed '/^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
103626mv at-stderr stderr
103627# 2. Create the reference error message.
103628cat >expout <<'_ATEOF'
1036291.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1036301.12: syntax error, unexpected number
103631calc: 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"
103641at_fn_check_prepare_trace "calc.at:660"
103642( $at_check_trace; cat stderr
103643) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103644at_status=$? at_failed=false
103645$at_check_filter
103646at_fn_diff_devnull "$at_stderr" || at_failed=:
103647$at_diff expout "$at_stdout" || at_failed=:
103648at_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.
103656cat >input <<'_ATEOF'
103657(* *) + (*) + (*)
103658_ATEOF
103659
103660{ set +x
103661$as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
103662at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
103663( $at_check_trace;  $PREPARSER ./calc input
103664) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103665at_status=$? at_failed=false
103666$at_check_filter
103667echo stderr:; tee stderr <"$at_stderr"
103668at_fn_diff_devnull "$at_stdout" || at_failed=:
103669at_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"
103675at_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>&-
103678at_status=$? at_failed=false
103679$at_check_filter
103680echo stderr:; tee stderr <"$at_stderr"
103681at_fn_diff_devnull "$at_stdout" || at_failed=:
103682at_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.
103691sed '/^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
103706mv at-stderr stderr
103707# 2. Create the reference error message.
103708cat >expout <<'_ATEOF'
1037091.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1037101.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1037111.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"
103721at_fn_check_prepare_trace "calc.at:660"
103722( $at_check_trace; cat stderr
103723) >>"$at_stdout" 2>>"$at_stderr" 5>&-
103724at_status=$? at_failed=false
103725$at_check_filter
103726at_fn_diff_devnull "$at_stderr" || at_failed=:
103727$at_diff expout "$at_stdout" || at_failed=:
103728at_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
103739read at_status <"$at_status_file"
103740#AT_STOP_234
103741#AT_START_235
103742at_fn_group_banner 235 'calc.at:670' \
103743  "Calculator %skeleton \"lalr1.cc\" %defines %locations" "" 13
103744at_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
103758cat >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
103799FILE *input;
103800static int power (int base, int exponent);
103801
103802
103803int 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%%
103821input:
103822  line
103823| input line         {  }
103824;
103825
103826line:
103827  '\n'
103828| exp '\n'           { USE ($1); }
103829;
103830
103831exp:
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
103852static int
103853power (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.  */
103864void
103865yy::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
103874cat >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
103885int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
103886static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
103887static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
103888
103889
103890static yy::parser::location_type last_yylloc;
103891
103892static int
103893get_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
103910static void
103911unget_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
103921static int
103922read_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
103953int 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
103983cat >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.  */
104002int
104003yyparse ()
104004{
104005  yy::parser parser;
104006#if YYDEBUG
104007  parser.set_debug_level (1);
104008#endif
104009  return parser.parse ();
104010}
104011
104012
104013semantic_value global_result = 0;
104014int global_count = 0;
104015
104016/* A C main function.  */
104017int
104018main (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
104056if 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"
104064at_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>&-
104068at_status=$? at_failed=false
104069$at_check_filter
104070echo stderr:; cat "$at_stderr"
104071echo stdout:; cat "$at_stdout"
104072at_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"
104078at_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>&-
104081at_status=$? at_failed=false
104082$at_check_filter
104083echo stderr:; cat "$at_stderr"
104084echo stdout:; cat "$at_stdout"
104085at_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"
104094at_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>&-
104099at_status=$? at_failed=false
104100$at_check_filter
104101at_fn_diff_devnull "$at_stderr" || at_failed=:
104102$at_diff expout "$at_stdout" || at_failed=:
104103at_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"
104112at_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>&-
104117at_status=$? at_failed=false
104118$at_check_filter
104119at_fn_diff_devnull "$at_stderr" || at_failed=:
104120$at_diff expout "$at_stdout" || at_failed=:
104121at_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
104127fi
104128{ set +x
104129$as_echo "$at_srcdir/calc.at:670: bison -o calc.cc calc.y"
104130at_fn_check_prepare_trace "calc.at:670"
104131( $at_check_trace; bison -o calc.cc calc.y
104132) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104133at_status=$? at_failed=false
104134$at_check_filter
104135at_fn_diff_devnull "$at_stderr" || at_failed=:
104136at_fn_diff_devnull "$at_stdout" || at_failed=:
104137at_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"
104145at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:670"
104146( $at_check_trace; $BISON_CXX_WORKS
104147) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104148at_status=$? at_failed=false
104149$at_check_filter
104150echo stderr:; cat "$at_stderr"
104151echo stdout:; cat "$at_stdout"
104152at_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"
104158at_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>&-
104161at_status=$? at_failed=false
104162$at_check_filter
104163echo stderr:; cat "$at_stderr"
104164echo stdout:; cat "$at_stdout"
104165at_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"
104180at_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>&-
104191at_status=$? at_failed=false
104192$at_check_filter
104193at_fn_diff_devnull "$at_stderr" || at_failed=:
104194at_fn_diff_devnull "$at_stdout" || at_failed=:
104195at_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"
104209at_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>&-
104220at_status=$? at_failed=false
104221$at_check_filter
104222at_fn_diff_devnull "$at_stderr" || at_failed=:
104223at_fn_diff_devnull "$at_stdout" || at_failed=:
104224at_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.
104230cat >input <<'_ATEOF'
1042311 + 2 * 3 = 7
1042321 + 2 * -3 = -5
104233
104234-1^2 = -1
104235(-1)^2 = 1
104236
104237---1 = -1
104238
1042391 - 2 - 3 = -4
1042401 - (2 - 3) = 2
104241
1042422^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"
104248at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104249( $at_check_trace;  $PREPARSER ./calc input
104250) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104251at_status=$? at_failed=false
104252$at_check_filter
104253echo stderr:; tee stderr <"$at_stderr"
104254at_fn_diff_devnull "$at_stdout" || at_failed=:
104255at_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"
104261at_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>&-
104264at_status=$? at_failed=false
104265$at_check_filter
104266echo stderr:; tee stderr <"$at_stderr"
104267at_fn_diff_devnull "$at_stdout" || at_failed=:
104268at_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.
104276cat >input <<'_ATEOF'
1042771 2
104278_ATEOF
104279
104280{ set +x
104281$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104282at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104283( $at_check_trace;  $PREPARSER ./calc input
104284) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104285at_status=$? at_failed=false
104286$at_check_filter
104287echo stderr:; tee stderr <"$at_stderr"
104288at_fn_diff_devnull "$at_stdout" || at_failed=:
104289at_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"
104295at_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>&-
104298at_status=$? at_failed=false
104299$at_check_filter
104300echo stderr:; tee stderr <"$at_stderr"
104301at_fn_diff_devnull "$at_stdout" || at_failed=:
104302at_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.
104311sed '/^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
104326mv at-stderr stderr
104327# 2. Create the reference error message.
104328cat >expout <<'_ATEOF'
1043291.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.
104335sed 's/syntax error, .*$/syntax error/' expout >at-expout
104336mv at-expout expout
104337# 5. Check
104338{ set +x
104339$as_echo "$at_srcdir/calc.at:670: cat stderr"
104340at_fn_check_prepare_trace "calc.at:670"
104341( $at_check_trace; cat stderr
104342) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104343at_status=$? at_failed=false
104344$at_check_filter
104345at_fn_diff_devnull "$at_stderr" || at_failed=:
104346$at_diff expout "$at_stdout" || at_failed=:
104347at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
104348$at_failed && at_fn_log_failure
104349$at_traceon; }
104350
104351
104352cat >input <<'_ATEOF'
1043531//2
104354_ATEOF
104355
104356{ set +x
104357$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104358at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104359( $at_check_trace;  $PREPARSER ./calc input
104360) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104361at_status=$? at_failed=false
104362$at_check_filter
104363echo stderr:; tee stderr <"$at_stderr"
104364at_fn_diff_devnull "$at_stdout" || at_failed=:
104365at_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"
104371at_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>&-
104374at_status=$? at_failed=false
104375$at_check_filter
104376echo stderr:; tee stderr <"$at_stderr"
104377at_fn_diff_devnull "$at_stdout" || at_failed=:
104378at_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.
104387sed '/^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
104402mv at-stderr stderr
104403# 2. Create the reference error message.
104404cat >expout <<'_ATEOF'
1044051.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.
104411sed 's/syntax error, .*$/syntax error/' expout >at-expout
104412mv at-expout expout
104413# 5. Check
104414{ set +x
104415$as_echo "$at_srcdir/calc.at:670: cat stderr"
104416at_fn_check_prepare_trace "calc.at:670"
104417( $at_check_trace; cat stderr
104418) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104419at_status=$? at_failed=false
104420$at_check_filter
104421at_fn_diff_devnull "$at_stderr" || at_failed=:
104422$at_diff expout "$at_stdout" || at_failed=:
104423at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
104424$at_failed && at_fn_log_failure
104425$at_traceon; }
104426
104427
104428cat >input <<'_ATEOF'
104429error
104430_ATEOF
104431
104432{ set +x
104433$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104434at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104435( $at_check_trace;  $PREPARSER ./calc input
104436) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104437at_status=$? at_failed=false
104438$at_check_filter
104439echo stderr:; tee stderr <"$at_stderr"
104440at_fn_diff_devnull "$at_stdout" || at_failed=:
104441at_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"
104447at_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>&-
104450at_status=$? at_failed=false
104451$at_check_filter
104452echo stderr:; tee stderr <"$at_stderr"
104453at_fn_diff_devnull "$at_stdout" || at_failed=:
104454at_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.
104463sed '/^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
104478mv at-stderr stderr
104479# 2. Create the reference error message.
104480cat >expout <<'_ATEOF'
1044811.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.
104487sed 's/syntax error, .*$/syntax error/' expout >at-expout
104488mv at-expout expout
104489# 5. Check
104490{ set +x
104491$as_echo "$at_srcdir/calc.at:670: cat stderr"
104492at_fn_check_prepare_trace "calc.at:670"
104493( $at_check_trace; cat stderr
104494) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104495at_status=$? at_failed=false
104496$at_check_filter
104497at_fn_diff_devnull "$at_stderr" || at_failed=:
104498$at_diff expout "$at_stdout" || at_failed=:
104499at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
104500$at_failed && at_fn_log_failure
104501$at_traceon; }
104502
104503
104504cat >input <<'_ATEOF'
1045051 = 2 = 3
104506_ATEOF
104507
104508{ set +x
104509$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104510at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104511( $at_check_trace;  $PREPARSER ./calc input
104512) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104513at_status=$? at_failed=false
104514$at_check_filter
104515echo stderr:; tee stderr <"$at_stderr"
104516at_fn_diff_devnull "$at_stdout" || at_failed=:
104517at_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"
104523at_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>&-
104526at_status=$? at_failed=false
104527$at_check_filter
104528echo stderr:; tee stderr <"$at_stderr"
104529at_fn_diff_devnull "$at_stdout" || at_failed=:
104530at_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.
104539sed '/^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
104554mv at-stderr stderr
104555# 2. Create the reference error message.
104556cat >expout <<'_ATEOF'
1045571.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.
104563sed 's/syntax error, .*$/syntax error/' expout >at-expout
104564mv at-expout expout
104565# 5. Check
104566{ set +x
104567$as_echo "$at_srcdir/calc.at:670: cat stderr"
104568at_fn_check_prepare_trace "calc.at:670"
104569( $at_check_trace; cat stderr
104570) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104571at_status=$? at_failed=false
104572$at_check_filter
104573at_fn_diff_devnull "$at_stderr" || at_failed=:
104574$at_diff expout "$at_stdout" || at_failed=:
104575at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
104576$at_failed && at_fn_log_failure
104577$at_traceon; }
104578
104579
104580cat >input <<'_ATEOF'
104581
104582+1
104583_ATEOF
104584
104585{ set +x
104586$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104587at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104588( $at_check_trace;  $PREPARSER ./calc input
104589) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104590at_status=$? at_failed=false
104591$at_check_filter
104592echo stderr:; tee stderr <"$at_stderr"
104593at_fn_diff_devnull "$at_stdout" || at_failed=:
104594at_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"
104600at_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>&-
104603at_status=$? at_failed=false
104604$at_check_filter
104605echo stderr:; tee stderr <"$at_stderr"
104606at_fn_diff_devnull "$at_stdout" || at_failed=:
104607at_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.
104616sed '/^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
104631mv at-stderr stderr
104632# 2. Create the reference error message.
104633cat >expout <<'_ATEOF'
1046342.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.
104640sed 's/syntax error, .*$/syntax error/' expout >at-expout
104641mv at-expout expout
104642# 5. Check
104643{ set +x
104644$as_echo "$at_srcdir/calc.at:670: cat stderr"
104645at_fn_check_prepare_trace "calc.at:670"
104646( $at_check_trace; cat stderr
104647) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104648at_status=$? at_failed=false
104649$at_check_filter
104650at_fn_diff_devnull "$at_stderr" || at_failed=:
104651$at_diff expout "$at_stdout" || at_failed=:
104652at_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"
104660at_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>&-
104663at_status=$? at_failed=false
104664$at_check_filter
104665echo stderr:; tee stderr <"$at_stderr"
104666at_fn_diff_devnull "$at_stdout" || at_failed=:
104667at_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"
104673at_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>&-
104676at_status=$? at_failed=false
104677$at_check_filter
104678echo stderr:; tee stderr <"$at_stderr"
104679at_fn_diff_devnull "$at_stdout" || at_failed=:
104680at_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.
104689sed '/^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
104704mv at-stderr stderr
104705# 2. Create the reference error message.
104706cat >expout <<'_ATEOF'
1047071.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.
104713sed 's/syntax error, .*$/syntax error/' expout >at-expout
104714mv at-expout expout
104715# 5. Check
104716{ set +x
104717$as_echo "$at_srcdir/calc.at:670: cat stderr"
104718at_fn_check_prepare_trace "calc.at:670"
104719( $at_check_trace; cat stderr
104720) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104721at_status=$? at_failed=false
104722$at_check_filter
104723at_fn_diff_devnull "$at_stderr" || at_failed=:
104724$at_diff expout "$at_stdout" || at_failed=:
104725at_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#
104747cat >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"
104753at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104754( $at_check_trace;  $PREPARSER ./calc input
104755) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104756at_status=$? at_failed=false
104757$at_check_filter
104758echo stderr:; tee stderr <"$at_stderr"
104759at_fn_diff_devnull "$at_stdout" || at_failed=:
104760at_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"
104766at_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>&-
104769at_status=$? at_failed=false
104770$at_check_filter
104771echo stderr:; tee stderr <"$at_stderr"
104772at_fn_diff_devnull "$at_stdout" || at_failed=:
104773at_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.
104782sed '/^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
104797mv at-stderr stderr
104798# 2. Create the reference error message.
104799cat >expout <<'_ATEOF'
1048001.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1048011.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1048021.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1048031.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
104804calc: 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.
104810sed 's/syntax error, .*$/syntax error/' expout >at-expout
104811mv at-expout expout
104812# 5. Check
104813{ set +x
104814$as_echo "$at_srcdir/calc.at:670: cat stderr"
104815at_fn_check_prepare_trace "calc.at:670"
104816( $at_check_trace; cat stderr
104817) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104818at_status=$? at_failed=false
104819$at_check_filter
104820at_fn_diff_devnull "$at_stderr" || at_failed=:
104821$at_diff expout "$at_stdout" || at_failed=:
104822at_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.
104830cat >input <<'_ATEOF'
104831(!) + (1 2) = 1
104832_ATEOF
104833
104834{ set +x
104835$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104836at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104837( $at_check_trace;  $PREPARSER ./calc input
104838) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104839at_status=$? at_failed=false
104840$at_check_filter
104841echo stderr:; tee stderr <"$at_stderr"
104842at_fn_diff_devnull "$at_stdout" || at_failed=:
104843at_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"
104849at_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>&-
104852at_status=$? at_failed=false
104853$at_check_filter
104854echo stderr:; tee stderr <"$at_stderr"
104855at_fn_diff_devnull "$at_stdout" || at_failed=:
104856at_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.
104865sed '/^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
104880mv at-stderr stderr
104881# 2. Create the reference error message.
104882cat >expout <<'_ATEOF'
1048831.10: syntax error, unexpected number
104884calc: 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.
104890sed 's/syntax error, .*$/syntax error/' expout >at-expout
104891mv at-expout expout
104892# 5. Check
104893{ set +x
104894$as_echo "$at_srcdir/calc.at:670: cat stderr"
104895at_fn_check_prepare_trace "calc.at:670"
104896( $at_check_trace; cat stderr
104897) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104898at_status=$? at_failed=false
104899$at_check_filter
104900at_fn_diff_devnull "$at_stderr" || at_failed=:
104901$at_diff expout "$at_stdout" || at_failed=:
104902at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
104903$at_failed && at_fn_log_failure
104904$at_traceon; }
104905
104906
104907cat >input <<'_ATEOF'
104908(- *) + (1 2) = 1
104909_ATEOF
104910
104911{ set +x
104912$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104913at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104914( $at_check_trace;  $PREPARSER ./calc input
104915) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104916at_status=$? at_failed=false
104917$at_check_filter
104918echo stderr:; tee stderr <"$at_stderr"
104919at_fn_diff_devnull "$at_stdout" || at_failed=:
104920at_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"
104926at_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>&-
104929at_status=$? at_failed=false
104930$at_check_filter
104931echo stderr:; tee stderr <"$at_stderr"
104932at_fn_diff_devnull "$at_stdout" || at_failed=:
104933at_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.
104942sed '/^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
104957mv at-stderr stderr
104958# 2. Create the reference error message.
104959cat >expout <<'_ATEOF'
1049601.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1049611.12: syntax error, unexpected number
104962calc: 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.
104968sed 's/syntax error, .*$/syntax error/' expout >at-expout
104969mv at-expout expout
104970# 5. Check
104971{ set +x
104972$as_echo "$at_srcdir/calc.at:670: cat stderr"
104973at_fn_check_prepare_trace "calc.at:670"
104974( $at_check_trace; cat stderr
104975) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104976at_status=$? at_failed=false
104977$at_check_filter
104978at_fn_diff_devnull "$at_stderr" || at_failed=:
104979$at_diff expout "$at_stdout" || at_failed=:
104980at_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.
104988cat >input <<'_ATEOF'
104989(* *) + (*) + (*)
104990_ATEOF
104991
104992{ set +x
104993$as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
104994at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
104995( $at_check_trace;  $PREPARSER ./calc input
104996) >>"$at_stdout" 2>>"$at_stderr" 5>&-
104997at_status=$? at_failed=false
104998$at_check_filter
104999echo stderr:; tee stderr <"$at_stderr"
105000at_fn_diff_devnull "$at_stdout" || at_failed=:
105001at_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"
105007at_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>&-
105010at_status=$? at_failed=false
105011$at_check_filter
105012echo stderr:; tee stderr <"$at_stderr"
105013at_fn_diff_devnull "$at_stdout" || at_failed=:
105014at_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.
105023sed '/^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
105038mv at-stderr stderr
105039# 2. Create the reference error message.
105040cat >expout <<'_ATEOF'
1050411.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1050421.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1050431.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.
105049sed 's/syntax error, .*$/syntax error/' expout >at-expout
105050mv at-expout expout
105051# 5. Check
105052{ set +x
105053$as_echo "$at_srcdir/calc.at:670: cat stderr"
105054at_fn_check_prepare_trace "calc.at:670"
105055( $at_check_trace; cat stderr
105056) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105057at_status=$? at_failed=false
105058$at_check_filter
105059at_fn_diff_devnull "$at_stderr" || at_failed=:
105060$at_diff expout "$at_stdout" || at_failed=:
105061at_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
105072read at_status <"$at_status_file"
105073#AT_STOP_235
105074#AT_START_236
105075at_fn_group_banner 236 'calc.at:679' \
105076  "Calculator %language \"C++\" %defines %locations " "" 13
105077at_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
105091cat >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
105132FILE *input;
105133static int power (int base, int exponent);
105134
105135
105136int 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%%
105154input:
105155  line
105156| input line         {  }
105157;
105158
105159line:
105160  '\n'
105161| exp '\n'           { USE ($1); }
105162;
105163
105164exp:
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
105185static int
105186power (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.  */
105197void
105198yy::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
105207cat >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
105218int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
105219static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
105220static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
105221
105222
105223static yy::parser::location_type last_yylloc;
105224
105225static int
105226get_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
105243static void
105244unget_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
105254static int
105255read_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
105286int 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
105316cat >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.  */
105335int
105336yyparse ()
105337{
105338  yy::parser parser;
105339#if YYDEBUG
105340  parser.set_debug_level (1);
105341#endif
105342  return parser.parse ();
105343}
105344
105345
105346semantic_value global_result = 0;
105347int global_count = 0;
105348
105349/* A C main function.  */
105350int
105351main (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
105389if 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"
105397at_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>&-
105401at_status=$? at_failed=false
105402$at_check_filter
105403echo stderr:; cat "$at_stderr"
105404echo stdout:; cat "$at_stdout"
105405at_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"
105411at_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>&-
105414at_status=$? at_failed=false
105415$at_check_filter
105416echo stderr:; cat "$at_stderr"
105417echo stdout:; cat "$at_stdout"
105418at_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"
105427at_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>&-
105432at_status=$? at_failed=false
105433$at_check_filter
105434at_fn_diff_devnull "$at_stderr" || at_failed=:
105435$at_diff expout "$at_stdout" || at_failed=:
105436at_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"
105445at_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>&-
105450at_status=$? at_failed=false
105451$at_check_filter
105452at_fn_diff_devnull "$at_stderr" || at_failed=:
105453$at_diff expout "$at_stdout" || at_failed=:
105454at_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
105460fi
105461{ set +x
105462$as_echo "$at_srcdir/calc.at:679: bison -o calc.cc calc.y"
105463at_fn_check_prepare_trace "calc.at:679"
105464( $at_check_trace; bison -o calc.cc calc.y
105465) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105466at_status=$? at_failed=false
105467$at_check_filter
105468at_fn_diff_devnull "$at_stderr" || at_failed=:
105469at_fn_diff_devnull "$at_stdout" || at_failed=:
105470at_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"
105478at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:679"
105479( $at_check_trace; $BISON_CXX_WORKS
105480) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105481at_status=$? at_failed=false
105482$at_check_filter
105483echo stderr:; cat "$at_stderr"
105484echo stdout:; cat "$at_stdout"
105485at_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"
105491at_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>&-
105494at_status=$? at_failed=false
105495$at_check_filter
105496echo stderr:; cat "$at_stderr"
105497echo stdout:; cat "$at_stdout"
105498at_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"
105513at_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>&-
105524at_status=$? at_failed=false
105525$at_check_filter
105526at_fn_diff_devnull "$at_stderr" || at_failed=:
105527at_fn_diff_devnull "$at_stdout" || at_failed=:
105528at_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"
105542at_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>&-
105553at_status=$? at_failed=false
105554$at_check_filter
105555at_fn_diff_devnull "$at_stderr" || at_failed=:
105556at_fn_diff_devnull "$at_stdout" || at_failed=:
105557at_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.
105563cat >input <<'_ATEOF'
1055641 + 2 * 3 = 7
1055651 + 2 * -3 = -5
105566
105567-1^2 = -1
105568(-1)^2 = 1
105569
105570---1 = -1
105571
1055721 - 2 - 3 = -4
1055731 - (2 - 3) = 2
105574
1055752^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"
105581at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105582( $at_check_trace;  $PREPARSER ./calc input
105583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105584at_status=$? at_failed=false
105585$at_check_filter
105586echo stderr:; tee stderr <"$at_stderr"
105587at_fn_diff_devnull "$at_stdout" || at_failed=:
105588at_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"
105594at_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>&-
105597at_status=$? at_failed=false
105598$at_check_filter
105599echo stderr:; tee stderr <"$at_stderr"
105600at_fn_diff_devnull "$at_stdout" || at_failed=:
105601at_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.
105609cat >input <<'_ATEOF'
1056101 2
105611_ATEOF
105612
105613{ set +x
105614$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
105615at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105616( $at_check_trace;  $PREPARSER ./calc input
105617) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105618at_status=$? at_failed=false
105619$at_check_filter
105620echo stderr:; tee stderr <"$at_stderr"
105621at_fn_diff_devnull "$at_stdout" || at_failed=:
105622at_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"
105628at_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>&-
105631at_status=$? at_failed=false
105632$at_check_filter
105633echo stderr:; tee stderr <"$at_stderr"
105634at_fn_diff_devnull "$at_stdout" || at_failed=:
105635at_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.
105644sed '/^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
105659mv at-stderr stderr
105660# 2. Create the reference error message.
105661cat >expout <<'_ATEOF'
1056621.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.
105668sed 's/syntax error, .*$/syntax error/' expout >at-expout
105669mv at-expout expout
105670# 5. Check
105671{ set +x
105672$as_echo "$at_srcdir/calc.at:679: cat stderr"
105673at_fn_check_prepare_trace "calc.at:679"
105674( $at_check_trace; cat stderr
105675) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105676at_status=$? at_failed=false
105677$at_check_filter
105678at_fn_diff_devnull "$at_stderr" || at_failed=:
105679$at_diff expout "$at_stdout" || at_failed=:
105680at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
105681$at_failed && at_fn_log_failure
105682$at_traceon; }
105683
105684
105685cat >input <<'_ATEOF'
1056861//2
105687_ATEOF
105688
105689{ set +x
105690$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
105691at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105692( $at_check_trace;  $PREPARSER ./calc input
105693) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105694at_status=$? at_failed=false
105695$at_check_filter
105696echo stderr:; tee stderr <"$at_stderr"
105697at_fn_diff_devnull "$at_stdout" || at_failed=:
105698at_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"
105704at_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>&-
105707at_status=$? at_failed=false
105708$at_check_filter
105709echo stderr:; tee stderr <"$at_stderr"
105710at_fn_diff_devnull "$at_stdout" || at_failed=:
105711at_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.
105720sed '/^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
105735mv at-stderr stderr
105736# 2. Create the reference error message.
105737cat >expout <<'_ATEOF'
1057381.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.
105744sed 's/syntax error, .*$/syntax error/' expout >at-expout
105745mv at-expout expout
105746# 5. Check
105747{ set +x
105748$as_echo "$at_srcdir/calc.at:679: cat stderr"
105749at_fn_check_prepare_trace "calc.at:679"
105750( $at_check_trace; cat stderr
105751) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105752at_status=$? at_failed=false
105753$at_check_filter
105754at_fn_diff_devnull "$at_stderr" || at_failed=:
105755$at_diff expout "$at_stdout" || at_failed=:
105756at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
105757$at_failed && at_fn_log_failure
105758$at_traceon; }
105759
105760
105761cat >input <<'_ATEOF'
105762error
105763_ATEOF
105764
105765{ set +x
105766$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
105767at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105768( $at_check_trace;  $PREPARSER ./calc input
105769) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105770at_status=$? at_failed=false
105771$at_check_filter
105772echo stderr:; tee stderr <"$at_stderr"
105773at_fn_diff_devnull "$at_stdout" || at_failed=:
105774at_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"
105780at_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>&-
105783at_status=$? at_failed=false
105784$at_check_filter
105785echo stderr:; tee stderr <"$at_stderr"
105786at_fn_diff_devnull "$at_stdout" || at_failed=:
105787at_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.
105796sed '/^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
105811mv at-stderr stderr
105812# 2. Create the reference error message.
105813cat >expout <<'_ATEOF'
1058141.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.
105820sed 's/syntax error, .*$/syntax error/' expout >at-expout
105821mv at-expout expout
105822# 5. Check
105823{ set +x
105824$as_echo "$at_srcdir/calc.at:679: cat stderr"
105825at_fn_check_prepare_trace "calc.at:679"
105826( $at_check_trace; cat stderr
105827) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105828at_status=$? at_failed=false
105829$at_check_filter
105830at_fn_diff_devnull "$at_stderr" || at_failed=:
105831$at_diff expout "$at_stdout" || at_failed=:
105832at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
105833$at_failed && at_fn_log_failure
105834$at_traceon; }
105835
105836
105837cat >input <<'_ATEOF'
1058381 = 2 = 3
105839_ATEOF
105840
105841{ set +x
105842$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
105843at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105844( $at_check_trace;  $PREPARSER ./calc input
105845) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105846at_status=$? at_failed=false
105847$at_check_filter
105848echo stderr:; tee stderr <"$at_stderr"
105849at_fn_diff_devnull "$at_stdout" || at_failed=:
105850at_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"
105856at_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>&-
105859at_status=$? at_failed=false
105860$at_check_filter
105861echo stderr:; tee stderr <"$at_stderr"
105862at_fn_diff_devnull "$at_stdout" || at_failed=:
105863at_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.
105872sed '/^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
105887mv at-stderr stderr
105888# 2. Create the reference error message.
105889cat >expout <<'_ATEOF'
1058901.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.
105896sed 's/syntax error, .*$/syntax error/' expout >at-expout
105897mv at-expout expout
105898# 5. Check
105899{ set +x
105900$as_echo "$at_srcdir/calc.at:679: cat stderr"
105901at_fn_check_prepare_trace "calc.at:679"
105902( $at_check_trace; cat stderr
105903) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105904at_status=$? at_failed=false
105905$at_check_filter
105906at_fn_diff_devnull "$at_stderr" || at_failed=:
105907$at_diff expout "$at_stdout" || at_failed=:
105908at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
105909$at_failed && at_fn_log_failure
105910$at_traceon; }
105911
105912
105913cat >input <<'_ATEOF'
105914
105915+1
105916_ATEOF
105917
105918{ set +x
105919$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
105920at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
105921( $at_check_trace;  $PREPARSER ./calc input
105922) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105923at_status=$? at_failed=false
105924$at_check_filter
105925echo stderr:; tee stderr <"$at_stderr"
105926at_fn_diff_devnull "$at_stdout" || at_failed=:
105927at_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"
105933at_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>&-
105936at_status=$? at_failed=false
105937$at_check_filter
105938echo stderr:; tee stderr <"$at_stderr"
105939at_fn_diff_devnull "$at_stdout" || at_failed=:
105940at_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.
105949sed '/^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
105964mv at-stderr stderr
105965# 2. Create the reference error message.
105966cat >expout <<'_ATEOF'
1059672.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.
105973sed 's/syntax error, .*$/syntax error/' expout >at-expout
105974mv at-expout expout
105975# 5. Check
105976{ set +x
105977$as_echo "$at_srcdir/calc.at:679: cat stderr"
105978at_fn_check_prepare_trace "calc.at:679"
105979( $at_check_trace; cat stderr
105980) >>"$at_stdout" 2>>"$at_stderr" 5>&-
105981at_status=$? at_failed=false
105982$at_check_filter
105983at_fn_diff_devnull "$at_stderr" || at_failed=:
105984$at_diff expout "$at_stdout" || at_failed=:
105985at_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"
105993at_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>&-
105996at_status=$? at_failed=false
105997$at_check_filter
105998echo stderr:; tee stderr <"$at_stderr"
105999at_fn_diff_devnull "$at_stdout" || at_failed=:
106000at_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"
106006at_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>&-
106009at_status=$? at_failed=false
106010$at_check_filter
106011echo stderr:; tee stderr <"$at_stderr"
106012at_fn_diff_devnull "$at_stdout" || at_failed=:
106013at_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.
106022sed '/^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
106037mv at-stderr stderr
106038# 2. Create the reference error message.
106039cat >expout <<'_ATEOF'
1060401.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.
106046sed 's/syntax error, .*$/syntax error/' expout >at-expout
106047mv at-expout expout
106048# 5. Check
106049{ set +x
106050$as_echo "$at_srcdir/calc.at:679: cat stderr"
106051at_fn_check_prepare_trace "calc.at:679"
106052( $at_check_trace; cat stderr
106053) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106054at_status=$? at_failed=false
106055$at_check_filter
106056at_fn_diff_devnull "$at_stderr" || at_failed=:
106057$at_diff expout "$at_stdout" || at_failed=:
106058at_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#
106080cat >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"
106086at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
106087( $at_check_trace;  $PREPARSER ./calc input
106088) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106089at_status=$? at_failed=false
106090$at_check_filter
106091echo stderr:; tee stderr <"$at_stderr"
106092at_fn_diff_devnull "$at_stdout" || at_failed=:
106093at_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"
106099at_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>&-
106102at_status=$? at_failed=false
106103$at_check_filter
106104echo stderr:; tee stderr <"$at_stderr"
106105at_fn_diff_devnull "$at_stdout" || at_failed=:
106106at_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.
106115sed '/^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
106130mv at-stderr stderr
106131# 2. Create the reference error message.
106132cat >expout <<'_ATEOF'
1061331.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1061341.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1061351.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1061361.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
106137calc: 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.
106143sed 's/syntax error, .*$/syntax error/' expout >at-expout
106144mv at-expout expout
106145# 5. Check
106146{ set +x
106147$as_echo "$at_srcdir/calc.at:679: cat stderr"
106148at_fn_check_prepare_trace "calc.at:679"
106149( $at_check_trace; cat stderr
106150) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106151at_status=$? at_failed=false
106152$at_check_filter
106153at_fn_diff_devnull "$at_stderr" || at_failed=:
106154$at_diff expout "$at_stdout" || at_failed=:
106155at_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.
106163cat >input <<'_ATEOF'
106164(!) + (1 2) = 1
106165_ATEOF
106166
106167{ set +x
106168$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
106169at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
106170( $at_check_trace;  $PREPARSER ./calc input
106171) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106172at_status=$? at_failed=false
106173$at_check_filter
106174echo stderr:; tee stderr <"$at_stderr"
106175at_fn_diff_devnull "$at_stdout" || at_failed=:
106176at_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"
106182at_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>&-
106185at_status=$? at_failed=false
106186$at_check_filter
106187echo stderr:; tee stderr <"$at_stderr"
106188at_fn_diff_devnull "$at_stdout" || at_failed=:
106189at_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.
106198sed '/^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
106213mv at-stderr stderr
106214# 2. Create the reference error message.
106215cat >expout <<'_ATEOF'
1062161.10: syntax error, unexpected number
106217calc: 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.
106223sed 's/syntax error, .*$/syntax error/' expout >at-expout
106224mv at-expout expout
106225# 5. Check
106226{ set +x
106227$as_echo "$at_srcdir/calc.at:679: cat stderr"
106228at_fn_check_prepare_trace "calc.at:679"
106229( $at_check_trace; cat stderr
106230) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106231at_status=$? at_failed=false
106232$at_check_filter
106233at_fn_diff_devnull "$at_stderr" || at_failed=:
106234$at_diff expout "$at_stdout" || at_failed=:
106235at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
106236$at_failed && at_fn_log_failure
106237$at_traceon; }
106238
106239
106240cat >input <<'_ATEOF'
106241(- *) + (1 2) = 1
106242_ATEOF
106243
106244{ set +x
106245$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
106246at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
106247( $at_check_trace;  $PREPARSER ./calc input
106248) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106249at_status=$? at_failed=false
106250$at_check_filter
106251echo stderr:; tee stderr <"$at_stderr"
106252at_fn_diff_devnull "$at_stdout" || at_failed=:
106253at_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"
106259at_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>&-
106262at_status=$? at_failed=false
106263$at_check_filter
106264echo stderr:; tee stderr <"$at_stderr"
106265at_fn_diff_devnull "$at_stdout" || at_failed=:
106266at_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.
106275sed '/^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
106290mv at-stderr stderr
106291# 2. Create the reference error message.
106292cat >expout <<'_ATEOF'
1062931.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1062941.12: syntax error, unexpected number
106295calc: 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.
106301sed 's/syntax error, .*$/syntax error/' expout >at-expout
106302mv at-expout expout
106303# 5. Check
106304{ set +x
106305$as_echo "$at_srcdir/calc.at:679: cat stderr"
106306at_fn_check_prepare_trace "calc.at:679"
106307( $at_check_trace; cat stderr
106308) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106309at_status=$? at_failed=false
106310$at_check_filter
106311at_fn_diff_devnull "$at_stderr" || at_failed=:
106312$at_diff expout "$at_stdout" || at_failed=:
106313at_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.
106321cat >input <<'_ATEOF'
106322(* *) + (*) + (*)
106323_ATEOF
106324
106325{ set +x
106326$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
106327at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
106328( $at_check_trace;  $PREPARSER ./calc input
106329) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106330at_status=$? at_failed=false
106331$at_check_filter
106332echo stderr:; tee stderr <"$at_stderr"
106333at_fn_diff_devnull "$at_stdout" || at_failed=:
106334at_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"
106340at_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>&-
106343at_status=$? at_failed=false
106344$at_check_filter
106345echo stderr:; tee stderr <"$at_stderr"
106346at_fn_diff_devnull "$at_stdout" || at_failed=:
106347at_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.
106356sed '/^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
106371mv at-stderr stderr
106372# 2. Create the reference error message.
106373cat >expout <<'_ATEOF'
1063741.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1063751.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1063761.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.
106382sed 's/syntax error, .*$/syntax error/' expout >at-expout
106383mv at-expout expout
106384# 5. Check
106385{ set +x
106386$as_echo "$at_srcdir/calc.at:679: cat stderr"
106387at_fn_check_prepare_trace "calc.at:679"
106388( $at_check_trace; cat stderr
106389) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106390at_status=$? at_failed=false
106391$at_check_filter
106392at_fn_diff_devnull "$at_stderr" || at_failed=:
106393$at_diff expout "$at_stdout" || at_failed=:
106394at_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
106405read at_status <"$at_status_file"
106406#AT_STOP_236
106407#AT_START_237
106408at_fn_group_banner 237 'calc.at:680' \
106409  "Calculator %language \"C++\" %defines %locations %define api.location.type Span" "" 13
106410at_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
106424cat >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
106492FILE *input;
106493static int power (int base, int exponent);
106494
106495
106496int 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%%
106519input:
106520  line
106521| input line         {  }
106522;
106523
106524line:
106525  '\n'
106526| exp '\n'           { USE ($1); }
106527;
106528
106529exp:
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
106550static int
106551power (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.  */
106573void
106574yy::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
106583cat >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
106594int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
106595static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
106596static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
106597
106598
106599static yy::parser::location_type last_yylloc;
106600
106601static int
106602get_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
106619static void
106620unget_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
106630static int
106631read_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
106662int 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
106692cat >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.  */
106711int
106712yyparse ()
106713{
106714  yy::parser parser;
106715#if YYDEBUG
106716  parser.set_debug_level (1);
106717#endif
106718  return parser.parse ();
106719}
106720
106721
106722semantic_value global_result = 0;
106723int global_count = 0;
106724
106725/* A C main function.  */
106726int
106727main (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
106765if 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"
106773at_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>&-
106777at_status=$? at_failed=false
106778$at_check_filter
106779echo stderr:; cat "$at_stderr"
106780echo stdout:; cat "$at_stdout"
106781at_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"
106787at_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>&-
106790at_status=$? at_failed=false
106791$at_check_filter
106792echo stderr:; cat "$at_stderr"
106793echo stdout:; cat "$at_stdout"
106794at_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"
106803at_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>&-
106808at_status=$? at_failed=false
106809$at_check_filter
106810at_fn_diff_devnull "$at_stderr" || at_failed=:
106811$at_diff expout "$at_stdout" || at_failed=:
106812at_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"
106821at_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>&-
106826at_status=$? at_failed=false
106827$at_check_filter
106828at_fn_diff_devnull "$at_stderr" || at_failed=:
106829$at_diff expout "$at_stdout" || at_failed=:
106830at_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
106836fi
106837{ set +x
106838$as_echo "$at_srcdir/calc.at:680: bison -o calc.cc calc.y"
106839at_fn_check_prepare_trace "calc.at:680"
106840( $at_check_trace; bison -o calc.cc calc.y
106841) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106842at_status=$? at_failed=false
106843$at_check_filter
106844at_fn_diff_devnull "$at_stderr" || at_failed=:
106845at_fn_diff_devnull "$at_stdout" || at_failed=:
106846at_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"
106854at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680"
106855( $at_check_trace; $BISON_CXX_WORKS
106856) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106857at_status=$? at_failed=false
106858$at_check_filter
106859echo stderr:; cat "$at_stderr"
106860echo stdout:; cat "$at_stdout"
106861at_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"
106867at_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>&-
106870at_status=$? at_failed=false
106871$at_check_filter
106872echo stderr:; cat "$at_stderr"
106873echo stdout:; cat "$at_stdout"
106874at_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"
106889at_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>&-
106900at_status=$? at_failed=false
106901$at_check_filter
106902at_fn_diff_devnull "$at_stderr" || at_failed=:
106903at_fn_diff_devnull "$at_stdout" || at_failed=:
106904at_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"
106918at_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>&-
106929at_status=$? at_failed=false
106930$at_check_filter
106931at_fn_diff_devnull "$at_stderr" || at_failed=:
106932at_fn_diff_devnull "$at_stdout" || at_failed=:
106933at_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.
106939cat >input <<'_ATEOF'
1069401 + 2 * 3 = 7
1069411 + 2 * -3 = -5
106942
106943-1^2 = -1
106944(-1)^2 = 1
106945
106946---1 = -1
106947
1069481 - 2 - 3 = -4
1069491 - (2 - 3) = 2
106950
1069512^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"
106957at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
106958( $at_check_trace;  $PREPARSER ./calc input
106959) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106960at_status=$? at_failed=false
106961$at_check_filter
106962echo stderr:; tee stderr <"$at_stderr"
106963at_fn_diff_devnull "$at_stdout" || at_failed=:
106964at_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"
106970at_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>&-
106973at_status=$? at_failed=false
106974$at_check_filter
106975echo stderr:; tee stderr <"$at_stderr"
106976at_fn_diff_devnull "$at_stdout" || at_failed=:
106977at_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.
106985cat >input <<'_ATEOF'
1069861 2
106987_ATEOF
106988
106989{ set +x
106990$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
106991at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
106992( $at_check_trace;  $PREPARSER ./calc input
106993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
106994at_status=$? at_failed=false
106995$at_check_filter
106996echo stderr:; tee stderr <"$at_stderr"
106997at_fn_diff_devnull "$at_stdout" || at_failed=:
106998at_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"
107004at_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>&-
107007at_status=$? at_failed=false
107008$at_check_filter
107009echo stderr:; tee stderr <"$at_stderr"
107010at_fn_diff_devnull "$at_stdout" || at_failed=:
107011at_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.
107020sed '/^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
107035mv at-stderr stderr
107036# 2. Create the reference error message.
107037cat >expout <<'_ATEOF'
1070381.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.
107044sed 's/syntax error, .*$/syntax error/' expout >at-expout
107045mv at-expout expout
107046# 5. Check
107047{ set +x
107048$as_echo "$at_srcdir/calc.at:680: cat stderr"
107049at_fn_check_prepare_trace "calc.at:680"
107050( $at_check_trace; cat stderr
107051) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107052at_status=$? at_failed=false
107053$at_check_filter
107054at_fn_diff_devnull "$at_stderr" || at_failed=:
107055$at_diff expout "$at_stdout" || at_failed=:
107056at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
107057$at_failed && at_fn_log_failure
107058$at_traceon; }
107059
107060
107061cat >input <<'_ATEOF'
1070621//2
107063_ATEOF
107064
107065{ set +x
107066$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107067at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107068( $at_check_trace;  $PREPARSER ./calc input
107069) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107070at_status=$? at_failed=false
107071$at_check_filter
107072echo stderr:; tee stderr <"$at_stderr"
107073at_fn_diff_devnull "$at_stdout" || at_failed=:
107074at_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"
107080at_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>&-
107083at_status=$? at_failed=false
107084$at_check_filter
107085echo stderr:; tee stderr <"$at_stderr"
107086at_fn_diff_devnull "$at_stdout" || at_failed=:
107087at_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.
107096sed '/^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
107111mv at-stderr stderr
107112# 2. Create the reference error message.
107113cat >expout <<'_ATEOF'
1071141.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.
107120sed 's/syntax error, .*$/syntax error/' expout >at-expout
107121mv at-expout expout
107122# 5. Check
107123{ set +x
107124$as_echo "$at_srcdir/calc.at:680: cat stderr"
107125at_fn_check_prepare_trace "calc.at:680"
107126( $at_check_trace; cat stderr
107127) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107128at_status=$? at_failed=false
107129$at_check_filter
107130at_fn_diff_devnull "$at_stderr" || at_failed=:
107131$at_diff expout "$at_stdout" || at_failed=:
107132at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
107133$at_failed && at_fn_log_failure
107134$at_traceon; }
107135
107136
107137cat >input <<'_ATEOF'
107138error
107139_ATEOF
107140
107141{ set +x
107142$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107143at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107144( $at_check_trace;  $PREPARSER ./calc input
107145) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107146at_status=$? at_failed=false
107147$at_check_filter
107148echo stderr:; tee stderr <"$at_stderr"
107149at_fn_diff_devnull "$at_stdout" || at_failed=:
107150at_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"
107156at_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>&-
107159at_status=$? at_failed=false
107160$at_check_filter
107161echo stderr:; tee stderr <"$at_stderr"
107162at_fn_diff_devnull "$at_stdout" || at_failed=:
107163at_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.
107172sed '/^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
107187mv at-stderr stderr
107188# 2. Create the reference error message.
107189cat >expout <<'_ATEOF'
1071901.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.
107196sed 's/syntax error, .*$/syntax error/' expout >at-expout
107197mv at-expout expout
107198# 5. Check
107199{ set +x
107200$as_echo "$at_srcdir/calc.at:680: cat stderr"
107201at_fn_check_prepare_trace "calc.at:680"
107202( $at_check_trace; cat stderr
107203) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107204at_status=$? at_failed=false
107205$at_check_filter
107206at_fn_diff_devnull "$at_stderr" || at_failed=:
107207$at_diff expout "$at_stdout" || at_failed=:
107208at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
107209$at_failed && at_fn_log_failure
107210$at_traceon; }
107211
107212
107213cat >input <<'_ATEOF'
1072141 = 2 = 3
107215_ATEOF
107216
107217{ set +x
107218$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107219at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107220( $at_check_trace;  $PREPARSER ./calc input
107221) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107222at_status=$? at_failed=false
107223$at_check_filter
107224echo stderr:; tee stderr <"$at_stderr"
107225at_fn_diff_devnull "$at_stdout" || at_failed=:
107226at_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"
107232at_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>&-
107235at_status=$? at_failed=false
107236$at_check_filter
107237echo stderr:; tee stderr <"$at_stderr"
107238at_fn_diff_devnull "$at_stdout" || at_failed=:
107239at_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.
107248sed '/^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
107263mv at-stderr stderr
107264# 2. Create the reference error message.
107265cat >expout <<'_ATEOF'
1072661.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.
107272sed 's/syntax error, .*$/syntax error/' expout >at-expout
107273mv at-expout expout
107274# 5. Check
107275{ set +x
107276$as_echo "$at_srcdir/calc.at:680: cat stderr"
107277at_fn_check_prepare_trace "calc.at:680"
107278( $at_check_trace; cat stderr
107279) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107280at_status=$? at_failed=false
107281$at_check_filter
107282at_fn_diff_devnull "$at_stderr" || at_failed=:
107283$at_diff expout "$at_stdout" || at_failed=:
107284at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
107285$at_failed && at_fn_log_failure
107286$at_traceon; }
107287
107288
107289cat >input <<'_ATEOF'
107290
107291+1
107292_ATEOF
107293
107294{ set +x
107295$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107296at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107297( $at_check_trace;  $PREPARSER ./calc input
107298) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107299at_status=$? at_failed=false
107300$at_check_filter
107301echo stderr:; tee stderr <"$at_stderr"
107302at_fn_diff_devnull "$at_stdout" || at_failed=:
107303at_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"
107309at_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>&-
107312at_status=$? at_failed=false
107313$at_check_filter
107314echo stderr:; tee stderr <"$at_stderr"
107315at_fn_diff_devnull "$at_stdout" || at_failed=:
107316at_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.
107325sed '/^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
107340mv at-stderr stderr
107341# 2. Create the reference error message.
107342cat >expout <<'_ATEOF'
1073432.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.
107349sed 's/syntax error, .*$/syntax error/' expout >at-expout
107350mv at-expout expout
107351# 5. Check
107352{ set +x
107353$as_echo "$at_srcdir/calc.at:680: cat stderr"
107354at_fn_check_prepare_trace "calc.at:680"
107355( $at_check_trace; cat stderr
107356) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107357at_status=$? at_failed=false
107358$at_check_filter
107359at_fn_diff_devnull "$at_stderr" || at_failed=:
107360$at_diff expout "$at_stdout" || at_failed=:
107361at_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"
107369at_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>&-
107372at_status=$? at_failed=false
107373$at_check_filter
107374echo stderr:; tee stderr <"$at_stderr"
107375at_fn_diff_devnull "$at_stdout" || at_failed=:
107376at_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"
107382at_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>&-
107385at_status=$? at_failed=false
107386$at_check_filter
107387echo stderr:; tee stderr <"$at_stderr"
107388at_fn_diff_devnull "$at_stdout" || at_failed=:
107389at_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.
107398sed '/^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
107413mv at-stderr stderr
107414# 2. Create the reference error message.
107415cat >expout <<'_ATEOF'
1074161.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.
107422sed 's/syntax error, .*$/syntax error/' expout >at-expout
107423mv at-expout expout
107424# 5. Check
107425{ set +x
107426$as_echo "$at_srcdir/calc.at:680: cat stderr"
107427at_fn_check_prepare_trace "calc.at:680"
107428( $at_check_trace; cat stderr
107429) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107430at_status=$? at_failed=false
107431$at_check_filter
107432at_fn_diff_devnull "$at_stderr" || at_failed=:
107433$at_diff expout "$at_stdout" || at_failed=:
107434at_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#
107456cat >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"
107462at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107463( $at_check_trace;  $PREPARSER ./calc input
107464) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107465at_status=$? at_failed=false
107466$at_check_filter
107467echo stderr:; tee stderr <"$at_stderr"
107468at_fn_diff_devnull "$at_stdout" || at_failed=:
107469at_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"
107475at_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>&-
107478at_status=$? at_failed=false
107479$at_check_filter
107480echo stderr:; tee stderr <"$at_stderr"
107481at_fn_diff_devnull "$at_stdout" || at_failed=:
107482at_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.
107491sed '/^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
107506mv at-stderr stderr
107507# 2. Create the reference error message.
107508cat >expout <<'_ATEOF'
1075091.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1075101.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1075111.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1075121.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
107513calc: 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.
107519sed 's/syntax error, .*$/syntax error/' expout >at-expout
107520mv at-expout expout
107521# 5. Check
107522{ set +x
107523$as_echo "$at_srcdir/calc.at:680: cat stderr"
107524at_fn_check_prepare_trace "calc.at:680"
107525( $at_check_trace; cat stderr
107526) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107527at_status=$? at_failed=false
107528$at_check_filter
107529at_fn_diff_devnull "$at_stderr" || at_failed=:
107530$at_diff expout "$at_stdout" || at_failed=:
107531at_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.
107539cat >input <<'_ATEOF'
107540(!) + (1 2) = 1
107541_ATEOF
107542
107543{ set +x
107544$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107545at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107546( $at_check_trace;  $PREPARSER ./calc input
107547) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107548at_status=$? at_failed=false
107549$at_check_filter
107550echo stderr:; tee stderr <"$at_stderr"
107551at_fn_diff_devnull "$at_stdout" || at_failed=:
107552at_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"
107558at_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>&-
107561at_status=$? at_failed=false
107562$at_check_filter
107563echo stderr:; tee stderr <"$at_stderr"
107564at_fn_diff_devnull "$at_stdout" || at_failed=:
107565at_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.
107574sed '/^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
107589mv at-stderr stderr
107590# 2. Create the reference error message.
107591cat >expout <<'_ATEOF'
1075921.10: syntax error, unexpected number
107593calc: 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.
107599sed 's/syntax error, .*$/syntax error/' expout >at-expout
107600mv at-expout expout
107601# 5. Check
107602{ set +x
107603$as_echo "$at_srcdir/calc.at:680: cat stderr"
107604at_fn_check_prepare_trace "calc.at:680"
107605( $at_check_trace; cat stderr
107606) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107607at_status=$? at_failed=false
107608$at_check_filter
107609at_fn_diff_devnull "$at_stderr" || at_failed=:
107610$at_diff expout "$at_stdout" || at_failed=:
107611at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
107612$at_failed && at_fn_log_failure
107613$at_traceon; }
107614
107615
107616cat >input <<'_ATEOF'
107617(- *) + (1 2) = 1
107618_ATEOF
107619
107620{ set +x
107621$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107622at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107623( $at_check_trace;  $PREPARSER ./calc input
107624) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107625at_status=$? at_failed=false
107626$at_check_filter
107627echo stderr:; tee stderr <"$at_stderr"
107628at_fn_diff_devnull "$at_stdout" || at_failed=:
107629at_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"
107635at_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>&-
107638at_status=$? at_failed=false
107639$at_check_filter
107640echo stderr:; tee stderr <"$at_stderr"
107641at_fn_diff_devnull "$at_stdout" || at_failed=:
107642at_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.
107651sed '/^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
107666mv at-stderr stderr
107667# 2. Create the reference error message.
107668cat >expout <<'_ATEOF'
1076691.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1076701.12: syntax error, unexpected number
107671calc: 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.
107677sed 's/syntax error, .*$/syntax error/' expout >at-expout
107678mv at-expout expout
107679# 5. Check
107680{ set +x
107681$as_echo "$at_srcdir/calc.at:680: cat stderr"
107682at_fn_check_prepare_trace "calc.at:680"
107683( $at_check_trace; cat stderr
107684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107685at_status=$? at_failed=false
107686$at_check_filter
107687at_fn_diff_devnull "$at_stderr" || at_failed=:
107688$at_diff expout "$at_stdout" || at_failed=:
107689at_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.
107697cat >input <<'_ATEOF'
107698(* *) + (*) + (*)
107699_ATEOF
107700
107701{ set +x
107702$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
107703at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
107704( $at_check_trace;  $PREPARSER ./calc input
107705) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107706at_status=$? at_failed=false
107707$at_check_filter
107708echo stderr:; tee stderr <"$at_stderr"
107709at_fn_diff_devnull "$at_stdout" || at_failed=:
107710at_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"
107716at_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>&-
107719at_status=$? at_failed=false
107720$at_check_filter
107721echo stderr:; tee stderr <"$at_stderr"
107722at_fn_diff_devnull "$at_stdout" || at_failed=:
107723at_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.
107732sed '/^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
107747mv at-stderr stderr
107748# 2. Create the reference error message.
107749cat >expout <<'_ATEOF'
1077501.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1077511.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1077521.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.
107758sed 's/syntax error, .*$/syntax error/' expout >at-expout
107759mv at-expout expout
107760# 5. Check
107761{ set +x
107762$as_echo "$at_srcdir/calc.at:680: cat stderr"
107763at_fn_check_prepare_trace "calc.at:680"
107764( $at_check_trace; cat stderr
107765) >>"$at_stdout" 2>>"$at_stderr" 5>&-
107766at_status=$? at_failed=false
107767$at_check_filter
107768at_fn_diff_devnull "$at_stderr" || at_failed=:
107769$at_diff expout "$at_stdout" || at_failed=:
107770at_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
107781read at_status <"$at_status_file"
107782#AT_STOP_237
107783#AT_START_238
107784at_fn_group_banner 238 'calc.at:681' \
107785  "Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 13
107786at_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
107800cat >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
107841FILE *input;
107842static int power (int base, int exponent);
107843
107844
107845int 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%%
107863input:
107864  line
107865| input line         {  }
107866;
107867
107868line:
107869  '\n'
107870| exp '\n'           { USE ($1); }
107871;
107872
107873exp:
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
107894static int
107895power (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.  */
107906void
107907calc::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
107916cat >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
107927int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
107928static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
107929static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
107930
107931
107932static calc::parser::location_type last_yylloc;
107933
107934static int
107935get_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
107952static void
107953unget_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
107963static int
107964read_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
107995int 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
108025cat >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.  */
108044int
108045calcparse ()
108046{
108047  calc::parser parser;
108048#if YYDEBUG
108049  parser.set_debug_level (1);
108050#endif
108051  return parser.parse ();
108052}
108053
108054
108055semantic_value global_result = 0;
108056int global_count = 0;
108057
108058/* A C main function.  */
108059int
108060main (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
108098if 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"
108106at_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>&-
108110at_status=$? at_failed=false
108111$at_check_filter
108112echo stderr:; cat "$at_stderr"
108113echo stdout:; cat "$at_stdout"
108114at_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"
108120at_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>&-
108123at_status=$? at_failed=false
108124$at_check_filter
108125echo stderr:; cat "$at_stderr"
108126echo stdout:; cat "$at_stdout"
108127at_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"
108136at_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>&-
108141at_status=$? at_failed=false
108142$at_check_filter
108143at_fn_diff_devnull "$at_stderr" || at_failed=:
108144$at_diff expout "$at_stdout" || at_failed=:
108145at_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"
108154at_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>&-
108159at_status=$? at_failed=false
108160$at_check_filter
108161at_fn_diff_devnull "$at_stderr" || at_failed=:
108162$at_diff expout "$at_stdout" || at_failed=:
108163at_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
108169fi
108170{ set +x
108171$as_echo "$at_srcdir/calc.at:681: bison -o calc.cc calc.y"
108172at_fn_check_prepare_trace "calc.at:681"
108173( $at_check_trace; bison -o calc.cc calc.y
108174) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108175at_status=$? at_failed=false
108176$at_check_filter
108177at_fn_diff_devnull "$at_stderr" || at_failed=:
108178at_fn_diff_devnull "$at_stdout" || at_failed=:
108179at_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"
108187at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681"
108188( $at_check_trace; $BISON_CXX_WORKS
108189) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108190at_status=$? at_failed=false
108191$at_check_filter
108192echo stderr:; cat "$at_stderr"
108193echo stdout:; cat "$at_stdout"
108194at_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"
108200at_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>&-
108203at_status=$? at_failed=false
108204$at_check_filter
108205echo stderr:; cat "$at_stderr"
108206echo stdout:; cat "$at_stdout"
108207at_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"
108222at_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>&-
108233at_status=$? at_failed=false
108234$at_check_filter
108235at_fn_diff_devnull "$at_stderr" || at_failed=:
108236at_fn_diff_devnull "$at_stdout" || at_failed=:
108237at_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"
108251at_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>&-
108262at_status=$? at_failed=false
108263$at_check_filter
108264at_fn_diff_devnull "$at_stderr" || at_failed=:
108265at_fn_diff_devnull "$at_stdout" || at_failed=:
108266at_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.
108272cat >input <<'_ATEOF'
1082731 + 2 * 3 = 7
1082741 + 2 * -3 = -5
108275
108276-1^2 = -1
108277(-1)^2 = 1
108278
108279---1 = -1
108280
1082811 - 2 - 3 = -4
1082821 - (2 - 3) = 2
108283
1082842^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"
108290at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108291( $at_check_trace;  $PREPARSER ./calc input
108292) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108293at_status=$? at_failed=false
108294$at_check_filter
108295echo stderr:; tee stderr <"$at_stderr"
108296at_fn_diff_devnull "$at_stdout" || at_failed=:
108297at_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"
108303at_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>&-
108306at_status=$? at_failed=false
108307$at_check_filter
108308echo stderr:; tee stderr <"$at_stderr"
108309at_fn_diff_devnull "$at_stdout" || at_failed=:
108310at_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.
108318cat >input <<'_ATEOF'
1083191 2
108320_ATEOF
108321
108322{ set +x
108323$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108324at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108325( $at_check_trace;  $PREPARSER ./calc input
108326) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108327at_status=$? at_failed=false
108328$at_check_filter
108329echo stderr:; tee stderr <"$at_stderr"
108330at_fn_diff_devnull "$at_stdout" || at_failed=:
108331at_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"
108337at_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>&-
108340at_status=$? at_failed=false
108341$at_check_filter
108342echo stderr:; tee stderr <"$at_stderr"
108343at_fn_diff_devnull "$at_stdout" || at_failed=:
108344at_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.
108353sed '/^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
108368mv at-stderr stderr
108369# 2. Create the reference error message.
108370cat >expout <<'_ATEOF'
1083711.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"
108381at_fn_check_prepare_trace "calc.at:681"
108382( $at_check_trace; cat stderr
108383) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108384at_status=$? at_failed=false
108385$at_check_filter
108386at_fn_diff_devnull "$at_stderr" || at_failed=:
108387$at_diff expout "$at_stdout" || at_failed=:
108388at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
108389$at_failed && at_fn_log_failure
108390$at_traceon; }
108391
108392
108393cat >input <<'_ATEOF'
1083941//2
108395_ATEOF
108396
108397{ set +x
108398$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108399at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108400( $at_check_trace;  $PREPARSER ./calc input
108401) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108402at_status=$? at_failed=false
108403$at_check_filter
108404echo stderr:; tee stderr <"$at_stderr"
108405at_fn_diff_devnull "$at_stdout" || at_failed=:
108406at_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"
108412at_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>&-
108415at_status=$? at_failed=false
108416$at_check_filter
108417echo stderr:; tee stderr <"$at_stderr"
108418at_fn_diff_devnull "$at_stdout" || at_failed=:
108419at_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.
108428sed '/^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
108443mv at-stderr stderr
108444# 2. Create the reference error message.
108445cat >expout <<'_ATEOF'
1084461.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"
108456at_fn_check_prepare_trace "calc.at:681"
108457( $at_check_trace; cat stderr
108458) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108459at_status=$? at_failed=false
108460$at_check_filter
108461at_fn_diff_devnull "$at_stderr" || at_failed=:
108462$at_diff expout "$at_stdout" || at_failed=:
108463at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
108464$at_failed && at_fn_log_failure
108465$at_traceon; }
108466
108467
108468cat >input <<'_ATEOF'
108469error
108470_ATEOF
108471
108472{ set +x
108473$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108474at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108475( $at_check_trace;  $PREPARSER ./calc input
108476) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108477at_status=$? at_failed=false
108478$at_check_filter
108479echo stderr:; tee stderr <"$at_stderr"
108480at_fn_diff_devnull "$at_stdout" || at_failed=:
108481at_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"
108487at_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>&-
108490at_status=$? at_failed=false
108491$at_check_filter
108492echo stderr:; tee stderr <"$at_stderr"
108493at_fn_diff_devnull "$at_stdout" || at_failed=:
108494at_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.
108503sed '/^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
108518mv at-stderr stderr
108519# 2. Create the reference error message.
108520cat >expout <<'_ATEOF'
1085211.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"
108531at_fn_check_prepare_trace "calc.at:681"
108532( $at_check_trace; cat stderr
108533) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108534at_status=$? at_failed=false
108535$at_check_filter
108536at_fn_diff_devnull "$at_stderr" || at_failed=:
108537$at_diff expout "$at_stdout" || at_failed=:
108538at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
108539$at_failed && at_fn_log_failure
108540$at_traceon; }
108541
108542
108543cat >input <<'_ATEOF'
1085441 = 2 = 3
108545_ATEOF
108546
108547{ set +x
108548$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108549at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108550( $at_check_trace;  $PREPARSER ./calc input
108551) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108552at_status=$? at_failed=false
108553$at_check_filter
108554echo stderr:; tee stderr <"$at_stderr"
108555at_fn_diff_devnull "$at_stdout" || at_failed=:
108556at_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"
108562at_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>&-
108565at_status=$? at_failed=false
108566$at_check_filter
108567echo stderr:; tee stderr <"$at_stderr"
108568at_fn_diff_devnull "$at_stdout" || at_failed=:
108569at_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.
108578sed '/^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
108593mv at-stderr stderr
108594# 2. Create the reference error message.
108595cat >expout <<'_ATEOF'
1085961.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"
108606at_fn_check_prepare_trace "calc.at:681"
108607( $at_check_trace; cat stderr
108608) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108609at_status=$? at_failed=false
108610$at_check_filter
108611at_fn_diff_devnull "$at_stderr" || at_failed=:
108612$at_diff expout "$at_stdout" || at_failed=:
108613at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
108614$at_failed && at_fn_log_failure
108615$at_traceon; }
108616
108617
108618cat >input <<'_ATEOF'
108619
108620+1
108621_ATEOF
108622
108623{ set +x
108624$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108625at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108626( $at_check_trace;  $PREPARSER ./calc input
108627) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108628at_status=$? at_failed=false
108629$at_check_filter
108630echo stderr:; tee stderr <"$at_stderr"
108631at_fn_diff_devnull "$at_stdout" || at_failed=:
108632at_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"
108638at_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>&-
108641at_status=$? at_failed=false
108642$at_check_filter
108643echo stderr:; tee stderr <"$at_stderr"
108644at_fn_diff_devnull "$at_stdout" || at_failed=:
108645at_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.
108654sed '/^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
108669mv at-stderr stderr
108670# 2. Create the reference error message.
108671cat >expout <<'_ATEOF'
1086722.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"
108682at_fn_check_prepare_trace "calc.at:681"
108683( $at_check_trace; cat stderr
108684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108685at_status=$? at_failed=false
108686$at_check_filter
108687at_fn_diff_devnull "$at_stderr" || at_failed=:
108688$at_diff expout "$at_stdout" || at_failed=:
108689at_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"
108697at_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>&-
108700at_status=$? at_failed=false
108701$at_check_filter
108702echo stderr:; tee stderr <"$at_stderr"
108703at_fn_diff_devnull "$at_stdout" || at_failed=:
108704at_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"
108710at_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>&-
108713at_status=$? at_failed=false
108714$at_check_filter
108715echo stderr:; tee stderr <"$at_stderr"
108716at_fn_diff_devnull "$at_stdout" || at_failed=:
108717at_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.
108726sed '/^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
108741mv at-stderr stderr
108742# 2. Create the reference error message.
108743cat >expout <<'_ATEOF'
1087441.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"
108754at_fn_check_prepare_trace "calc.at:681"
108755( $at_check_trace; cat stderr
108756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108757at_status=$? at_failed=false
108758$at_check_filter
108759at_fn_diff_devnull "$at_stderr" || at_failed=:
108760$at_diff expout "$at_stdout" || at_failed=:
108761at_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#
108783cat >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"
108789at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108790( $at_check_trace;  $PREPARSER ./calc input
108791) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108792at_status=$? at_failed=false
108793$at_check_filter
108794echo stderr:; tee stderr <"$at_stderr"
108795at_fn_diff_devnull "$at_stdout" || at_failed=:
108796at_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"
108802at_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>&-
108805at_status=$? at_failed=false
108806$at_check_filter
108807echo stderr:; tee stderr <"$at_stderr"
108808at_fn_diff_devnull "$at_stdout" || at_failed=:
108809at_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.
108818sed '/^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
108833mv at-stderr stderr
108834# 2. Create the reference error message.
108835cat >expout <<'_ATEOF'
1088361.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1088371.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1088381.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1088391.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
108840calc: 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"
108850at_fn_check_prepare_trace "calc.at:681"
108851( $at_check_trace; cat stderr
108852) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108853at_status=$? at_failed=false
108854$at_check_filter
108855at_fn_diff_devnull "$at_stderr" || at_failed=:
108856$at_diff expout "$at_stdout" || at_failed=:
108857at_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.
108865cat >input <<'_ATEOF'
108866(!) + (1 2) = 1
108867_ATEOF
108868
108869{ set +x
108870$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108871at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108872( $at_check_trace;  $PREPARSER ./calc input
108873) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108874at_status=$? at_failed=false
108875$at_check_filter
108876echo stderr:; tee stderr <"$at_stderr"
108877at_fn_diff_devnull "$at_stdout" || at_failed=:
108878at_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"
108884at_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>&-
108887at_status=$? at_failed=false
108888$at_check_filter
108889echo stderr:; tee stderr <"$at_stderr"
108890at_fn_diff_devnull "$at_stdout" || at_failed=:
108891at_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.
108900sed '/^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
108915mv at-stderr stderr
108916# 2. Create the reference error message.
108917cat >expout <<'_ATEOF'
1089181.10: syntax error, unexpected number
108919calc: 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"
108929at_fn_check_prepare_trace "calc.at:681"
108930( $at_check_trace; cat stderr
108931) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108932at_status=$? at_failed=false
108933$at_check_filter
108934at_fn_diff_devnull "$at_stderr" || at_failed=:
108935$at_diff expout "$at_stdout" || at_failed=:
108936at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
108937$at_failed && at_fn_log_failure
108938$at_traceon; }
108939
108940
108941cat >input <<'_ATEOF'
108942(- *) + (1 2) = 1
108943_ATEOF
108944
108945{ set +x
108946$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
108947at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
108948( $at_check_trace;  $PREPARSER ./calc input
108949) >>"$at_stdout" 2>>"$at_stderr" 5>&-
108950at_status=$? at_failed=false
108951$at_check_filter
108952echo stderr:; tee stderr <"$at_stderr"
108953at_fn_diff_devnull "$at_stdout" || at_failed=:
108954at_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"
108960at_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>&-
108963at_status=$? at_failed=false
108964$at_check_filter
108965echo stderr:; tee stderr <"$at_stderr"
108966at_fn_diff_devnull "$at_stdout" || at_failed=:
108967at_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.
108976sed '/^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
108991mv at-stderr stderr
108992# 2. Create the reference error message.
108993cat >expout <<'_ATEOF'
1089941.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1089951.12: syntax error, unexpected number
108996calc: 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"
109006at_fn_check_prepare_trace "calc.at:681"
109007( $at_check_trace; cat stderr
109008) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109009at_status=$? at_failed=false
109010$at_check_filter
109011at_fn_diff_devnull "$at_stderr" || at_failed=:
109012$at_diff expout "$at_stdout" || at_failed=:
109013at_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.
109021cat >input <<'_ATEOF'
109022(* *) + (*) + (*)
109023_ATEOF
109024
109025{ set +x
109026$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
109027at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
109028( $at_check_trace;  $PREPARSER ./calc input
109029) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109030at_status=$? at_failed=false
109031$at_check_filter
109032echo stderr:; tee stderr <"$at_stderr"
109033at_fn_diff_devnull "$at_stdout" || at_failed=:
109034at_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"
109040at_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>&-
109043at_status=$? at_failed=false
109044$at_check_filter
109045echo stderr:; tee stderr <"$at_stderr"
109046at_fn_diff_devnull "$at_stdout" || at_failed=:
109047at_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.
109056sed '/^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
109071mv at-stderr stderr
109072# 2. Create the reference error message.
109073cat >expout <<'_ATEOF'
1090741.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1090751.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1090761.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"
109086at_fn_check_prepare_trace "calc.at:681"
109087( $at_check_trace; cat stderr
109088) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109089at_status=$? at_failed=false
109090$at_check_filter
109091at_fn_diff_devnull "$at_stderr" || at_failed=:
109092$at_diff expout "$at_stdout" || at_failed=:
109093at_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
109104read at_status <"$at_status_file"
109105#AT_STOP_238
109106#AT_START_239
109107at_fn_group_banner 239 'calc.at:682' \
109108  "Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 13
109109at_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
109123cat >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
109164FILE *input;
109165static int power (int base, int exponent);
109166
109167
109168int 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%%
109186input:
109187  line
109188| input line         {  }
109189;
109190
109191line:
109192  '\n'
109193| exp '\n'           { USE ($1); }
109194;
109195
109196exp:
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
109217static int
109218power (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.  */
109229void
109230calc::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
109239cat >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
109250int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
109251static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
109252static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
109253
109254
109255static calc::parser::location_type last_yylloc;
109256
109257static int
109258get_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
109275static void
109276unget_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
109286static int
109287read_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
109318int 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
109348cat >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.  */
109367int
109368calcparse ()
109369{
109370  calc::parser parser;
109371#if CALCDEBUG
109372  parser.set_debug_level (1);
109373#endif
109374  return parser.parse ();
109375}
109376
109377
109378semantic_value global_result = 0;
109379int global_count = 0;
109380
109381/* A C main function.  */
109382int
109383main (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
109421if 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"
109429at_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>&-
109433at_status=$? at_failed=false
109434$at_check_filter
109435echo stderr:; cat "$at_stderr"
109436echo stdout:; cat "$at_stdout"
109437at_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"
109443at_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>&-
109446at_status=$? at_failed=false
109447$at_check_filter
109448echo stderr:; cat "$at_stderr"
109449echo stdout:; cat "$at_stdout"
109450at_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"
109459at_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>&-
109464at_status=$? at_failed=false
109465$at_check_filter
109466at_fn_diff_devnull "$at_stderr" || at_failed=:
109467$at_diff expout "$at_stdout" || at_failed=:
109468at_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"
109477at_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>&-
109482at_status=$? at_failed=false
109483$at_check_filter
109484at_fn_diff_devnull "$at_stderr" || at_failed=:
109485$at_diff expout "$at_stdout" || at_failed=:
109486at_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
109492fi
109493{ set +x
109494$as_echo "$at_srcdir/calc.at:682: bison -o calc.cc calc.y"
109495at_fn_check_prepare_trace "calc.at:682"
109496( $at_check_trace; bison -o calc.cc calc.y
109497) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109498at_status=$? at_failed=false
109499$at_check_filter
109500at_fn_diff_devnull "$at_stderr" || at_failed=:
109501at_fn_diff_devnull "$at_stdout" || at_failed=:
109502at_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"
109510at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:682"
109511( $at_check_trace; $BISON_CXX_WORKS
109512) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109513at_status=$? at_failed=false
109514$at_check_filter
109515echo stderr:; cat "$at_stderr"
109516echo stdout:; cat "$at_stdout"
109517at_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"
109523at_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>&-
109526at_status=$? at_failed=false
109527$at_check_filter
109528echo stderr:; cat "$at_stderr"
109529echo stdout:; cat "$at_stdout"
109530at_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"
109545at_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>&-
109556at_status=$? at_failed=false
109557$at_check_filter
109558at_fn_diff_devnull "$at_stderr" || at_failed=:
109559at_fn_diff_devnull "$at_stdout" || at_failed=:
109560at_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"
109574at_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>&-
109585at_status=$? at_failed=false
109586$at_check_filter
109587at_fn_diff_devnull "$at_stderr" || at_failed=:
109588at_fn_diff_devnull "$at_stdout" || at_failed=:
109589at_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.
109595cat >input <<'_ATEOF'
1095961 + 2 * 3 = 7
1095971 + 2 * -3 = -5
109598
109599-1^2 = -1
109600(-1)^2 = 1
109601
109602---1 = -1
109603
1096041 - 2 - 3 = -4
1096051 - (2 - 3) = 2
109606
1096072^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"
109613at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109614( $at_check_trace;  $PREPARSER ./calc input
109615) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109616at_status=$? at_failed=false
109617$at_check_filter
109618echo stderr:; tee stderr <"$at_stderr"
109619at_fn_diff_devnull "$at_stdout" || at_failed=:
109620at_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"
109626at_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>&-
109629at_status=$? at_failed=false
109630$at_check_filter
109631echo stderr:; tee stderr <"$at_stderr"
109632at_fn_diff_devnull "$at_stdout" || at_failed=:
109633at_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.
109641cat >input <<'_ATEOF'
1096421 2
109643_ATEOF
109644
109645{ set +x
109646$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
109647at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109648( $at_check_trace;  $PREPARSER ./calc input
109649) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109650at_status=$? at_failed=false
109651$at_check_filter
109652echo stderr:; tee stderr <"$at_stderr"
109653at_fn_diff_devnull "$at_stdout" || at_failed=:
109654at_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"
109660at_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>&-
109663at_status=$? at_failed=false
109664$at_check_filter
109665echo stderr:; tee stderr <"$at_stderr"
109666at_fn_diff_devnull "$at_stdout" || at_failed=:
109667at_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.
109676sed '/^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
109691mv at-stderr stderr
109692# 2. Create the reference error message.
109693cat >expout <<'_ATEOF'
1096941.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"
109704at_fn_check_prepare_trace "calc.at:682"
109705( $at_check_trace; cat stderr
109706) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109707at_status=$? at_failed=false
109708$at_check_filter
109709at_fn_diff_devnull "$at_stderr" || at_failed=:
109710$at_diff expout "$at_stdout" || at_failed=:
109711at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
109712$at_failed && at_fn_log_failure
109713$at_traceon; }
109714
109715
109716cat >input <<'_ATEOF'
1097171//2
109718_ATEOF
109719
109720{ set +x
109721$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
109722at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109723( $at_check_trace;  $PREPARSER ./calc input
109724) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109725at_status=$? at_failed=false
109726$at_check_filter
109727echo stderr:; tee stderr <"$at_stderr"
109728at_fn_diff_devnull "$at_stdout" || at_failed=:
109729at_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"
109735at_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>&-
109738at_status=$? at_failed=false
109739$at_check_filter
109740echo stderr:; tee stderr <"$at_stderr"
109741at_fn_diff_devnull "$at_stdout" || at_failed=:
109742at_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.
109751sed '/^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
109766mv at-stderr stderr
109767# 2. Create the reference error message.
109768cat >expout <<'_ATEOF'
1097691.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"
109779at_fn_check_prepare_trace "calc.at:682"
109780( $at_check_trace; cat stderr
109781) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109782at_status=$? at_failed=false
109783$at_check_filter
109784at_fn_diff_devnull "$at_stderr" || at_failed=:
109785$at_diff expout "$at_stdout" || at_failed=:
109786at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
109787$at_failed && at_fn_log_failure
109788$at_traceon; }
109789
109790
109791cat >input <<'_ATEOF'
109792error
109793_ATEOF
109794
109795{ set +x
109796$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
109797at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109798( $at_check_trace;  $PREPARSER ./calc input
109799) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109800at_status=$? at_failed=false
109801$at_check_filter
109802echo stderr:; tee stderr <"$at_stderr"
109803at_fn_diff_devnull "$at_stdout" || at_failed=:
109804at_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"
109810at_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>&-
109813at_status=$? at_failed=false
109814$at_check_filter
109815echo stderr:; tee stderr <"$at_stderr"
109816at_fn_diff_devnull "$at_stdout" || at_failed=:
109817at_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.
109826sed '/^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
109841mv at-stderr stderr
109842# 2. Create the reference error message.
109843cat >expout <<'_ATEOF'
1098441.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"
109854at_fn_check_prepare_trace "calc.at:682"
109855( $at_check_trace; cat stderr
109856) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109857at_status=$? at_failed=false
109858$at_check_filter
109859at_fn_diff_devnull "$at_stderr" || at_failed=:
109860$at_diff expout "$at_stdout" || at_failed=:
109861at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
109862$at_failed && at_fn_log_failure
109863$at_traceon; }
109864
109865
109866cat >input <<'_ATEOF'
1098671 = 2 = 3
109868_ATEOF
109869
109870{ set +x
109871$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
109872at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109873( $at_check_trace;  $PREPARSER ./calc input
109874) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109875at_status=$? at_failed=false
109876$at_check_filter
109877echo stderr:; tee stderr <"$at_stderr"
109878at_fn_diff_devnull "$at_stdout" || at_failed=:
109879at_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"
109885at_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>&-
109888at_status=$? at_failed=false
109889$at_check_filter
109890echo stderr:; tee stderr <"$at_stderr"
109891at_fn_diff_devnull "$at_stdout" || at_failed=:
109892at_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.
109901sed '/^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
109916mv at-stderr stderr
109917# 2. Create the reference error message.
109918cat >expout <<'_ATEOF'
1099191.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"
109929at_fn_check_prepare_trace "calc.at:682"
109930( $at_check_trace; cat stderr
109931) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109932at_status=$? at_failed=false
109933$at_check_filter
109934at_fn_diff_devnull "$at_stderr" || at_failed=:
109935$at_diff expout "$at_stdout" || at_failed=:
109936at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
109937$at_failed && at_fn_log_failure
109938$at_traceon; }
109939
109940
109941cat >input <<'_ATEOF'
109942
109943+1
109944_ATEOF
109945
109946{ set +x
109947$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
109948at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
109949( $at_check_trace;  $PREPARSER ./calc input
109950) >>"$at_stdout" 2>>"$at_stderr" 5>&-
109951at_status=$? at_failed=false
109952$at_check_filter
109953echo stderr:; tee stderr <"$at_stderr"
109954at_fn_diff_devnull "$at_stdout" || at_failed=:
109955at_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"
109961at_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>&-
109964at_status=$? at_failed=false
109965$at_check_filter
109966echo stderr:; tee stderr <"$at_stderr"
109967at_fn_diff_devnull "$at_stdout" || at_failed=:
109968at_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.
109977sed '/^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
109992mv at-stderr stderr
109993# 2. Create the reference error message.
109994cat >expout <<'_ATEOF'
1099952.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"
110005at_fn_check_prepare_trace "calc.at:682"
110006( $at_check_trace; cat stderr
110007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110008at_status=$? at_failed=false
110009$at_check_filter
110010at_fn_diff_devnull "$at_stderr" || at_failed=:
110011$at_diff expout "$at_stdout" || at_failed=:
110012at_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"
110020at_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>&-
110023at_status=$? at_failed=false
110024$at_check_filter
110025echo stderr:; tee stderr <"$at_stderr"
110026at_fn_diff_devnull "$at_stdout" || at_failed=:
110027at_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"
110033at_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>&-
110036at_status=$? at_failed=false
110037$at_check_filter
110038echo stderr:; tee stderr <"$at_stderr"
110039at_fn_diff_devnull "$at_stdout" || at_failed=:
110040at_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.
110049sed '/^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
110064mv at-stderr stderr
110065# 2. Create the reference error message.
110066cat >expout <<'_ATEOF'
1100671.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"
110077at_fn_check_prepare_trace "calc.at:682"
110078( $at_check_trace; cat stderr
110079) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110080at_status=$? at_failed=false
110081$at_check_filter
110082at_fn_diff_devnull "$at_stderr" || at_failed=:
110083$at_diff expout "$at_stdout" || at_failed=:
110084at_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#
110106cat >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"
110112at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
110113( $at_check_trace;  $PREPARSER ./calc input
110114) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110115at_status=$? at_failed=false
110116$at_check_filter
110117echo stderr:; tee stderr <"$at_stderr"
110118at_fn_diff_devnull "$at_stdout" || at_failed=:
110119at_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"
110125at_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>&-
110128at_status=$? at_failed=false
110129$at_check_filter
110130echo stderr:; tee stderr <"$at_stderr"
110131at_fn_diff_devnull "$at_stdout" || at_failed=:
110132at_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.
110141sed '/^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
110156mv at-stderr stderr
110157# 2. Create the reference error message.
110158cat >expout <<'_ATEOF'
1101591.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1101601.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1101611.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1101621.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
110163calc: 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"
110173at_fn_check_prepare_trace "calc.at:682"
110174( $at_check_trace; cat stderr
110175) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110176at_status=$? at_failed=false
110177$at_check_filter
110178at_fn_diff_devnull "$at_stderr" || at_failed=:
110179$at_diff expout "$at_stdout" || at_failed=:
110180at_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.
110188cat >input <<'_ATEOF'
110189(!) + (1 2) = 1
110190_ATEOF
110191
110192{ set +x
110193$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
110194at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
110195( $at_check_trace;  $PREPARSER ./calc input
110196) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110197at_status=$? at_failed=false
110198$at_check_filter
110199echo stderr:; tee stderr <"$at_stderr"
110200at_fn_diff_devnull "$at_stdout" || at_failed=:
110201at_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"
110207at_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>&-
110210at_status=$? at_failed=false
110211$at_check_filter
110212echo stderr:; tee stderr <"$at_stderr"
110213at_fn_diff_devnull "$at_stdout" || at_failed=:
110214at_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.
110223sed '/^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
110238mv at-stderr stderr
110239# 2. Create the reference error message.
110240cat >expout <<'_ATEOF'
1102411.10: syntax error, unexpected number
110242calc: 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"
110252at_fn_check_prepare_trace "calc.at:682"
110253( $at_check_trace; cat stderr
110254) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110255at_status=$? at_failed=false
110256$at_check_filter
110257at_fn_diff_devnull "$at_stderr" || at_failed=:
110258$at_diff expout "$at_stdout" || at_failed=:
110259at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
110260$at_failed && at_fn_log_failure
110261$at_traceon; }
110262
110263
110264cat >input <<'_ATEOF'
110265(- *) + (1 2) = 1
110266_ATEOF
110267
110268{ set +x
110269$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
110270at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
110271( $at_check_trace;  $PREPARSER ./calc input
110272) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110273at_status=$? at_failed=false
110274$at_check_filter
110275echo stderr:; tee stderr <"$at_stderr"
110276at_fn_diff_devnull "$at_stdout" || at_failed=:
110277at_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"
110283at_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>&-
110286at_status=$? at_failed=false
110287$at_check_filter
110288echo stderr:; tee stderr <"$at_stderr"
110289at_fn_diff_devnull "$at_stdout" || at_failed=:
110290at_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.
110299sed '/^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
110314mv at-stderr stderr
110315# 2. Create the reference error message.
110316cat >expout <<'_ATEOF'
1103171.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1103181.12: syntax error, unexpected number
110319calc: 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"
110329at_fn_check_prepare_trace "calc.at:682"
110330( $at_check_trace; cat stderr
110331) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110332at_status=$? at_failed=false
110333$at_check_filter
110334at_fn_diff_devnull "$at_stderr" || at_failed=:
110335$at_diff expout "$at_stdout" || at_failed=:
110336at_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.
110344cat >input <<'_ATEOF'
110345(* *) + (*) + (*)
110346_ATEOF
110347
110348{ set +x
110349$as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
110350at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
110351( $at_check_trace;  $PREPARSER ./calc input
110352) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110353at_status=$? at_failed=false
110354$at_check_filter
110355echo stderr:; tee stderr <"$at_stderr"
110356at_fn_diff_devnull "$at_stdout" || at_failed=:
110357at_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"
110363at_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>&-
110366at_status=$? at_failed=false
110367$at_check_filter
110368echo stderr:; tee stderr <"$at_stderr"
110369at_fn_diff_devnull "$at_stdout" || at_failed=:
110370at_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.
110379sed '/^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
110394mv at-stderr stderr
110395# 2. Create the reference error message.
110396cat >expout <<'_ATEOF'
1103971.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1103981.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1103991.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"
110409at_fn_check_prepare_trace "calc.at:682"
110410( $at_check_trace; cat stderr
110411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110412at_status=$? at_failed=false
110413$at_check_filter
110414at_fn_diff_devnull "$at_stderr" || at_failed=:
110415$at_diff expout "$at_stdout" || at_failed=:
110416at_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
110427read at_status <"$at_status_file"
110428#AT_STOP_239
110429#AT_START_240
110430at_fn_group_banner 240 'calc.at:683' \
110431  "Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 13
110432at_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
110446cat >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
110487FILE *input;
110488static int power (int base, int exponent);
110489
110490
110491int 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%%
110509input:
110510  line
110511| input line         {  }
110512;
110513
110514line:
110515  '\n'
110516| exp '\n'           { USE ($1); }
110517;
110518
110519exp:
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
110540static int
110541power (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.  */
110552void
110553calc::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
110562cat >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
110573int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
110574static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
110575static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
110576
110577
110578static calc::parser::location_type last_yylloc;
110579
110580static int
110581get_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
110598static void
110599unget_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
110609static int
110610read_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
110641int 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
110671cat >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.  */
110690int
110691calcparse ()
110692{
110693  calc::parser parser;
110694#if YYDEBUG
110695  parser.set_debug_level (1);
110696#endif
110697  return parser.parse ();
110698}
110699
110700
110701semantic_value global_result = 0;
110702int global_count = 0;
110703
110704/* A C main function.  */
110705int
110706main (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
110744if 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"
110752at_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>&-
110756at_status=$? at_failed=false
110757$at_check_filter
110758echo stderr:; cat "$at_stderr"
110759echo stdout:; cat "$at_stdout"
110760at_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"
110766at_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>&-
110769at_status=$? at_failed=false
110770$at_check_filter
110771echo stderr:; cat "$at_stderr"
110772echo stdout:; cat "$at_stdout"
110773at_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"
110782at_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>&-
110787at_status=$? at_failed=false
110788$at_check_filter
110789at_fn_diff_devnull "$at_stderr" || at_failed=:
110790$at_diff expout "$at_stdout" || at_failed=:
110791at_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"
110800at_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>&-
110805at_status=$? at_failed=false
110806$at_check_filter
110807at_fn_diff_devnull "$at_stderr" || at_failed=:
110808$at_diff expout "$at_stdout" || at_failed=:
110809at_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
110815fi
110816{ set +x
110817$as_echo "$at_srcdir/calc.at:683: bison -o calc.cc calc.y"
110818at_fn_check_prepare_trace "calc.at:683"
110819( $at_check_trace; bison -o calc.cc calc.y
110820) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110821at_status=$? at_failed=false
110822$at_check_filter
110823at_fn_diff_devnull "$at_stderr" || at_failed=:
110824at_fn_diff_devnull "$at_stdout" || at_failed=:
110825at_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"
110833at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683"
110834( $at_check_trace; $BISON_CXX_WORKS
110835) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110836at_status=$? at_failed=false
110837$at_check_filter
110838echo stderr:; cat "$at_stderr"
110839echo stdout:; cat "$at_stdout"
110840at_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"
110846at_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>&-
110849at_status=$? at_failed=false
110850$at_check_filter
110851echo stderr:; cat "$at_stderr"
110852echo stdout:; cat "$at_stdout"
110853at_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"
110868at_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>&-
110879at_status=$? at_failed=false
110880$at_check_filter
110881at_fn_diff_devnull "$at_stderr" || at_failed=:
110882at_fn_diff_devnull "$at_stdout" || at_failed=:
110883at_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"
110897at_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>&-
110908at_status=$? at_failed=false
110909$at_check_filter
110910at_fn_diff_devnull "$at_stderr" || at_failed=:
110911at_fn_diff_devnull "$at_stdout" || at_failed=:
110912at_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.
110918cat >input <<'_ATEOF'
1109191 + 2 * 3 = 7
1109201 + 2 * -3 = -5
110921
110922-1^2 = -1
110923(-1)^2 = 1
110924
110925---1 = -1
110926
1109271 - 2 - 3 = -4
1109281 - (2 - 3) = 2
110929
1109302^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"
110936at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
110937( $at_check_trace;  $PREPARSER ./calc input
110938) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110939at_status=$? at_failed=false
110940$at_check_filter
110941echo stderr:; tee stderr <"$at_stderr"
110942at_fn_diff_devnull "$at_stdout" || at_failed=:
110943at_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"
110949at_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>&-
110952at_status=$? at_failed=false
110953$at_check_filter
110954echo stderr:; tee stderr <"$at_stderr"
110955at_fn_diff_devnull "$at_stdout" || at_failed=:
110956at_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.
110964cat >input <<'_ATEOF'
1109651 2
110966_ATEOF
110967
110968{ set +x
110969$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
110970at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
110971( $at_check_trace;  $PREPARSER ./calc input
110972) >>"$at_stdout" 2>>"$at_stderr" 5>&-
110973at_status=$? at_failed=false
110974$at_check_filter
110975echo stderr:; tee stderr <"$at_stderr"
110976at_fn_diff_devnull "$at_stdout" || at_failed=:
110977at_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"
110983at_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>&-
110986at_status=$? at_failed=false
110987$at_check_filter
110988echo stderr:; tee stderr <"$at_stderr"
110989at_fn_diff_devnull "$at_stdout" || at_failed=:
110990at_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.
110999sed '/^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
111014mv at-stderr stderr
111015# 2. Create the reference error message.
111016cat >expout <<'_ATEOF'
1110171.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"
111027at_fn_check_prepare_trace "calc.at:683"
111028( $at_check_trace; cat stderr
111029) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111030at_status=$? at_failed=false
111031$at_check_filter
111032at_fn_diff_devnull "$at_stderr" || at_failed=:
111033$at_diff expout "$at_stdout" || at_failed=:
111034at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
111035$at_failed && at_fn_log_failure
111036$at_traceon; }
111037
111038
111039cat >input <<'_ATEOF'
1110401//2
111041_ATEOF
111042
111043{ set +x
111044$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111045at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111046( $at_check_trace;  $PREPARSER ./calc input
111047) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111048at_status=$? at_failed=false
111049$at_check_filter
111050echo stderr:; tee stderr <"$at_stderr"
111051at_fn_diff_devnull "$at_stdout" || at_failed=:
111052at_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"
111058at_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>&-
111061at_status=$? at_failed=false
111062$at_check_filter
111063echo stderr:; tee stderr <"$at_stderr"
111064at_fn_diff_devnull "$at_stdout" || at_failed=:
111065at_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.
111074sed '/^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
111089mv at-stderr stderr
111090# 2. Create the reference error message.
111091cat >expout <<'_ATEOF'
1110921.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"
111102at_fn_check_prepare_trace "calc.at:683"
111103( $at_check_trace; cat stderr
111104) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111105at_status=$? at_failed=false
111106$at_check_filter
111107at_fn_diff_devnull "$at_stderr" || at_failed=:
111108$at_diff expout "$at_stdout" || at_failed=:
111109at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
111110$at_failed && at_fn_log_failure
111111$at_traceon; }
111112
111113
111114cat >input <<'_ATEOF'
111115error
111116_ATEOF
111117
111118{ set +x
111119$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111120at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111121( $at_check_trace;  $PREPARSER ./calc input
111122) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111123at_status=$? at_failed=false
111124$at_check_filter
111125echo stderr:; tee stderr <"$at_stderr"
111126at_fn_diff_devnull "$at_stdout" || at_failed=:
111127at_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"
111133at_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>&-
111136at_status=$? at_failed=false
111137$at_check_filter
111138echo stderr:; tee stderr <"$at_stderr"
111139at_fn_diff_devnull "$at_stdout" || at_failed=:
111140at_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.
111149sed '/^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
111164mv at-stderr stderr
111165# 2. Create the reference error message.
111166cat >expout <<'_ATEOF'
1111671.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"
111177at_fn_check_prepare_trace "calc.at:683"
111178( $at_check_trace; cat stderr
111179) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111180at_status=$? at_failed=false
111181$at_check_filter
111182at_fn_diff_devnull "$at_stderr" || at_failed=:
111183$at_diff expout "$at_stdout" || at_failed=:
111184at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
111185$at_failed && at_fn_log_failure
111186$at_traceon; }
111187
111188
111189cat >input <<'_ATEOF'
1111901 = 2 = 3
111191_ATEOF
111192
111193{ set +x
111194$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111195at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111196( $at_check_trace;  $PREPARSER ./calc input
111197) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111198at_status=$? at_failed=false
111199$at_check_filter
111200echo stderr:; tee stderr <"$at_stderr"
111201at_fn_diff_devnull "$at_stdout" || at_failed=:
111202at_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"
111208at_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>&-
111211at_status=$? at_failed=false
111212$at_check_filter
111213echo stderr:; tee stderr <"$at_stderr"
111214at_fn_diff_devnull "$at_stdout" || at_failed=:
111215at_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.
111224sed '/^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
111239mv at-stderr stderr
111240# 2. Create the reference error message.
111241cat >expout <<'_ATEOF'
1112421.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"
111252at_fn_check_prepare_trace "calc.at:683"
111253( $at_check_trace; cat stderr
111254) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111255at_status=$? at_failed=false
111256$at_check_filter
111257at_fn_diff_devnull "$at_stderr" || at_failed=:
111258$at_diff expout "$at_stdout" || at_failed=:
111259at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
111260$at_failed && at_fn_log_failure
111261$at_traceon; }
111262
111263
111264cat >input <<'_ATEOF'
111265
111266+1
111267_ATEOF
111268
111269{ set +x
111270$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111271at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111272( $at_check_trace;  $PREPARSER ./calc input
111273) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111274at_status=$? at_failed=false
111275$at_check_filter
111276echo stderr:; tee stderr <"$at_stderr"
111277at_fn_diff_devnull "$at_stdout" || at_failed=:
111278at_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"
111284at_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>&-
111287at_status=$? at_failed=false
111288$at_check_filter
111289echo stderr:; tee stderr <"$at_stderr"
111290at_fn_diff_devnull "$at_stdout" || at_failed=:
111291at_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.
111300sed '/^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
111315mv at-stderr stderr
111316# 2. Create the reference error message.
111317cat >expout <<'_ATEOF'
1113182.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"
111328at_fn_check_prepare_trace "calc.at:683"
111329( $at_check_trace; cat stderr
111330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111331at_status=$? at_failed=false
111332$at_check_filter
111333at_fn_diff_devnull "$at_stderr" || at_failed=:
111334$at_diff expout "$at_stdout" || at_failed=:
111335at_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"
111343at_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>&-
111346at_status=$? at_failed=false
111347$at_check_filter
111348echo stderr:; tee stderr <"$at_stderr"
111349at_fn_diff_devnull "$at_stdout" || at_failed=:
111350at_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"
111356at_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>&-
111359at_status=$? at_failed=false
111360$at_check_filter
111361echo stderr:; tee stderr <"$at_stderr"
111362at_fn_diff_devnull "$at_stdout" || at_failed=:
111363at_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.
111372sed '/^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
111387mv at-stderr stderr
111388# 2. Create the reference error message.
111389cat >expout <<'_ATEOF'
1113901.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"
111400at_fn_check_prepare_trace "calc.at:683"
111401( $at_check_trace; cat stderr
111402) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111403at_status=$? at_failed=false
111404$at_check_filter
111405at_fn_diff_devnull "$at_stderr" || at_failed=:
111406$at_diff expout "$at_stdout" || at_failed=:
111407at_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#
111429cat >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"
111435at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111436( $at_check_trace;  $PREPARSER ./calc input
111437) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111438at_status=$? at_failed=false
111439$at_check_filter
111440echo stderr:; tee stderr <"$at_stderr"
111441at_fn_diff_devnull "$at_stdout" || at_failed=:
111442at_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"
111448at_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>&-
111451at_status=$? at_failed=false
111452$at_check_filter
111453echo stderr:; tee stderr <"$at_stderr"
111454at_fn_diff_devnull "$at_stdout" || at_failed=:
111455at_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.
111464sed '/^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
111479mv at-stderr stderr
111480# 2. Create the reference error message.
111481cat >expout <<'_ATEOF'
1114821.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1114831.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1114841.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1114851.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
111486calc: 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"
111496at_fn_check_prepare_trace "calc.at:683"
111497( $at_check_trace; cat stderr
111498) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111499at_status=$? at_failed=false
111500$at_check_filter
111501at_fn_diff_devnull "$at_stderr" || at_failed=:
111502$at_diff expout "$at_stdout" || at_failed=:
111503at_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.
111511cat >input <<'_ATEOF'
111512(!) + (1 2) = 1
111513_ATEOF
111514
111515{ set +x
111516$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111517at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111518( $at_check_trace;  $PREPARSER ./calc input
111519) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111520at_status=$? at_failed=false
111521$at_check_filter
111522echo stderr:; tee stderr <"$at_stderr"
111523at_fn_diff_devnull "$at_stdout" || at_failed=:
111524at_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"
111530at_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>&-
111533at_status=$? at_failed=false
111534$at_check_filter
111535echo stderr:; tee stderr <"$at_stderr"
111536at_fn_diff_devnull "$at_stdout" || at_failed=:
111537at_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.
111546sed '/^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
111561mv at-stderr stderr
111562# 2. Create the reference error message.
111563cat >expout <<'_ATEOF'
1115641.10: syntax error, unexpected number
111565calc: 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"
111575at_fn_check_prepare_trace "calc.at:683"
111576( $at_check_trace; cat stderr
111577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111578at_status=$? at_failed=false
111579$at_check_filter
111580at_fn_diff_devnull "$at_stderr" || at_failed=:
111581$at_diff expout "$at_stdout" || at_failed=:
111582at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
111583$at_failed && at_fn_log_failure
111584$at_traceon; }
111585
111586
111587cat >input <<'_ATEOF'
111588(- *) + (1 2) = 1
111589_ATEOF
111590
111591{ set +x
111592$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111593at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111594( $at_check_trace;  $PREPARSER ./calc input
111595) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111596at_status=$? at_failed=false
111597$at_check_filter
111598echo stderr:; tee stderr <"$at_stderr"
111599at_fn_diff_devnull "$at_stdout" || at_failed=:
111600at_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"
111606at_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>&-
111609at_status=$? at_failed=false
111610$at_check_filter
111611echo stderr:; tee stderr <"$at_stderr"
111612at_fn_diff_devnull "$at_stdout" || at_failed=:
111613at_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.
111622sed '/^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
111637mv at-stderr stderr
111638# 2. Create the reference error message.
111639cat >expout <<'_ATEOF'
1116401.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1116411.12: syntax error, unexpected number
111642calc: 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"
111652at_fn_check_prepare_trace "calc.at:683"
111653( $at_check_trace; cat stderr
111654) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111655at_status=$? at_failed=false
111656$at_check_filter
111657at_fn_diff_devnull "$at_stderr" || at_failed=:
111658$at_diff expout "$at_stdout" || at_failed=:
111659at_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.
111667cat >input <<'_ATEOF'
111668(* *) + (*) + (*)
111669_ATEOF
111670
111671{ set +x
111672$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
111673at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
111674( $at_check_trace;  $PREPARSER ./calc input
111675) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111676at_status=$? at_failed=false
111677$at_check_filter
111678echo stderr:; tee stderr <"$at_stderr"
111679at_fn_diff_devnull "$at_stdout" || at_failed=:
111680at_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"
111686at_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>&-
111689at_status=$? at_failed=false
111690$at_check_filter
111691echo stderr:; tee stderr <"$at_stderr"
111692at_fn_diff_devnull "$at_stdout" || at_failed=:
111693at_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.
111702sed '/^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
111717mv at-stderr stderr
111718# 2. Create the reference error message.
111719cat >expout <<'_ATEOF'
1117201.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1117211.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1117221.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"
111732at_fn_check_prepare_trace "calc.at:683"
111733( $at_check_trace; cat stderr
111734) >>"$at_stdout" 2>>"$at_stderr" 5>&-
111735at_status=$? at_failed=false
111736$at_check_filter
111737at_fn_diff_devnull "$at_stderr" || at_failed=:
111738$at_diff expout "$at_stdout" || at_failed=:
111739at_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
111750read at_status <"$at_status_file"
111751#AT_STOP_240
111752#AT_START_241
111753at_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
111755at_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
111769cat >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
111810FILE *input;
111811static int power (int base, int exponent);
111812
111813
111814int 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%%
111832input:
111833  line
111834| input line         {  }
111835;
111836
111837line:
111838  '\n'
111839| exp '\n'           { USE ($1); }
111840;
111841
111842exp:
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
111863static int
111864power (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.  */
111875void
111876calc::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
111885cat >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
111896int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
111897static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
111898static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
111899
111900
111901static calc::parser::location_type last_yylloc;
111902
111903static int
111904get_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
111921static void
111922unget_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
111932static int
111933read_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
111964int 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
111994cat >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.  */
112013int
112014calcparse ()
112015{
112016  calc::parser parser;
112017#if CALCDEBUG
112018  parser.set_debug_level (1);
112019#endif
112020  return parser.parse ();
112021}
112022
112023
112024semantic_value global_result = 0;
112025int global_count = 0;
112026
112027/* A C main function.  */
112028int
112029main (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
112067if 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"
112075at_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>&-
112079at_status=$? at_failed=false
112080$at_check_filter
112081echo stderr:; cat "$at_stderr"
112082echo stdout:; cat "$at_stdout"
112083at_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"
112089at_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>&-
112092at_status=$? at_failed=false
112093$at_check_filter
112094echo stderr:; cat "$at_stderr"
112095echo stdout:; cat "$at_stdout"
112096at_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"
112105at_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>&-
112110at_status=$? at_failed=false
112111$at_check_filter
112112at_fn_diff_devnull "$at_stderr" || at_failed=:
112113$at_diff expout "$at_stdout" || at_failed=:
112114at_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"
112123at_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>&-
112128at_status=$? at_failed=false
112129$at_check_filter
112130at_fn_diff_devnull "$at_stderr" || at_failed=:
112131$at_diff expout "$at_stdout" || at_failed=:
112132at_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
112138fi
112139{ set +x
112140$as_echo "$at_srcdir/calc.at:685: bison -o calc.cc calc.y"
112141at_fn_check_prepare_trace "calc.at:685"
112142( $at_check_trace; bison -o calc.cc calc.y
112143) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112144at_status=$? at_failed=false
112145$at_check_filter
112146at_fn_diff_devnull "$at_stderr" || at_failed=:
112147at_fn_diff_devnull "$at_stdout" || at_failed=:
112148at_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"
112156at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:685"
112157( $at_check_trace; $BISON_CXX_WORKS
112158) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112159at_status=$? at_failed=false
112160$at_check_filter
112161echo stderr:; cat "$at_stderr"
112162echo stdout:; cat "$at_stdout"
112163at_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"
112169at_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>&-
112172at_status=$? at_failed=false
112173$at_check_filter
112174echo stderr:; cat "$at_stderr"
112175echo stdout:; cat "$at_stdout"
112176at_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"
112191at_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>&-
112202at_status=$? at_failed=false
112203$at_check_filter
112204at_fn_diff_devnull "$at_stderr" || at_failed=:
112205at_fn_diff_devnull "$at_stdout" || at_failed=:
112206at_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"
112220at_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>&-
112231at_status=$? at_failed=false
112232$at_check_filter
112233at_fn_diff_devnull "$at_stderr" || at_failed=:
112234at_fn_diff_devnull "$at_stdout" || at_failed=:
112235at_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.
112241cat >input <<'_ATEOF'
1122421 + 2 * 3 = 7
1122431 + 2 * -3 = -5
112244
112245-1^2 = -1
112246(-1)^2 = 1
112247
112248---1 = -1
112249
1122501 - 2 - 3 = -4
1122511 - (2 - 3) = 2
112252
1122532^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"
112259at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112260( $at_check_trace;  $PREPARSER ./calc input
112261) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112262at_status=$? at_failed=false
112263$at_check_filter
112264echo stderr:; tee stderr <"$at_stderr"
112265at_fn_diff_devnull "$at_stdout" || at_failed=:
112266at_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"
112272at_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>&-
112275at_status=$? at_failed=false
112276$at_check_filter
112277echo stderr:; tee stderr <"$at_stderr"
112278at_fn_diff_devnull "$at_stdout" || at_failed=:
112279at_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.
112287cat >input <<'_ATEOF'
1122881 2
112289_ATEOF
112290
112291{ set +x
112292$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112293at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112294( $at_check_trace;  $PREPARSER ./calc input
112295) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112296at_status=$? at_failed=false
112297$at_check_filter
112298echo stderr:; tee stderr <"$at_stderr"
112299at_fn_diff_devnull "$at_stdout" || at_failed=:
112300at_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"
112306at_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>&-
112309at_status=$? at_failed=false
112310$at_check_filter
112311echo stderr:; tee stderr <"$at_stderr"
112312at_fn_diff_devnull "$at_stdout" || at_failed=:
112313at_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.
112322sed '/^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
112337mv at-stderr stderr
112338# 2. Create the reference error message.
112339cat >expout <<'_ATEOF'
1123401.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"
112350at_fn_check_prepare_trace "calc.at:685"
112351( $at_check_trace; cat stderr
112352) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112353at_status=$? at_failed=false
112354$at_check_filter
112355at_fn_diff_devnull "$at_stderr" || at_failed=:
112356$at_diff expout "$at_stdout" || at_failed=:
112357at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
112358$at_failed && at_fn_log_failure
112359$at_traceon; }
112360
112361
112362cat >input <<'_ATEOF'
1123631//2
112364_ATEOF
112365
112366{ set +x
112367$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112368at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112369( $at_check_trace;  $PREPARSER ./calc input
112370) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112371at_status=$? at_failed=false
112372$at_check_filter
112373echo stderr:; tee stderr <"$at_stderr"
112374at_fn_diff_devnull "$at_stdout" || at_failed=:
112375at_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"
112381at_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>&-
112384at_status=$? at_failed=false
112385$at_check_filter
112386echo stderr:; tee stderr <"$at_stderr"
112387at_fn_diff_devnull "$at_stdout" || at_failed=:
112388at_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.
112397sed '/^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
112412mv at-stderr stderr
112413# 2. Create the reference error message.
112414cat >expout <<'_ATEOF'
1124151.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"
112425at_fn_check_prepare_trace "calc.at:685"
112426( $at_check_trace; cat stderr
112427) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112428at_status=$? at_failed=false
112429$at_check_filter
112430at_fn_diff_devnull "$at_stderr" || at_failed=:
112431$at_diff expout "$at_stdout" || at_failed=:
112432at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
112433$at_failed && at_fn_log_failure
112434$at_traceon; }
112435
112436
112437cat >input <<'_ATEOF'
112438error
112439_ATEOF
112440
112441{ set +x
112442$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112443at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112444( $at_check_trace;  $PREPARSER ./calc input
112445) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112446at_status=$? at_failed=false
112447$at_check_filter
112448echo stderr:; tee stderr <"$at_stderr"
112449at_fn_diff_devnull "$at_stdout" || at_failed=:
112450at_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"
112456at_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>&-
112459at_status=$? at_failed=false
112460$at_check_filter
112461echo stderr:; tee stderr <"$at_stderr"
112462at_fn_diff_devnull "$at_stdout" || at_failed=:
112463at_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.
112472sed '/^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
112487mv at-stderr stderr
112488# 2. Create the reference error message.
112489cat >expout <<'_ATEOF'
1124901.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"
112500at_fn_check_prepare_trace "calc.at:685"
112501( $at_check_trace; cat stderr
112502) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112503at_status=$? at_failed=false
112504$at_check_filter
112505at_fn_diff_devnull "$at_stderr" || at_failed=:
112506$at_diff expout "$at_stdout" || at_failed=:
112507at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
112508$at_failed && at_fn_log_failure
112509$at_traceon; }
112510
112511
112512cat >input <<'_ATEOF'
1125131 = 2 = 3
112514_ATEOF
112515
112516{ set +x
112517$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112518at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112519( $at_check_trace;  $PREPARSER ./calc input
112520) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112521at_status=$? at_failed=false
112522$at_check_filter
112523echo stderr:; tee stderr <"$at_stderr"
112524at_fn_diff_devnull "$at_stdout" || at_failed=:
112525at_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"
112531at_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>&-
112534at_status=$? at_failed=false
112535$at_check_filter
112536echo stderr:; tee stderr <"$at_stderr"
112537at_fn_diff_devnull "$at_stdout" || at_failed=:
112538at_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.
112547sed '/^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
112562mv at-stderr stderr
112563# 2. Create the reference error message.
112564cat >expout <<'_ATEOF'
1125651.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"
112575at_fn_check_prepare_trace "calc.at:685"
112576( $at_check_trace; cat stderr
112577) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112578at_status=$? at_failed=false
112579$at_check_filter
112580at_fn_diff_devnull "$at_stderr" || at_failed=:
112581$at_diff expout "$at_stdout" || at_failed=:
112582at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
112583$at_failed && at_fn_log_failure
112584$at_traceon; }
112585
112586
112587cat >input <<'_ATEOF'
112588
112589+1
112590_ATEOF
112591
112592{ set +x
112593$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112594at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112595( $at_check_trace;  $PREPARSER ./calc input
112596) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112597at_status=$? at_failed=false
112598$at_check_filter
112599echo stderr:; tee stderr <"$at_stderr"
112600at_fn_diff_devnull "$at_stdout" || at_failed=:
112601at_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"
112607at_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>&-
112610at_status=$? at_failed=false
112611$at_check_filter
112612echo stderr:; tee stderr <"$at_stderr"
112613at_fn_diff_devnull "$at_stdout" || at_failed=:
112614at_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.
112623sed '/^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
112638mv at-stderr stderr
112639# 2. Create the reference error message.
112640cat >expout <<'_ATEOF'
1126412.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"
112651at_fn_check_prepare_trace "calc.at:685"
112652( $at_check_trace; cat stderr
112653) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112654at_status=$? at_failed=false
112655$at_check_filter
112656at_fn_diff_devnull "$at_stderr" || at_failed=:
112657$at_diff expout "$at_stdout" || at_failed=:
112658at_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"
112666at_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>&-
112669at_status=$? at_failed=false
112670$at_check_filter
112671echo stderr:; tee stderr <"$at_stderr"
112672at_fn_diff_devnull "$at_stdout" || at_failed=:
112673at_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"
112679at_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>&-
112682at_status=$? at_failed=false
112683$at_check_filter
112684echo stderr:; tee stderr <"$at_stderr"
112685at_fn_diff_devnull "$at_stdout" || at_failed=:
112686at_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.
112695sed '/^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
112710mv at-stderr stderr
112711# 2. Create the reference error message.
112712cat >expout <<'_ATEOF'
1127131.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"
112723at_fn_check_prepare_trace "calc.at:685"
112724( $at_check_trace; cat stderr
112725) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112726at_status=$? at_failed=false
112727$at_check_filter
112728at_fn_diff_devnull "$at_stderr" || at_failed=:
112729$at_diff expout "$at_stdout" || at_failed=:
112730at_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#
112752cat >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"
112758at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112759( $at_check_trace;  $PREPARSER ./calc input
112760) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112761at_status=$? at_failed=false
112762$at_check_filter
112763echo stderr:; tee stderr <"$at_stderr"
112764at_fn_diff_devnull "$at_stdout" || at_failed=:
112765at_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"
112771at_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>&-
112774at_status=$? at_failed=false
112775$at_check_filter
112776echo stderr:; tee stderr <"$at_stderr"
112777at_fn_diff_devnull "$at_stdout" || at_failed=:
112778at_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.
112787sed '/^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
112802mv at-stderr stderr
112803# 2. Create the reference error message.
112804cat >expout <<'_ATEOF'
1128051.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1128061.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1128071.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1128081.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
112809calc: 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"
112819at_fn_check_prepare_trace "calc.at:685"
112820( $at_check_trace; cat stderr
112821) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112822at_status=$? at_failed=false
112823$at_check_filter
112824at_fn_diff_devnull "$at_stderr" || at_failed=:
112825$at_diff expout "$at_stdout" || at_failed=:
112826at_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.
112834cat >input <<'_ATEOF'
112835(!) + (1 2) = 1
112836_ATEOF
112837
112838{ set +x
112839$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112840at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112841( $at_check_trace;  $PREPARSER ./calc input
112842) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112843at_status=$? at_failed=false
112844$at_check_filter
112845echo stderr:; tee stderr <"$at_stderr"
112846at_fn_diff_devnull "$at_stdout" || at_failed=:
112847at_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"
112853at_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>&-
112856at_status=$? at_failed=false
112857$at_check_filter
112858echo stderr:; tee stderr <"$at_stderr"
112859at_fn_diff_devnull "$at_stdout" || at_failed=:
112860at_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.
112869sed '/^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
112884mv at-stderr stderr
112885# 2. Create the reference error message.
112886cat >expout <<'_ATEOF'
1128871.10: syntax error, unexpected number
112888calc: 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"
112898at_fn_check_prepare_trace "calc.at:685"
112899( $at_check_trace; cat stderr
112900) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112901at_status=$? at_failed=false
112902$at_check_filter
112903at_fn_diff_devnull "$at_stderr" || at_failed=:
112904$at_diff expout "$at_stdout" || at_failed=:
112905at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
112906$at_failed && at_fn_log_failure
112907$at_traceon; }
112908
112909
112910cat >input <<'_ATEOF'
112911(- *) + (1 2) = 1
112912_ATEOF
112913
112914{ set +x
112915$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112916at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112917( $at_check_trace;  $PREPARSER ./calc input
112918) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112919at_status=$? at_failed=false
112920$at_check_filter
112921echo stderr:; tee stderr <"$at_stderr"
112922at_fn_diff_devnull "$at_stdout" || at_failed=:
112923at_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"
112929at_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>&-
112932at_status=$? at_failed=false
112933$at_check_filter
112934echo stderr:; tee stderr <"$at_stderr"
112935at_fn_diff_devnull "$at_stdout" || at_failed=:
112936at_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.
112945sed '/^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
112960mv at-stderr stderr
112961# 2. Create the reference error message.
112962cat >expout <<'_ATEOF'
1129631.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1129641.12: syntax error, unexpected number
112965calc: 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"
112975at_fn_check_prepare_trace "calc.at:685"
112976( $at_check_trace; cat stderr
112977) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112978at_status=$? at_failed=false
112979$at_check_filter
112980at_fn_diff_devnull "$at_stderr" || at_failed=:
112981$at_diff expout "$at_stdout" || at_failed=:
112982at_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.
112990cat >input <<'_ATEOF'
112991(* *) + (*) + (*)
112992_ATEOF
112993
112994{ set +x
112995$as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
112996at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
112997( $at_check_trace;  $PREPARSER ./calc input
112998) >>"$at_stdout" 2>>"$at_stderr" 5>&-
112999at_status=$? at_failed=false
113000$at_check_filter
113001echo stderr:; tee stderr <"$at_stderr"
113002at_fn_diff_devnull "$at_stdout" || at_failed=:
113003at_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"
113009at_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>&-
113012at_status=$? at_failed=false
113013$at_check_filter
113014echo stderr:; tee stderr <"$at_stderr"
113015at_fn_diff_devnull "$at_stdout" || at_failed=:
113016at_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.
113025sed '/^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
113040mv at-stderr stderr
113041# 2. Create the reference error message.
113042cat >expout <<'_ATEOF'
1130431.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1130441.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1130451.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"
113055at_fn_check_prepare_trace "calc.at:685"
113056( $at_check_trace; cat stderr
113057) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113058at_status=$? at_failed=false
113059$at_check_filter
113060at_fn_diff_devnull "$at_stderr" || at_failed=:
113061$at_diff expout "$at_stdout" || at_failed=:
113062at_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
113073read at_status <"$at_status_file"
113074#AT_STOP_241
113075#AT_START_242
113076at_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
113078at_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
113092cat >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
113133FILE *input;
113134static int power (int base, int exponent);
113135
113136
113137int 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%%
113155input:
113156  line
113157| input line         { ++*count; ++global_count; }
113158;
113159
113160line:
113161  '\n'
113162| exp '\n'           { *result = global_result = $1; }
113163;
113164
113165exp:
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
113186static int
113187power (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.  */
113198void
113199calc::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
113208cat >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
113219int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
113220static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
113221static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
113222
113223
113224static calc::parser::location_type last_yylloc;
113225
113226static int
113227get_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
113244static void
113245unget_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
113255static int
113256read_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
113287int 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
113317cat >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.  */
113336int
113337calcparse (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
113347semantic_value global_result = 0;
113348int global_count = 0;
113349
113350/* A C main function.  */
113351int
113352main (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
113390if 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"
113398at_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>&-
113402at_status=$? at_failed=false
113403$at_check_filter
113404echo stderr:; cat "$at_stderr"
113405echo stdout:; cat "$at_stdout"
113406at_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"
113412at_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>&-
113415at_status=$? at_failed=false
113416$at_check_filter
113417echo stderr:; cat "$at_stderr"
113418echo stdout:; cat "$at_stdout"
113419at_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"
113428at_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>&-
113433at_status=$? at_failed=false
113434$at_check_filter
113435at_fn_diff_devnull "$at_stderr" || at_failed=:
113436$at_diff expout "$at_stdout" || at_failed=:
113437at_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"
113446at_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>&-
113451at_status=$? at_failed=false
113452$at_check_filter
113453at_fn_diff_devnull "$at_stderr" || at_failed=:
113454$at_diff expout "$at_stdout" || at_failed=:
113455at_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
113461fi
113462{ set +x
113463$as_echo "$at_srcdir/calc.at:687: bison -o calc.cc calc.y"
113464at_fn_check_prepare_trace "calc.at:687"
113465( $at_check_trace; bison -o calc.cc calc.y
113466) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113467at_status=$? at_failed=false
113468$at_check_filter
113469at_fn_diff_devnull "$at_stderr" || at_failed=:
113470at_fn_diff_devnull "$at_stdout" || at_failed=:
113471at_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"
113479at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687"
113480( $at_check_trace; $BISON_CXX_WORKS
113481) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113482at_status=$? at_failed=false
113483$at_check_filter
113484echo stderr:; cat "$at_stderr"
113485echo stdout:; cat "$at_stdout"
113486at_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"
113492at_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>&-
113495at_status=$? at_failed=false
113496$at_check_filter
113497echo stderr:; cat "$at_stderr"
113498echo stdout:; cat "$at_stdout"
113499at_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"
113514at_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>&-
113525at_status=$? at_failed=false
113526$at_check_filter
113527at_fn_diff_devnull "$at_stderr" || at_failed=:
113528at_fn_diff_devnull "$at_stdout" || at_failed=:
113529at_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"
113543at_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>&-
113554at_status=$? at_failed=false
113555$at_check_filter
113556at_fn_diff_devnull "$at_stderr" || at_failed=:
113557at_fn_diff_devnull "$at_stdout" || at_failed=:
113558at_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.
113564cat >input <<'_ATEOF'
1135651 + 2 * 3 = 7
1135661 + 2 * -3 = -5
113567
113568-1^2 = -1
113569(-1)^2 = 1
113570
113571---1 = -1
113572
1135731 - 2 - 3 = -4
1135741 - (2 - 3) = 2
113575
1135762^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"
113582at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113583( $at_check_trace;  $PREPARSER ./calc input
113584) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113585at_status=$? at_failed=false
113586$at_check_filter
113587echo stderr:; tee stderr <"$at_stderr"
113588at_fn_diff_devnull "$at_stdout" || at_failed=:
113589at_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"
113595at_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>&-
113598at_status=$? at_failed=false
113599$at_check_filter
113600echo stderr:; tee stderr <"$at_stderr"
113601at_fn_diff_devnull "$at_stdout" || at_failed=:
113602at_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.
113610cat >input <<'_ATEOF'
1136111 2
113612_ATEOF
113613
113614{ set +x
113615$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
113616at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113617( $at_check_trace;  $PREPARSER ./calc input
113618) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113619at_status=$? at_failed=false
113620$at_check_filter
113621echo stderr:; tee stderr <"$at_stderr"
113622at_fn_diff_devnull "$at_stdout" || at_failed=:
113623at_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"
113629at_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>&-
113632at_status=$? at_failed=false
113633$at_check_filter
113634echo stderr:; tee stderr <"$at_stderr"
113635at_fn_diff_devnull "$at_stdout" || at_failed=:
113636at_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.
113645sed '/^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
113660mv at-stderr stderr
113661# 2. Create the reference error message.
113662cat >expout <<'_ATEOF'
1136631.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"
113673at_fn_check_prepare_trace "calc.at:687"
113674( $at_check_trace; cat stderr
113675) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113676at_status=$? at_failed=false
113677$at_check_filter
113678at_fn_diff_devnull "$at_stderr" || at_failed=:
113679$at_diff expout "$at_stdout" || at_failed=:
113680at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
113681$at_failed && at_fn_log_failure
113682$at_traceon; }
113683
113684
113685cat >input <<'_ATEOF'
1136861//2
113687_ATEOF
113688
113689{ set +x
113690$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
113691at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113692( $at_check_trace;  $PREPARSER ./calc input
113693) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113694at_status=$? at_failed=false
113695$at_check_filter
113696echo stderr:; tee stderr <"$at_stderr"
113697at_fn_diff_devnull "$at_stdout" || at_failed=:
113698at_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"
113704at_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>&-
113707at_status=$? at_failed=false
113708$at_check_filter
113709echo stderr:; tee stderr <"$at_stderr"
113710at_fn_diff_devnull "$at_stdout" || at_failed=:
113711at_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.
113720sed '/^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
113735mv at-stderr stderr
113736# 2. Create the reference error message.
113737cat >expout <<'_ATEOF'
1137381.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"
113748at_fn_check_prepare_trace "calc.at:687"
113749( $at_check_trace; cat stderr
113750) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113751at_status=$? at_failed=false
113752$at_check_filter
113753at_fn_diff_devnull "$at_stderr" || at_failed=:
113754$at_diff expout "$at_stdout" || at_failed=:
113755at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
113756$at_failed && at_fn_log_failure
113757$at_traceon; }
113758
113759
113760cat >input <<'_ATEOF'
113761error
113762_ATEOF
113763
113764{ set +x
113765$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
113766at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113767( $at_check_trace;  $PREPARSER ./calc input
113768) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113769at_status=$? at_failed=false
113770$at_check_filter
113771echo stderr:; tee stderr <"$at_stderr"
113772at_fn_diff_devnull "$at_stdout" || at_failed=:
113773at_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"
113779at_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>&-
113782at_status=$? at_failed=false
113783$at_check_filter
113784echo stderr:; tee stderr <"$at_stderr"
113785at_fn_diff_devnull "$at_stdout" || at_failed=:
113786at_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.
113795sed '/^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
113810mv at-stderr stderr
113811# 2. Create the reference error message.
113812cat >expout <<'_ATEOF'
1138131.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"
113823at_fn_check_prepare_trace "calc.at:687"
113824( $at_check_trace; cat stderr
113825) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113826at_status=$? at_failed=false
113827$at_check_filter
113828at_fn_diff_devnull "$at_stderr" || at_failed=:
113829$at_diff expout "$at_stdout" || at_failed=:
113830at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
113831$at_failed && at_fn_log_failure
113832$at_traceon; }
113833
113834
113835cat >input <<'_ATEOF'
1138361 = 2 = 3
113837_ATEOF
113838
113839{ set +x
113840$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
113841at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113842( $at_check_trace;  $PREPARSER ./calc input
113843) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113844at_status=$? at_failed=false
113845$at_check_filter
113846echo stderr:; tee stderr <"$at_stderr"
113847at_fn_diff_devnull "$at_stdout" || at_failed=:
113848at_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"
113854at_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>&-
113857at_status=$? at_failed=false
113858$at_check_filter
113859echo stderr:; tee stderr <"$at_stderr"
113860at_fn_diff_devnull "$at_stdout" || at_failed=:
113861at_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.
113870sed '/^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
113885mv at-stderr stderr
113886# 2. Create the reference error message.
113887cat >expout <<'_ATEOF'
1138881.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"
113898at_fn_check_prepare_trace "calc.at:687"
113899( $at_check_trace; cat stderr
113900) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113901at_status=$? at_failed=false
113902$at_check_filter
113903at_fn_diff_devnull "$at_stderr" || at_failed=:
113904$at_diff expout "$at_stdout" || at_failed=:
113905at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
113906$at_failed && at_fn_log_failure
113907$at_traceon; }
113908
113909
113910cat >input <<'_ATEOF'
113911
113912+1
113913_ATEOF
113914
113915{ set +x
113916$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
113917at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
113918( $at_check_trace;  $PREPARSER ./calc input
113919) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113920at_status=$? at_failed=false
113921$at_check_filter
113922echo stderr:; tee stderr <"$at_stderr"
113923at_fn_diff_devnull "$at_stdout" || at_failed=:
113924at_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"
113930at_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>&-
113933at_status=$? at_failed=false
113934$at_check_filter
113935echo stderr:; tee stderr <"$at_stderr"
113936at_fn_diff_devnull "$at_stdout" || at_failed=:
113937at_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.
113946sed '/^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
113961mv at-stderr stderr
113962# 2. Create the reference error message.
113963cat >expout <<'_ATEOF'
1139642.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"
113974at_fn_check_prepare_trace "calc.at:687"
113975( $at_check_trace; cat stderr
113976) >>"$at_stdout" 2>>"$at_stderr" 5>&-
113977at_status=$? at_failed=false
113978$at_check_filter
113979at_fn_diff_devnull "$at_stderr" || at_failed=:
113980$at_diff expout "$at_stdout" || at_failed=:
113981at_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"
113989at_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>&-
113992at_status=$? at_failed=false
113993$at_check_filter
113994echo stderr:; tee stderr <"$at_stderr"
113995at_fn_diff_devnull "$at_stdout" || at_failed=:
113996at_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"
114002at_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>&-
114005at_status=$? at_failed=false
114006$at_check_filter
114007echo stderr:; tee stderr <"$at_stderr"
114008at_fn_diff_devnull "$at_stdout" || at_failed=:
114009at_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.
114018sed '/^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
114033mv at-stderr stderr
114034# 2. Create the reference error message.
114035cat >expout <<'_ATEOF'
1140361.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"
114046at_fn_check_prepare_trace "calc.at:687"
114047( $at_check_trace; cat stderr
114048) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114049at_status=$? at_failed=false
114050$at_check_filter
114051at_fn_diff_devnull "$at_stderr" || at_failed=:
114052$at_diff expout "$at_stdout" || at_failed=:
114053at_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#
114075cat >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"
114081at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
114082( $at_check_trace;  $PREPARSER ./calc input
114083) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114084at_status=$? at_failed=false
114085$at_check_filter
114086echo stderr:; tee stderr <"$at_stderr"
114087at_fn_diff_devnull "$at_stdout" || at_failed=:
114088at_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"
114094at_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>&-
114097at_status=$? at_failed=false
114098$at_check_filter
114099echo stderr:; tee stderr <"$at_stderr"
114100at_fn_diff_devnull "$at_stdout" || at_failed=:
114101at_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.
114110sed '/^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
114125mv at-stderr stderr
114126# 2. Create the reference error message.
114127cat >expout <<'_ATEOF'
1141281.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1141291.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1141301.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1141311.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
114132calc: 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"
114142at_fn_check_prepare_trace "calc.at:687"
114143( $at_check_trace; cat stderr
114144) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114145at_status=$? at_failed=false
114146$at_check_filter
114147at_fn_diff_devnull "$at_stderr" || at_failed=:
114148$at_diff expout "$at_stdout" || at_failed=:
114149at_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.
114157cat >input <<'_ATEOF'
114158(!) + (1 2) = 1
114159_ATEOF
114160
114161{ set +x
114162$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
114163at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
114164( $at_check_trace;  $PREPARSER ./calc input
114165) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114166at_status=$? at_failed=false
114167$at_check_filter
114168echo stderr:; tee stderr <"$at_stderr"
114169at_fn_diff_devnull "$at_stdout" || at_failed=:
114170at_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"
114176at_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>&-
114179at_status=$? at_failed=false
114180$at_check_filter
114181echo stderr:; tee stderr <"$at_stderr"
114182at_fn_diff_devnull "$at_stdout" || at_failed=:
114183at_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.
114192sed '/^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
114207mv at-stderr stderr
114208# 2. Create the reference error message.
114209cat >expout <<'_ATEOF'
1142101.10: syntax error, unexpected number
114211calc: 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"
114221at_fn_check_prepare_trace "calc.at:687"
114222( $at_check_trace; cat stderr
114223) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114224at_status=$? at_failed=false
114225$at_check_filter
114226at_fn_diff_devnull "$at_stderr" || at_failed=:
114227$at_diff expout "$at_stdout" || at_failed=:
114228at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
114229$at_failed && at_fn_log_failure
114230$at_traceon; }
114231
114232
114233cat >input <<'_ATEOF'
114234(- *) + (1 2) = 1
114235_ATEOF
114236
114237{ set +x
114238$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
114239at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
114240( $at_check_trace;  $PREPARSER ./calc input
114241) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114242at_status=$? at_failed=false
114243$at_check_filter
114244echo stderr:; tee stderr <"$at_stderr"
114245at_fn_diff_devnull "$at_stdout" || at_failed=:
114246at_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"
114252at_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>&-
114255at_status=$? at_failed=false
114256$at_check_filter
114257echo stderr:; tee stderr <"$at_stderr"
114258at_fn_diff_devnull "$at_stdout" || at_failed=:
114259at_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.
114268sed '/^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
114283mv at-stderr stderr
114284# 2. Create the reference error message.
114285cat >expout <<'_ATEOF'
1142861.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1142871.12: syntax error, unexpected number
114288calc: 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"
114298at_fn_check_prepare_trace "calc.at:687"
114299( $at_check_trace; cat stderr
114300) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114301at_status=$? at_failed=false
114302$at_check_filter
114303at_fn_diff_devnull "$at_stderr" || at_failed=:
114304$at_diff expout "$at_stdout" || at_failed=:
114305at_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.
114313cat >input <<'_ATEOF'
114314(* *) + (*) + (*)
114315_ATEOF
114316
114317{ set +x
114318$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
114319at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
114320( $at_check_trace;  $PREPARSER ./calc input
114321) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114322at_status=$? at_failed=false
114323$at_check_filter
114324echo stderr:; tee stderr <"$at_stderr"
114325at_fn_diff_devnull "$at_stdout" || at_failed=:
114326at_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"
114332at_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>&-
114335at_status=$? at_failed=false
114336$at_check_filter
114337echo stderr:; tee stderr <"$at_stderr"
114338at_fn_diff_devnull "$at_stdout" || at_failed=:
114339at_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.
114348sed '/^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
114363mv at-stderr stderr
114364# 2. Create the reference error message.
114365cat >expout <<'_ATEOF'
1143661.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1143671.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1143681.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"
114378at_fn_check_prepare_trace "calc.at:687"
114379( $at_check_trace; cat stderr
114380) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114381at_status=$? at_failed=false
114382$at_check_filter
114383at_fn_diff_devnull "$at_stderr" || at_failed=:
114384$at_diff expout "$at_stdout" || at_failed=:
114385at_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
114396read at_status <"$at_status_file"
114397#AT_STOP_242
114398#AT_START_243
114399at_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
114401at_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
114415cat >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
114456FILE *input;
114457static int power (int base, int exponent);
114458
114459
114460int 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%%
114478input:
114479  line
114480| input line         { ++*count; ++global_count; }
114481;
114482
114483line:
114484  '\n'
114485| exp '\n'           { *result = global_result = $1; }
114486;
114487
114488exp:
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
114509static int
114510power (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.  */
114521void
114522calc::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
114531cat >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
114542int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
114543static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
114544static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
114545
114546
114547static calc::parser::location_type last_yylloc;
114548
114549static int
114550get_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
114567static void
114568unget_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
114578static int
114579read_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
114610int 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
114640cat >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.  */
114659int
114660calcparse (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
114670semantic_value global_result = 0;
114671int global_count = 0;
114672
114673/* A C main function.  */
114674int
114675main (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
114713if 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"
114721at_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>&-
114725at_status=$? at_failed=false
114726$at_check_filter
114727echo stderr:; cat "$at_stderr"
114728echo stdout:; cat "$at_stdout"
114729at_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"
114735at_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>&-
114738at_status=$? at_failed=false
114739$at_check_filter
114740echo stderr:; cat "$at_stderr"
114741echo stdout:; cat "$at_stdout"
114742at_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"
114751at_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>&-
114756at_status=$? at_failed=false
114757$at_check_filter
114758at_fn_diff_devnull "$at_stderr" || at_failed=:
114759$at_diff expout "$at_stdout" || at_failed=:
114760at_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"
114769at_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>&-
114774at_status=$? at_failed=false
114775$at_check_filter
114776at_fn_diff_devnull "$at_stderr" || at_failed=:
114777$at_diff expout "$at_stdout" || at_failed=:
114778at_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
114784fi
114785{ set +x
114786$as_echo "$at_srcdir/calc.at:688: bison -o calc.cc calc.y"
114787at_fn_check_prepare_trace "calc.at:688"
114788( $at_check_trace; bison -o calc.cc calc.y
114789) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114790at_status=$? at_failed=false
114791$at_check_filter
114792at_fn_diff_devnull "$at_stderr" || at_failed=:
114793at_fn_diff_devnull "$at_stdout" || at_failed=:
114794at_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"
114802at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:688"
114803( $at_check_trace; $BISON_CXX_WORKS
114804) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114805at_status=$? at_failed=false
114806$at_check_filter
114807echo stderr:; cat "$at_stderr"
114808echo stdout:; cat "$at_stdout"
114809at_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"
114815at_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>&-
114818at_status=$? at_failed=false
114819$at_check_filter
114820echo stderr:; cat "$at_stderr"
114821echo stdout:; cat "$at_stdout"
114822at_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"
114837at_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>&-
114848at_status=$? at_failed=false
114849$at_check_filter
114850at_fn_diff_devnull "$at_stderr" || at_failed=:
114851at_fn_diff_devnull "$at_stdout" || at_failed=:
114852at_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"
114866at_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>&-
114877at_status=$? at_failed=false
114878$at_check_filter
114879at_fn_diff_devnull "$at_stderr" || at_failed=:
114880at_fn_diff_devnull "$at_stdout" || at_failed=:
114881at_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.
114887cat >input <<'_ATEOF'
1148881 + 2 * 3 = 7
1148891 + 2 * -3 = -5
114890
114891-1^2 = -1
114892(-1)^2 = 1
114893
114894---1 = -1
114895
1148961 - 2 - 3 = -4
1148971 - (2 - 3) = 2
114898
1148992^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"
114905at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
114906( $at_check_trace;  $PREPARSER ./calc input
114907) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114908at_status=$? at_failed=false
114909$at_check_filter
114910echo stderr:; tee stderr <"$at_stderr"
114911at_fn_diff_devnull "$at_stdout" || at_failed=:
114912at_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"
114918at_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>&-
114921at_status=$? at_failed=false
114922$at_check_filter
114923echo stderr:; tee stderr <"$at_stderr"
114924at_fn_diff_devnull "$at_stdout" || at_failed=:
114925at_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.
114933cat >input <<'_ATEOF'
1149341 2
114935_ATEOF
114936
114937{ set +x
114938$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
114939at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
114940( $at_check_trace;  $PREPARSER ./calc input
114941) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114942at_status=$? at_failed=false
114943$at_check_filter
114944echo stderr:; tee stderr <"$at_stderr"
114945at_fn_diff_devnull "$at_stdout" || at_failed=:
114946at_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"
114952at_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>&-
114955at_status=$? at_failed=false
114956$at_check_filter
114957echo stderr:; tee stderr <"$at_stderr"
114958at_fn_diff_devnull "$at_stdout" || at_failed=:
114959at_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.
114968sed '/^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
114983mv at-stderr stderr
114984# 2. Create the reference error message.
114985cat >expout <<'_ATEOF'
1149861.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"
114996at_fn_check_prepare_trace "calc.at:688"
114997( $at_check_trace; cat stderr
114998) >>"$at_stdout" 2>>"$at_stderr" 5>&-
114999at_status=$? at_failed=false
115000$at_check_filter
115001at_fn_diff_devnull "$at_stderr" || at_failed=:
115002$at_diff expout "$at_stdout" || at_failed=:
115003at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
115004$at_failed && at_fn_log_failure
115005$at_traceon; }
115006
115007
115008cat >input <<'_ATEOF'
1150091//2
115010_ATEOF
115011
115012{ set +x
115013$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115014at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115015( $at_check_trace;  $PREPARSER ./calc input
115016) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115017at_status=$? at_failed=false
115018$at_check_filter
115019echo stderr:; tee stderr <"$at_stderr"
115020at_fn_diff_devnull "$at_stdout" || at_failed=:
115021at_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"
115027at_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>&-
115030at_status=$? at_failed=false
115031$at_check_filter
115032echo stderr:; tee stderr <"$at_stderr"
115033at_fn_diff_devnull "$at_stdout" || at_failed=:
115034at_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.
115043sed '/^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
115058mv at-stderr stderr
115059# 2. Create the reference error message.
115060cat >expout <<'_ATEOF'
1150611.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"
115071at_fn_check_prepare_trace "calc.at:688"
115072( $at_check_trace; cat stderr
115073) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115074at_status=$? at_failed=false
115075$at_check_filter
115076at_fn_diff_devnull "$at_stderr" || at_failed=:
115077$at_diff expout "$at_stdout" || at_failed=:
115078at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
115079$at_failed && at_fn_log_failure
115080$at_traceon; }
115081
115082
115083cat >input <<'_ATEOF'
115084error
115085_ATEOF
115086
115087{ set +x
115088$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115089at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115090( $at_check_trace;  $PREPARSER ./calc input
115091) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115092at_status=$? at_failed=false
115093$at_check_filter
115094echo stderr:; tee stderr <"$at_stderr"
115095at_fn_diff_devnull "$at_stdout" || at_failed=:
115096at_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"
115102at_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>&-
115105at_status=$? at_failed=false
115106$at_check_filter
115107echo stderr:; tee stderr <"$at_stderr"
115108at_fn_diff_devnull "$at_stdout" || at_failed=:
115109at_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.
115118sed '/^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
115133mv at-stderr stderr
115134# 2. Create the reference error message.
115135cat >expout <<'_ATEOF'
1151361.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"
115146at_fn_check_prepare_trace "calc.at:688"
115147( $at_check_trace; cat stderr
115148) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115149at_status=$? at_failed=false
115150$at_check_filter
115151at_fn_diff_devnull "$at_stderr" || at_failed=:
115152$at_diff expout "$at_stdout" || at_failed=:
115153at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
115154$at_failed && at_fn_log_failure
115155$at_traceon; }
115156
115157
115158cat >input <<'_ATEOF'
1151591 = 2 = 3
115160_ATEOF
115161
115162{ set +x
115163$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115164at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115165( $at_check_trace;  $PREPARSER ./calc input
115166) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115167at_status=$? at_failed=false
115168$at_check_filter
115169echo stderr:; tee stderr <"$at_stderr"
115170at_fn_diff_devnull "$at_stdout" || at_failed=:
115171at_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"
115177at_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>&-
115180at_status=$? at_failed=false
115181$at_check_filter
115182echo stderr:; tee stderr <"$at_stderr"
115183at_fn_diff_devnull "$at_stdout" || at_failed=:
115184at_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.
115193sed '/^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
115208mv at-stderr stderr
115209# 2. Create the reference error message.
115210cat >expout <<'_ATEOF'
1152111.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"
115221at_fn_check_prepare_trace "calc.at:688"
115222( $at_check_trace; cat stderr
115223) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115224at_status=$? at_failed=false
115225$at_check_filter
115226at_fn_diff_devnull "$at_stderr" || at_failed=:
115227$at_diff expout "$at_stdout" || at_failed=:
115228at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
115229$at_failed && at_fn_log_failure
115230$at_traceon; }
115231
115232
115233cat >input <<'_ATEOF'
115234
115235+1
115236_ATEOF
115237
115238{ set +x
115239$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115240at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115241( $at_check_trace;  $PREPARSER ./calc input
115242) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115243at_status=$? at_failed=false
115244$at_check_filter
115245echo stderr:; tee stderr <"$at_stderr"
115246at_fn_diff_devnull "$at_stdout" || at_failed=:
115247at_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"
115253at_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>&-
115256at_status=$? at_failed=false
115257$at_check_filter
115258echo stderr:; tee stderr <"$at_stderr"
115259at_fn_diff_devnull "$at_stdout" || at_failed=:
115260at_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.
115269sed '/^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
115284mv at-stderr stderr
115285# 2. Create the reference error message.
115286cat >expout <<'_ATEOF'
1152872.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"
115297at_fn_check_prepare_trace "calc.at:688"
115298( $at_check_trace; cat stderr
115299) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115300at_status=$? at_failed=false
115301$at_check_filter
115302at_fn_diff_devnull "$at_stderr" || at_failed=:
115303$at_diff expout "$at_stdout" || at_failed=:
115304at_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"
115312at_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>&-
115315at_status=$? at_failed=false
115316$at_check_filter
115317echo stderr:; tee stderr <"$at_stderr"
115318at_fn_diff_devnull "$at_stdout" || at_failed=:
115319at_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"
115325at_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>&-
115328at_status=$? at_failed=false
115329$at_check_filter
115330echo stderr:; tee stderr <"$at_stderr"
115331at_fn_diff_devnull "$at_stdout" || at_failed=:
115332at_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.
115341sed '/^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
115356mv at-stderr stderr
115357# 2. Create the reference error message.
115358cat >expout <<'_ATEOF'
1153591.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"
115369at_fn_check_prepare_trace "calc.at:688"
115370( $at_check_trace; cat stderr
115371) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115372at_status=$? at_failed=false
115373$at_check_filter
115374at_fn_diff_devnull "$at_stderr" || at_failed=:
115375$at_diff expout "$at_stdout" || at_failed=:
115376at_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#
115398cat >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"
115404at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115405( $at_check_trace;  $PREPARSER ./calc input
115406) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115407at_status=$? at_failed=false
115408$at_check_filter
115409echo stderr:; tee stderr <"$at_stderr"
115410at_fn_diff_devnull "$at_stdout" || at_failed=:
115411at_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"
115417at_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>&-
115420at_status=$? at_failed=false
115421$at_check_filter
115422echo stderr:; tee stderr <"$at_stderr"
115423at_fn_diff_devnull "$at_stdout" || at_failed=:
115424at_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.
115433sed '/^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
115448mv at-stderr stderr
115449# 2. Create the reference error message.
115450cat >expout <<'_ATEOF'
1154511.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1154521.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1154531.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1154541.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
115455calc: 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"
115465at_fn_check_prepare_trace "calc.at:688"
115466( $at_check_trace; cat stderr
115467) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115468at_status=$? at_failed=false
115469$at_check_filter
115470at_fn_diff_devnull "$at_stderr" || at_failed=:
115471$at_diff expout "$at_stdout" || at_failed=:
115472at_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.
115480cat >input <<'_ATEOF'
115481(!) + (1 2) = 1
115482_ATEOF
115483
115484{ set +x
115485$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115486at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115487( $at_check_trace;  $PREPARSER ./calc input
115488) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115489at_status=$? at_failed=false
115490$at_check_filter
115491echo stderr:; tee stderr <"$at_stderr"
115492at_fn_diff_devnull "$at_stdout" || at_failed=:
115493at_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"
115499at_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>&-
115502at_status=$? at_failed=false
115503$at_check_filter
115504echo stderr:; tee stderr <"$at_stderr"
115505at_fn_diff_devnull "$at_stdout" || at_failed=:
115506at_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.
115515sed '/^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
115530mv at-stderr stderr
115531# 2. Create the reference error message.
115532cat >expout <<'_ATEOF'
1155331.10: syntax error, unexpected number
115534calc: 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"
115544at_fn_check_prepare_trace "calc.at:688"
115545( $at_check_trace; cat stderr
115546) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115547at_status=$? at_failed=false
115548$at_check_filter
115549at_fn_diff_devnull "$at_stderr" || at_failed=:
115550$at_diff expout "$at_stdout" || at_failed=:
115551at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
115552$at_failed && at_fn_log_failure
115553$at_traceon; }
115554
115555
115556cat >input <<'_ATEOF'
115557(- *) + (1 2) = 1
115558_ATEOF
115559
115560{ set +x
115561$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115562at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115563( $at_check_trace;  $PREPARSER ./calc input
115564) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115565at_status=$? at_failed=false
115566$at_check_filter
115567echo stderr:; tee stderr <"$at_stderr"
115568at_fn_diff_devnull "$at_stdout" || at_failed=:
115569at_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"
115575at_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>&-
115578at_status=$? at_failed=false
115579$at_check_filter
115580echo stderr:; tee stderr <"$at_stderr"
115581at_fn_diff_devnull "$at_stdout" || at_failed=:
115582at_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.
115591sed '/^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
115606mv at-stderr stderr
115607# 2. Create the reference error message.
115608cat >expout <<'_ATEOF'
1156091.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1156101.12: syntax error, unexpected number
115611calc: 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"
115621at_fn_check_prepare_trace "calc.at:688"
115622( $at_check_trace; cat stderr
115623) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115624at_status=$? at_failed=false
115625$at_check_filter
115626at_fn_diff_devnull "$at_stderr" || at_failed=:
115627$at_diff expout "$at_stdout" || at_failed=:
115628at_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.
115636cat >input <<'_ATEOF'
115637(* *) + (*) + (*)
115638_ATEOF
115639
115640{ set +x
115641$as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
115642at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
115643( $at_check_trace;  $PREPARSER ./calc input
115644) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115645at_status=$? at_failed=false
115646$at_check_filter
115647echo stderr:; tee stderr <"$at_stderr"
115648at_fn_diff_devnull "$at_stdout" || at_failed=:
115649at_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"
115655at_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>&-
115658at_status=$? at_failed=false
115659$at_check_filter
115660echo stderr:; tee stderr <"$at_stderr"
115661at_fn_diff_devnull "$at_stdout" || at_failed=:
115662at_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.
115671sed '/^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
115686mv at-stderr stderr
115687# 2. Create the reference error message.
115688cat >expout <<'_ATEOF'
1156891.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1156901.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1156911.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"
115701at_fn_check_prepare_trace "calc.at:688"
115702( $at_check_trace; cat stderr
115703) >>"$at_stdout" 2>>"$at_stderr" 5>&-
115704at_status=$? at_failed=false
115705$at_check_filter
115706at_fn_diff_devnull "$at_stderr" || at_failed=:
115707$at_diff expout "$at_stdout" || at_failed=:
115708at_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
115719read at_status <"$at_status_file"
115720#AT_STOP_243
115721#AT_START_244
115722at_fn_group_banner 244 'calc.at:699' \
115723  "Calculator %skeleton \"glr.cc\" %defines %locations" "" 14
115724at_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
115738cat >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
115779FILE *input;
115780static int power (int base, int exponent);
115781
115782
115783int 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%%
115801input:
115802  line
115803| input line         {  }
115804;
115805
115806line:
115807  '\n'
115808| exp '\n'           { USE ($1); }
115809;
115810
115811exp:
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
115832static int
115833power (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.  */
115844void
115845yy::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
115854cat >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
115865int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
115866static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
115867static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
115868
115869
115870static yy::parser::location_type last_yylloc;
115871
115872static int
115873get_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
115890static void
115891unget_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
115901static int
115902read_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
115933int 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
115963cat >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.  */
115982int
115983yyparse ()
115984{
115985  yy::parser parser;
115986#if YYDEBUG
115987  parser.set_debug_level (1);
115988#endif
115989  return parser.parse ();
115990}
115991
115992
115993semantic_value global_result = 0;
115994int global_count = 0;
115995
115996/* A C main function.  */
115997int
115998main (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
116036if 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"
116044at_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>&-
116048at_status=$? at_failed=false
116049$at_check_filter
116050echo stderr:; cat "$at_stderr"
116051echo stdout:; cat "$at_stdout"
116052at_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"
116058at_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>&-
116061at_status=$? at_failed=false
116062$at_check_filter
116063echo stderr:; cat "$at_stderr"
116064echo stdout:; cat "$at_stdout"
116065at_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"
116074at_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>&-
116079at_status=$? at_failed=false
116080$at_check_filter
116081at_fn_diff_devnull "$at_stderr" || at_failed=:
116082$at_diff expout "$at_stdout" || at_failed=:
116083at_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"
116092at_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>&-
116097at_status=$? at_failed=false
116098$at_check_filter
116099at_fn_diff_devnull "$at_stderr" || at_failed=:
116100$at_diff expout "$at_stdout" || at_failed=:
116101at_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
116107fi
116108{ set +x
116109$as_echo "$at_srcdir/calc.at:699: bison -o calc.cc calc.y"
116110at_fn_check_prepare_trace "calc.at:699"
116111( $at_check_trace; bison -o calc.cc calc.y
116112) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116113at_status=$? at_failed=false
116114$at_check_filter
116115at_fn_diff_devnull "$at_stderr" || at_failed=:
116116at_fn_diff_devnull "$at_stdout" || at_failed=:
116117at_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"
116125at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:699"
116126( $at_check_trace; $BISON_CXX_WORKS
116127) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116128at_status=$? at_failed=false
116129$at_check_filter
116130echo stderr:; cat "$at_stderr"
116131echo stdout:; cat "$at_stdout"
116132at_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"
116138at_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>&-
116141at_status=$? at_failed=false
116142$at_check_filter
116143echo stderr:; cat "$at_stderr"
116144echo stdout:; cat "$at_stdout"
116145at_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"
116160at_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>&-
116171at_status=$? at_failed=false
116172$at_check_filter
116173at_fn_diff_devnull "$at_stderr" || at_failed=:
116174at_fn_diff_devnull "$at_stdout" || at_failed=:
116175at_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"
116189at_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>&-
116200at_status=$? at_failed=false
116201$at_check_filter
116202at_fn_diff_devnull "$at_stderr" || at_failed=:
116203at_fn_diff_devnull "$at_stdout" || at_failed=:
116204at_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.
116210cat >input <<'_ATEOF'
1162111 + 2 * 3 = 7
1162121 + 2 * -3 = -5
116213
116214-1^2 = -1
116215(-1)^2 = 1
116216
116217---1 = -1
116218
1162191 - 2 - 3 = -4
1162201 - (2 - 3) = 2
116221
1162222^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"
116228at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116229( $at_check_trace;  $PREPARSER ./calc input
116230) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116231at_status=$? at_failed=false
116232$at_check_filter
116233echo stderr:; tee stderr <"$at_stderr"
116234at_fn_diff_devnull "$at_stdout" || at_failed=:
116235at_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"
116241at_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>&-
116244at_status=$? at_failed=false
116245$at_check_filter
116246echo stderr:; tee stderr <"$at_stderr"
116247at_fn_diff_devnull "$at_stdout" || at_failed=:
116248at_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.
116256cat >input <<'_ATEOF'
1162571 2
116258_ATEOF
116259
116260{ set +x
116261$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116262at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116263( $at_check_trace;  $PREPARSER ./calc input
116264) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116265at_status=$? at_failed=false
116266$at_check_filter
116267echo stderr:; tee stderr <"$at_stderr"
116268at_fn_diff_devnull "$at_stdout" || at_failed=:
116269at_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"
116275at_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>&-
116278at_status=$? at_failed=false
116279$at_check_filter
116280echo stderr:; tee stderr <"$at_stderr"
116281at_fn_diff_devnull "$at_stdout" || at_failed=:
116282at_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.
116291sed '/^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
116306mv at-stderr stderr
116307# 2. Create the reference error message.
116308cat >expout <<'_ATEOF'
1163091.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.
116315sed 's/syntax error, .*$/syntax error/' expout >at-expout
116316mv at-expout expout
116317# 5. Check
116318{ set +x
116319$as_echo "$at_srcdir/calc.at:699: cat stderr"
116320at_fn_check_prepare_trace "calc.at:699"
116321( $at_check_trace; cat stderr
116322) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116323at_status=$? at_failed=false
116324$at_check_filter
116325at_fn_diff_devnull "$at_stderr" || at_failed=:
116326$at_diff expout "$at_stdout" || at_failed=:
116327at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
116328$at_failed && at_fn_log_failure
116329$at_traceon; }
116330
116331
116332cat >input <<'_ATEOF'
1163331//2
116334_ATEOF
116335
116336{ set +x
116337$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116338at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116339( $at_check_trace;  $PREPARSER ./calc input
116340) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116341at_status=$? at_failed=false
116342$at_check_filter
116343echo stderr:; tee stderr <"$at_stderr"
116344at_fn_diff_devnull "$at_stdout" || at_failed=:
116345at_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"
116351at_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>&-
116354at_status=$? at_failed=false
116355$at_check_filter
116356echo stderr:; tee stderr <"$at_stderr"
116357at_fn_diff_devnull "$at_stdout" || at_failed=:
116358at_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.
116367sed '/^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
116382mv at-stderr stderr
116383# 2. Create the reference error message.
116384cat >expout <<'_ATEOF'
1163851.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.
116391sed 's/syntax error, .*$/syntax error/' expout >at-expout
116392mv at-expout expout
116393# 5. Check
116394{ set +x
116395$as_echo "$at_srcdir/calc.at:699: cat stderr"
116396at_fn_check_prepare_trace "calc.at:699"
116397( $at_check_trace; cat stderr
116398) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116399at_status=$? at_failed=false
116400$at_check_filter
116401at_fn_diff_devnull "$at_stderr" || at_failed=:
116402$at_diff expout "$at_stdout" || at_failed=:
116403at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
116404$at_failed && at_fn_log_failure
116405$at_traceon; }
116406
116407
116408cat >input <<'_ATEOF'
116409error
116410_ATEOF
116411
116412{ set +x
116413$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116414at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116415( $at_check_trace;  $PREPARSER ./calc input
116416) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116417at_status=$? at_failed=false
116418$at_check_filter
116419echo stderr:; tee stderr <"$at_stderr"
116420at_fn_diff_devnull "$at_stdout" || at_failed=:
116421at_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"
116427at_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>&-
116430at_status=$? at_failed=false
116431$at_check_filter
116432echo stderr:; tee stderr <"$at_stderr"
116433at_fn_diff_devnull "$at_stdout" || at_failed=:
116434at_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.
116443sed '/^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
116458mv at-stderr stderr
116459# 2. Create the reference error message.
116460cat >expout <<'_ATEOF'
1164611.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.
116467sed 's/syntax error, .*$/syntax error/' expout >at-expout
116468mv at-expout expout
116469# 5. Check
116470{ set +x
116471$as_echo "$at_srcdir/calc.at:699: cat stderr"
116472at_fn_check_prepare_trace "calc.at:699"
116473( $at_check_trace; cat stderr
116474) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116475at_status=$? at_failed=false
116476$at_check_filter
116477at_fn_diff_devnull "$at_stderr" || at_failed=:
116478$at_diff expout "$at_stdout" || at_failed=:
116479at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
116480$at_failed && at_fn_log_failure
116481$at_traceon; }
116482
116483
116484cat >input <<'_ATEOF'
1164851 = 2 = 3
116486_ATEOF
116487
116488{ set +x
116489$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116490at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116491( $at_check_trace;  $PREPARSER ./calc input
116492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116493at_status=$? at_failed=false
116494$at_check_filter
116495echo stderr:; tee stderr <"$at_stderr"
116496at_fn_diff_devnull "$at_stdout" || at_failed=:
116497at_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"
116503at_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>&-
116506at_status=$? at_failed=false
116507$at_check_filter
116508echo stderr:; tee stderr <"$at_stderr"
116509at_fn_diff_devnull "$at_stdout" || at_failed=:
116510at_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.
116519sed '/^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
116534mv at-stderr stderr
116535# 2. Create the reference error message.
116536cat >expout <<'_ATEOF'
1165371.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.
116543sed 's/syntax error, .*$/syntax error/' expout >at-expout
116544mv at-expout expout
116545# 5. Check
116546{ set +x
116547$as_echo "$at_srcdir/calc.at:699: cat stderr"
116548at_fn_check_prepare_trace "calc.at:699"
116549( $at_check_trace; cat stderr
116550) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116551at_status=$? at_failed=false
116552$at_check_filter
116553at_fn_diff_devnull "$at_stderr" || at_failed=:
116554$at_diff expout "$at_stdout" || at_failed=:
116555at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
116556$at_failed && at_fn_log_failure
116557$at_traceon; }
116558
116559
116560cat >input <<'_ATEOF'
116561
116562+1
116563_ATEOF
116564
116565{ set +x
116566$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116567at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116568( $at_check_trace;  $PREPARSER ./calc input
116569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116570at_status=$? at_failed=false
116571$at_check_filter
116572echo stderr:; tee stderr <"$at_stderr"
116573at_fn_diff_devnull "$at_stdout" || at_failed=:
116574at_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"
116580at_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>&-
116583at_status=$? at_failed=false
116584$at_check_filter
116585echo stderr:; tee stderr <"$at_stderr"
116586at_fn_diff_devnull "$at_stdout" || at_failed=:
116587at_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.
116596sed '/^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
116611mv at-stderr stderr
116612# 2. Create the reference error message.
116613cat >expout <<'_ATEOF'
1166142.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.
116620sed 's/syntax error, .*$/syntax error/' expout >at-expout
116621mv at-expout expout
116622# 5. Check
116623{ set +x
116624$as_echo "$at_srcdir/calc.at:699: cat stderr"
116625at_fn_check_prepare_trace "calc.at:699"
116626( $at_check_trace; cat stderr
116627) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116628at_status=$? at_failed=false
116629$at_check_filter
116630at_fn_diff_devnull "$at_stderr" || at_failed=:
116631$at_diff expout "$at_stdout" || at_failed=:
116632at_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"
116640at_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>&-
116643at_status=$? at_failed=false
116644$at_check_filter
116645echo stderr:; tee stderr <"$at_stderr"
116646at_fn_diff_devnull "$at_stdout" || at_failed=:
116647at_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"
116653at_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>&-
116656at_status=$? at_failed=false
116657$at_check_filter
116658echo stderr:; tee stderr <"$at_stderr"
116659at_fn_diff_devnull "$at_stdout" || at_failed=:
116660at_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.
116669sed '/^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
116684mv at-stderr stderr
116685# 2. Create the reference error message.
116686cat >expout <<'_ATEOF'
1166871.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.
116693sed 's/syntax error, .*$/syntax error/' expout >at-expout
116694mv at-expout expout
116695# 5. Check
116696{ set +x
116697$as_echo "$at_srcdir/calc.at:699: cat stderr"
116698at_fn_check_prepare_trace "calc.at:699"
116699( $at_check_trace; cat stderr
116700) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116701at_status=$? at_failed=false
116702$at_check_filter
116703at_fn_diff_devnull "$at_stderr" || at_failed=:
116704$at_diff expout "$at_stdout" || at_failed=:
116705at_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#
116727cat >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"
116733at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116734( $at_check_trace;  $PREPARSER ./calc input
116735) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116736at_status=$? at_failed=false
116737$at_check_filter
116738echo stderr:; tee stderr <"$at_stderr"
116739at_fn_diff_devnull "$at_stdout" || at_failed=:
116740at_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"
116746at_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>&-
116749at_status=$? at_failed=false
116750$at_check_filter
116751echo stderr:; tee stderr <"$at_stderr"
116752at_fn_diff_devnull "$at_stdout" || at_failed=:
116753at_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.
116762sed '/^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
116777mv at-stderr stderr
116778# 2. Create the reference error message.
116779cat >expout <<'_ATEOF'
1167801.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1167811.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1167821.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1167831.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
116784calc: 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.
116790sed 's/syntax error, .*$/syntax error/' expout >at-expout
116791mv at-expout expout
116792# 5. Check
116793{ set +x
116794$as_echo "$at_srcdir/calc.at:699: cat stderr"
116795at_fn_check_prepare_trace "calc.at:699"
116796( $at_check_trace; cat stderr
116797) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116798at_status=$? at_failed=false
116799$at_check_filter
116800at_fn_diff_devnull "$at_stderr" || at_failed=:
116801$at_diff expout "$at_stdout" || at_failed=:
116802at_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.
116810cat >input <<'_ATEOF'
116811(!) + (1 2) = 1
116812_ATEOF
116813
116814{ set +x
116815$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116816at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116817( $at_check_trace;  $PREPARSER ./calc input
116818) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116819at_status=$? at_failed=false
116820$at_check_filter
116821echo stderr:; tee stderr <"$at_stderr"
116822at_fn_diff_devnull "$at_stdout" || at_failed=:
116823at_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"
116829at_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>&-
116832at_status=$? at_failed=false
116833$at_check_filter
116834echo stderr:; tee stderr <"$at_stderr"
116835at_fn_diff_devnull "$at_stdout" || at_failed=:
116836at_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.
116845sed '/^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
116860mv at-stderr stderr
116861# 2. Create the reference error message.
116862cat >expout <<'_ATEOF'
1168631.10: syntax error, unexpected number
116864calc: 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.
116870sed 's/syntax error, .*$/syntax error/' expout >at-expout
116871mv at-expout expout
116872# 5. Check
116873{ set +x
116874$as_echo "$at_srcdir/calc.at:699: cat stderr"
116875at_fn_check_prepare_trace "calc.at:699"
116876( $at_check_trace; cat stderr
116877) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116878at_status=$? at_failed=false
116879$at_check_filter
116880at_fn_diff_devnull "$at_stderr" || at_failed=:
116881$at_diff expout "$at_stdout" || at_failed=:
116882at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
116883$at_failed && at_fn_log_failure
116884$at_traceon; }
116885
116886
116887cat >input <<'_ATEOF'
116888(- *) + (1 2) = 1
116889_ATEOF
116890
116891{ set +x
116892$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116893at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116894( $at_check_trace;  $PREPARSER ./calc input
116895) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116896at_status=$? at_failed=false
116897$at_check_filter
116898echo stderr:; tee stderr <"$at_stderr"
116899at_fn_diff_devnull "$at_stdout" || at_failed=:
116900at_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"
116906at_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>&-
116909at_status=$? at_failed=false
116910$at_check_filter
116911echo stderr:; tee stderr <"$at_stderr"
116912at_fn_diff_devnull "$at_stdout" || at_failed=:
116913at_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.
116922sed '/^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
116937mv at-stderr stderr
116938# 2. Create the reference error message.
116939cat >expout <<'_ATEOF'
1169401.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1169411.12: syntax error, unexpected number
116942calc: 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.
116948sed 's/syntax error, .*$/syntax error/' expout >at-expout
116949mv at-expout expout
116950# 5. Check
116951{ set +x
116952$as_echo "$at_srcdir/calc.at:699: cat stderr"
116953at_fn_check_prepare_trace "calc.at:699"
116954( $at_check_trace; cat stderr
116955) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116956at_status=$? at_failed=false
116957$at_check_filter
116958at_fn_diff_devnull "$at_stderr" || at_failed=:
116959$at_diff expout "$at_stdout" || at_failed=:
116960at_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.
116968cat >input <<'_ATEOF'
116969(* *) + (*) + (*)
116970_ATEOF
116971
116972{ set +x
116973$as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
116974at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
116975( $at_check_trace;  $PREPARSER ./calc input
116976) >>"$at_stdout" 2>>"$at_stderr" 5>&-
116977at_status=$? at_failed=false
116978$at_check_filter
116979echo stderr:; tee stderr <"$at_stderr"
116980at_fn_diff_devnull "$at_stdout" || at_failed=:
116981at_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"
116987at_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>&-
116990at_status=$? at_failed=false
116991$at_check_filter
116992echo stderr:; tee stderr <"$at_stderr"
116993at_fn_diff_devnull "$at_stdout" || at_failed=:
116994at_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.
117003sed '/^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
117018mv at-stderr stderr
117019# 2. Create the reference error message.
117020cat >expout <<'_ATEOF'
1170211.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1170221.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1170231.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.
117029sed 's/syntax error, .*$/syntax error/' expout >at-expout
117030mv at-expout expout
117031# 5. Check
117032{ set +x
117033$as_echo "$at_srcdir/calc.at:699: cat stderr"
117034at_fn_check_prepare_trace "calc.at:699"
117035( $at_check_trace; cat stderr
117036) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117037at_status=$? at_failed=false
117038$at_check_filter
117039at_fn_diff_devnull "$at_stderr" || at_failed=:
117040$at_diff expout "$at_stdout" || at_failed=:
117041at_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
117052read at_status <"$at_status_file"
117053#AT_STOP_244
117054#AT_START_245
117055at_fn_group_banner 245 'calc.at:708' \
117056  "Calculator %language \"C++\" %glr-parser %defines %locations " "" 14
117057at_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
117071cat >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
117112FILE *input;
117113static int power (int base, int exponent);
117114
117115
117116int 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%%
117134input:
117135  line
117136| input line         {  }
117137;
117138
117139line:
117140  '\n'
117141| exp '\n'           { USE ($1); }
117142;
117143
117144exp:
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
117165static int
117166power (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.  */
117177void
117178yy::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
117187cat >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
117198int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
117199static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
117200static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
117201
117202
117203static yy::parser::location_type last_yylloc;
117204
117205static int
117206get_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
117223static void
117224unget_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
117234static int
117235read_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
117266int 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
117296cat >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.  */
117315int
117316yyparse ()
117317{
117318  yy::parser parser;
117319#if YYDEBUG
117320  parser.set_debug_level (1);
117321#endif
117322  return parser.parse ();
117323}
117324
117325
117326semantic_value global_result = 0;
117327int global_count = 0;
117328
117329/* A C main function.  */
117330int
117331main (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
117369if 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"
117377at_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>&-
117381at_status=$? at_failed=false
117382$at_check_filter
117383echo stderr:; cat "$at_stderr"
117384echo stdout:; cat "$at_stdout"
117385at_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"
117391at_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>&-
117394at_status=$? at_failed=false
117395$at_check_filter
117396echo stderr:; cat "$at_stderr"
117397echo stdout:; cat "$at_stdout"
117398at_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"
117407at_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>&-
117412at_status=$? at_failed=false
117413$at_check_filter
117414at_fn_diff_devnull "$at_stderr" || at_failed=:
117415$at_diff expout "$at_stdout" || at_failed=:
117416at_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"
117425at_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>&-
117430at_status=$? at_failed=false
117431$at_check_filter
117432at_fn_diff_devnull "$at_stderr" || at_failed=:
117433$at_diff expout "$at_stdout" || at_failed=:
117434at_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
117440fi
117441{ set +x
117442$as_echo "$at_srcdir/calc.at:708: bison -o calc.cc calc.y"
117443at_fn_check_prepare_trace "calc.at:708"
117444( $at_check_trace; bison -o calc.cc calc.y
117445) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117446at_status=$? at_failed=false
117447$at_check_filter
117448at_fn_diff_devnull "$at_stderr" || at_failed=:
117449at_fn_diff_devnull "$at_stdout" || at_failed=:
117450at_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"
117458at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:708"
117459( $at_check_trace; $BISON_CXX_WORKS
117460) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117461at_status=$? at_failed=false
117462$at_check_filter
117463echo stderr:; cat "$at_stderr"
117464echo stdout:; cat "$at_stdout"
117465at_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"
117471at_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>&-
117474at_status=$? at_failed=false
117475$at_check_filter
117476echo stderr:; cat "$at_stderr"
117477echo stdout:; cat "$at_stdout"
117478at_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"
117493at_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>&-
117504at_status=$? at_failed=false
117505$at_check_filter
117506at_fn_diff_devnull "$at_stderr" || at_failed=:
117507at_fn_diff_devnull "$at_stdout" || at_failed=:
117508at_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"
117522at_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>&-
117533at_status=$? at_failed=false
117534$at_check_filter
117535at_fn_diff_devnull "$at_stderr" || at_failed=:
117536at_fn_diff_devnull "$at_stdout" || at_failed=:
117537at_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.
117543cat >input <<'_ATEOF'
1175441 + 2 * 3 = 7
1175451 + 2 * -3 = -5
117546
117547-1^2 = -1
117548(-1)^2 = 1
117549
117550---1 = -1
117551
1175521 - 2 - 3 = -4
1175531 - (2 - 3) = 2
117554
1175552^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"
117561at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117562( $at_check_trace;  $PREPARSER ./calc input
117563) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117564at_status=$? at_failed=false
117565$at_check_filter
117566echo stderr:; tee stderr <"$at_stderr"
117567at_fn_diff_devnull "$at_stdout" || at_failed=:
117568at_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"
117574at_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>&-
117577at_status=$? at_failed=false
117578$at_check_filter
117579echo stderr:; tee stderr <"$at_stderr"
117580at_fn_diff_devnull "$at_stdout" || at_failed=:
117581at_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.
117589cat >input <<'_ATEOF'
1175901 2
117591_ATEOF
117592
117593{ set +x
117594$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
117595at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117596( $at_check_trace;  $PREPARSER ./calc input
117597) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117598at_status=$? at_failed=false
117599$at_check_filter
117600echo stderr:; tee stderr <"$at_stderr"
117601at_fn_diff_devnull "$at_stdout" || at_failed=:
117602at_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"
117608at_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>&-
117611at_status=$? at_failed=false
117612$at_check_filter
117613echo stderr:; tee stderr <"$at_stderr"
117614at_fn_diff_devnull "$at_stdout" || at_failed=:
117615at_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.
117624sed '/^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
117639mv at-stderr stderr
117640# 2. Create the reference error message.
117641cat >expout <<'_ATEOF'
1176421.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.
117648sed 's/syntax error, .*$/syntax error/' expout >at-expout
117649mv at-expout expout
117650# 5. Check
117651{ set +x
117652$as_echo "$at_srcdir/calc.at:708: cat stderr"
117653at_fn_check_prepare_trace "calc.at:708"
117654( $at_check_trace; cat stderr
117655) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117656at_status=$? at_failed=false
117657$at_check_filter
117658at_fn_diff_devnull "$at_stderr" || at_failed=:
117659$at_diff expout "$at_stdout" || at_failed=:
117660at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
117661$at_failed && at_fn_log_failure
117662$at_traceon; }
117663
117664
117665cat >input <<'_ATEOF'
1176661//2
117667_ATEOF
117668
117669{ set +x
117670$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
117671at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117672( $at_check_trace;  $PREPARSER ./calc input
117673) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117674at_status=$? at_failed=false
117675$at_check_filter
117676echo stderr:; tee stderr <"$at_stderr"
117677at_fn_diff_devnull "$at_stdout" || at_failed=:
117678at_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"
117684at_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>&-
117687at_status=$? at_failed=false
117688$at_check_filter
117689echo stderr:; tee stderr <"$at_stderr"
117690at_fn_diff_devnull "$at_stdout" || at_failed=:
117691at_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.
117700sed '/^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
117715mv at-stderr stderr
117716# 2. Create the reference error message.
117717cat >expout <<'_ATEOF'
1177181.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.
117724sed 's/syntax error, .*$/syntax error/' expout >at-expout
117725mv at-expout expout
117726# 5. Check
117727{ set +x
117728$as_echo "$at_srcdir/calc.at:708: cat stderr"
117729at_fn_check_prepare_trace "calc.at:708"
117730( $at_check_trace; cat stderr
117731) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117732at_status=$? at_failed=false
117733$at_check_filter
117734at_fn_diff_devnull "$at_stderr" || at_failed=:
117735$at_diff expout "$at_stdout" || at_failed=:
117736at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
117737$at_failed && at_fn_log_failure
117738$at_traceon; }
117739
117740
117741cat >input <<'_ATEOF'
117742error
117743_ATEOF
117744
117745{ set +x
117746$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
117747at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117748( $at_check_trace;  $PREPARSER ./calc input
117749) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117750at_status=$? at_failed=false
117751$at_check_filter
117752echo stderr:; tee stderr <"$at_stderr"
117753at_fn_diff_devnull "$at_stdout" || at_failed=:
117754at_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"
117760at_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>&-
117763at_status=$? at_failed=false
117764$at_check_filter
117765echo stderr:; tee stderr <"$at_stderr"
117766at_fn_diff_devnull "$at_stdout" || at_failed=:
117767at_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.
117776sed '/^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
117791mv at-stderr stderr
117792# 2. Create the reference error message.
117793cat >expout <<'_ATEOF'
1177941.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.
117800sed 's/syntax error, .*$/syntax error/' expout >at-expout
117801mv at-expout expout
117802# 5. Check
117803{ set +x
117804$as_echo "$at_srcdir/calc.at:708: cat stderr"
117805at_fn_check_prepare_trace "calc.at:708"
117806( $at_check_trace; cat stderr
117807) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117808at_status=$? at_failed=false
117809$at_check_filter
117810at_fn_diff_devnull "$at_stderr" || at_failed=:
117811$at_diff expout "$at_stdout" || at_failed=:
117812at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
117813$at_failed && at_fn_log_failure
117814$at_traceon; }
117815
117816
117817cat >input <<'_ATEOF'
1178181 = 2 = 3
117819_ATEOF
117820
117821{ set +x
117822$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
117823at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117824( $at_check_trace;  $PREPARSER ./calc input
117825) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117826at_status=$? at_failed=false
117827$at_check_filter
117828echo stderr:; tee stderr <"$at_stderr"
117829at_fn_diff_devnull "$at_stdout" || at_failed=:
117830at_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"
117836at_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>&-
117839at_status=$? at_failed=false
117840$at_check_filter
117841echo stderr:; tee stderr <"$at_stderr"
117842at_fn_diff_devnull "$at_stdout" || at_failed=:
117843at_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.
117852sed '/^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
117867mv at-stderr stderr
117868# 2. Create the reference error message.
117869cat >expout <<'_ATEOF'
1178701.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.
117876sed 's/syntax error, .*$/syntax error/' expout >at-expout
117877mv at-expout expout
117878# 5. Check
117879{ set +x
117880$as_echo "$at_srcdir/calc.at:708: cat stderr"
117881at_fn_check_prepare_trace "calc.at:708"
117882( $at_check_trace; cat stderr
117883) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117884at_status=$? at_failed=false
117885$at_check_filter
117886at_fn_diff_devnull "$at_stderr" || at_failed=:
117887$at_diff expout "$at_stdout" || at_failed=:
117888at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
117889$at_failed && at_fn_log_failure
117890$at_traceon; }
117891
117892
117893cat >input <<'_ATEOF'
117894
117895+1
117896_ATEOF
117897
117898{ set +x
117899$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
117900at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
117901( $at_check_trace;  $PREPARSER ./calc input
117902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117903at_status=$? at_failed=false
117904$at_check_filter
117905echo stderr:; tee stderr <"$at_stderr"
117906at_fn_diff_devnull "$at_stdout" || at_failed=:
117907at_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"
117913at_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>&-
117916at_status=$? at_failed=false
117917$at_check_filter
117918echo stderr:; tee stderr <"$at_stderr"
117919at_fn_diff_devnull "$at_stdout" || at_failed=:
117920at_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.
117929sed '/^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
117944mv at-stderr stderr
117945# 2. Create the reference error message.
117946cat >expout <<'_ATEOF'
1179472.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.
117953sed 's/syntax error, .*$/syntax error/' expout >at-expout
117954mv at-expout expout
117955# 5. Check
117956{ set +x
117957$as_echo "$at_srcdir/calc.at:708: cat stderr"
117958at_fn_check_prepare_trace "calc.at:708"
117959( $at_check_trace; cat stderr
117960) >>"$at_stdout" 2>>"$at_stderr" 5>&-
117961at_status=$? at_failed=false
117962$at_check_filter
117963at_fn_diff_devnull "$at_stderr" || at_failed=:
117964$at_diff expout "$at_stdout" || at_failed=:
117965at_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"
117973at_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>&-
117976at_status=$? at_failed=false
117977$at_check_filter
117978echo stderr:; tee stderr <"$at_stderr"
117979at_fn_diff_devnull "$at_stdout" || at_failed=:
117980at_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"
117986at_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>&-
117989at_status=$? at_failed=false
117990$at_check_filter
117991echo stderr:; tee stderr <"$at_stderr"
117992at_fn_diff_devnull "$at_stdout" || at_failed=:
117993at_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.
118002sed '/^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
118017mv at-stderr stderr
118018# 2. Create the reference error message.
118019cat >expout <<'_ATEOF'
1180201.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.
118026sed 's/syntax error, .*$/syntax error/' expout >at-expout
118027mv at-expout expout
118028# 5. Check
118029{ set +x
118030$as_echo "$at_srcdir/calc.at:708: cat stderr"
118031at_fn_check_prepare_trace "calc.at:708"
118032( $at_check_trace; cat stderr
118033) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118034at_status=$? at_failed=false
118035$at_check_filter
118036at_fn_diff_devnull "$at_stderr" || at_failed=:
118037$at_diff expout "$at_stdout" || at_failed=:
118038at_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#
118060cat >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"
118066at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
118067( $at_check_trace;  $PREPARSER ./calc input
118068) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118069at_status=$? at_failed=false
118070$at_check_filter
118071echo stderr:; tee stderr <"$at_stderr"
118072at_fn_diff_devnull "$at_stdout" || at_failed=:
118073at_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"
118079at_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>&-
118082at_status=$? at_failed=false
118083$at_check_filter
118084echo stderr:; tee stderr <"$at_stderr"
118085at_fn_diff_devnull "$at_stdout" || at_failed=:
118086at_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.
118095sed '/^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
118110mv at-stderr stderr
118111# 2. Create the reference error message.
118112cat >expout <<'_ATEOF'
1181131.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1181141.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1181151.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1181161.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
118117calc: 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.
118123sed 's/syntax error, .*$/syntax error/' expout >at-expout
118124mv at-expout expout
118125# 5. Check
118126{ set +x
118127$as_echo "$at_srcdir/calc.at:708: cat stderr"
118128at_fn_check_prepare_trace "calc.at:708"
118129( $at_check_trace; cat stderr
118130) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118131at_status=$? at_failed=false
118132$at_check_filter
118133at_fn_diff_devnull "$at_stderr" || at_failed=:
118134$at_diff expout "$at_stdout" || at_failed=:
118135at_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.
118143cat >input <<'_ATEOF'
118144(!) + (1 2) = 1
118145_ATEOF
118146
118147{ set +x
118148$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
118149at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
118150( $at_check_trace;  $PREPARSER ./calc input
118151) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118152at_status=$? at_failed=false
118153$at_check_filter
118154echo stderr:; tee stderr <"$at_stderr"
118155at_fn_diff_devnull "$at_stdout" || at_failed=:
118156at_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"
118162at_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>&-
118165at_status=$? at_failed=false
118166$at_check_filter
118167echo stderr:; tee stderr <"$at_stderr"
118168at_fn_diff_devnull "$at_stdout" || at_failed=:
118169at_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.
118178sed '/^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
118193mv at-stderr stderr
118194# 2. Create the reference error message.
118195cat >expout <<'_ATEOF'
1181961.10: syntax error, unexpected number
118197calc: 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.
118203sed 's/syntax error, .*$/syntax error/' expout >at-expout
118204mv at-expout expout
118205# 5. Check
118206{ set +x
118207$as_echo "$at_srcdir/calc.at:708: cat stderr"
118208at_fn_check_prepare_trace "calc.at:708"
118209( $at_check_trace; cat stderr
118210) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118211at_status=$? at_failed=false
118212$at_check_filter
118213at_fn_diff_devnull "$at_stderr" || at_failed=:
118214$at_diff expout "$at_stdout" || at_failed=:
118215at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
118216$at_failed && at_fn_log_failure
118217$at_traceon; }
118218
118219
118220cat >input <<'_ATEOF'
118221(- *) + (1 2) = 1
118222_ATEOF
118223
118224{ set +x
118225$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
118226at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
118227( $at_check_trace;  $PREPARSER ./calc input
118228) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118229at_status=$? at_failed=false
118230$at_check_filter
118231echo stderr:; tee stderr <"$at_stderr"
118232at_fn_diff_devnull "$at_stdout" || at_failed=:
118233at_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"
118239at_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>&-
118242at_status=$? at_failed=false
118243$at_check_filter
118244echo stderr:; tee stderr <"$at_stderr"
118245at_fn_diff_devnull "$at_stdout" || at_failed=:
118246at_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.
118255sed '/^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
118270mv at-stderr stderr
118271# 2. Create the reference error message.
118272cat >expout <<'_ATEOF'
1182731.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1182741.12: syntax error, unexpected number
118275calc: 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.
118281sed 's/syntax error, .*$/syntax error/' expout >at-expout
118282mv at-expout expout
118283# 5. Check
118284{ set +x
118285$as_echo "$at_srcdir/calc.at:708: cat stderr"
118286at_fn_check_prepare_trace "calc.at:708"
118287( $at_check_trace; cat stderr
118288) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118289at_status=$? at_failed=false
118290$at_check_filter
118291at_fn_diff_devnull "$at_stderr" || at_failed=:
118292$at_diff expout "$at_stdout" || at_failed=:
118293at_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.
118301cat >input <<'_ATEOF'
118302(* *) + (*) + (*)
118303_ATEOF
118304
118305{ set +x
118306$as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
118307at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
118308( $at_check_trace;  $PREPARSER ./calc input
118309) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118310at_status=$? at_failed=false
118311$at_check_filter
118312echo stderr:; tee stderr <"$at_stderr"
118313at_fn_diff_devnull "$at_stdout" || at_failed=:
118314at_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"
118320at_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>&-
118323at_status=$? at_failed=false
118324$at_check_filter
118325echo stderr:; tee stderr <"$at_stderr"
118326at_fn_diff_devnull "$at_stdout" || at_failed=:
118327at_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.
118336sed '/^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
118351mv at-stderr stderr
118352# 2. Create the reference error message.
118353cat >expout <<'_ATEOF'
1183541.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1183551.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1183561.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.
118362sed 's/syntax error, .*$/syntax error/' expout >at-expout
118363mv at-expout expout
118364# 5. Check
118365{ set +x
118366$as_echo "$at_srcdir/calc.at:708: cat stderr"
118367at_fn_check_prepare_trace "calc.at:708"
118368( $at_check_trace; cat stderr
118369) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118370at_status=$? at_failed=false
118371$at_check_filter
118372at_fn_diff_devnull "$at_stderr" || at_failed=:
118373$at_diff expout "$at_stdout" || at_failed=:
118374at_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
118385read at_status <"$at_status_file"
118386#AT_STOP_245
118387#AT_START_246
118388at_fn_group_banner 246 'calc.at:709' \
118389  "Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span" "" 14
118390at_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
118404cat >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
118472FILE *input;
118473static int power (int base, int exponent);
118474
118475
118476int 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%%
118499input:
118500  line
118501| input line         {  }
118502;
118503
118504line:
118505  '\n'
118506| exp '\n'           { USE ($1); }
118507;
118508
118509exp:
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
118530static int
118531power (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.  */
118553void
118554yy::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
118563cat >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
118574int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
118575static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
118576static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
118577
118578
118579static yy::parser::location_type last_yylloc;
118580
118581static int
118582get_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
118599static void
118600unget_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
118610static int
118611read_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
118642int 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
118672cat >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.  */
118691int
118692yyparse ()
118693{
118694  yy::parser parser;
118695#if YYDEBUG
118696  parser.set_debug_level (1);
118697#endif
118698  return parser.parse ();
118699}
118700
118701
118702semantic_value global_result = 0;
118703int global_count = 0;
118704
118705/* A C main function.  */
118706int
118707main (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
118745if 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"
118753at_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>&-
118757at_status=$? at_failed=false
118758$at_check_filter
118759echo stderr:; cat "$at_stderr"
118760echo stdout:; cat "$at_stdout"
118761at_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"
118767at_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>&-
118770at_status=$? at_failed=false
118771$at_check_filter
118772echo stderr:; cat "$at_stderr"
118773echo stdout:; cat "$at_stdout"
118774at_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"
118783at_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>&-
118788at_status=$? at_failed=false
118789$at_check_filter
118790at_fn_diff_devnull "$at_stderr" || at_failed=:
118791$at_diff expout "$at_stdout" || at_failed=:
118792at_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"
118801at_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>&-
118806at_status=$? at_failed=false
118807$at_check_filter
118808at_fn_diff_devnull "$at_stderr" || at_failed=:
118809$at_diff expout "$at_stdout" || at_failed=:
118810at_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
118816fi
118817{ set +x
118818$as_echo "$at_srcdir/calc.at:709: bison -o calc.cc calc.y"
118819at_fn_check_prepare_trace "calc.at:709"
118820( $at_check_trace; bison -o calc.cc calc.y
118821) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118822at_status=$? at_failed=false
118823$at_check_filter
118824at_fn_diff_devnull "$at_stderr" || at_failed=:
118825at_fn_diff_devnull "$at_stdout" || at_failed=:
118826at_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"
118834at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:709"
118835( $at_check_trace; $BISON_CXX_WORKS
118836) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118837at_status=$? at_failed=false
118838$at_check_filter
118839echo stderr:; cat "$at_stderr"
118840echo stdout:; cat "$at_stdout"
118841at_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"
118847at_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>&-
118850at_status=$? at_failed=false
118851$at_check_filter
118852echo stderr:; cat "$at_stderr"
118853echo stdout:; cat "$at_stdout"
118854at_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"
118869at_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>&-
118880at_status=$? at_failed=false
118881$at_check_filter
118882at_fn_diff_devnull "$at_stderr" || at_failed=:
118883at_fn_diff_devnull "$at_stdout" || at_failed=:
118884at_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"
118898at_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>&-
118909at_status=$? at_failed=false
118910$at_check_filter
118911at_fn_diff_devnull "$at_stderr" || at_failed=:
118912at_fn_diff_devnull "$at_stdout" || at_failed=:
118913at_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.
118919cat >input <<'_ATEOF'
1189201 + 2 * 3 = 7
1189211 + 2 * -3 = -5
118922
118923-1^2 = -1
118924(-1)^2 = 1
118925
118926---1 = -1
118927
1189281 - 2 - 3 = -4
1189291 - (2 - 3) = 2
118930
1189312^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"
118937at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
118938( $at_check_trace;  $PREPARSER ./calc input
118939) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118940at_status=$? at_failed=false
118941$at_check_filter
118942echo stderr:; tee stderr <"$at_stderr"
118943at_fn_diff_devnull "$at_stdout" || at_failed=:
118944at_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"
118950at_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>&-
118953at_status=$? at_failed=false
118954$at_check_filter
118955echo stderr:; tee stderr <"$at_stderr"
118956at_fn_diff_devnull "$at_stdout" || at_failed=:
118957at_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.
118965cat >input <<'_ATEOF'
1189661 2
118967_ATEOF
118968
118969{ set +x
118970$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
118971at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
118972( $at_check_trace;  $PREPARSER ./calc input
118973) >>"$at_stdout" 2>>"$at_stderr" 5>&-
118974at_status=$? at_failed=false
118975$at_check_filter
118976echo stderr:; tee stderr <"$at_stderr"
118977at_fn_diff_devnull "$at_stdout" || at_failed=:
118978at_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"
118984at_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>&-
118987at_status=$? at_failed=false
118988$at_check_filter
118989echo stderr:; tee stderr <"$at_stderr"
118990at_fn_diff_devnull "$at_stdout" || at_failed=:
118991at_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.
119000sed '/^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
119015mv at-stderr stderr
119016# 2. Create the reference error message.
119017cat >expout <<'_ATEOF'
1190181.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.
119024sed 's/syntax error, .*$/syntax error/' expout >at-expout
119025mv at-expout expout
119026# 5. Check
119027{ set +x
119028$as_echo "$at_srcdir/calc.at:709: cat stderr"
119029at_fn_check_prepare_trace "calc.at:709"
119030( $at_check_trace; cat stderr
119031) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119032at_status=$? at_failed=false
119033$at_check_filter
119034at_fn_diff_devnull "$at_stderr" || at_failed=:
119035$at_diff expout "$at_stdout" || at_failed=:
119036at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
119037$at_failed && at_fn_log_failure
119038$at_traceon; }
119039
119040
119041cat >input <<'_ATEOF'
1190421//2
119043_ATEOF
119044
119045{ set +x
119046$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119047at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119048( $at_check_trace;  $PREPARSER ./calc input
119049) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119050at_status=$? at_failed=false
119051$at_check_filter
119052echo stderr:; tee stderr <"$at_stderr"
119053at_fn_diff_devnull "$at_stdout" || at_failed=:
119054at_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"
119060at_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>&-
119063at_status=$? at_failed=false
119064$at_check_filter
119065echo stderr:; tee stderr <"$at_stderr"
119066at_fn_diff_devnull "$at_stdout" || at_failed=:
119067at_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.
119076sed '/^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
119091mv at-stderr stderr
119092# 2. Create the reference error message.
119093cat >expout <<'_ATEOF'
1190941.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.
119100sed 's/syntax error, .*$/syntax error/' expout >at-expout
119101mv at-expout expout
119102# 5. Check
119103{ set +x
119104$as_echo "$at_srcdir/calc.at:709: cat stderr"
119105at_fn_check_prepare_trace "calc.at:709"
119106( $at_check_trace; cat stderr
119107) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119108at_status=$? at_failed=false
119109$at_check_filter
119110at_fn_diff_devnull "$at_stderr" || at_failed=:
119111$at_diff expout "$at_stdout" || at_failed=:
119112at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
119113$at_failed && at_fn_log_failure
119114$at_traceon; }
119115
119116
119117cat >input <<'_ATEOF'
119118error
119119_ATEOF
119120
119121{ set +x
119122$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119123at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119124( $at_check_trace;  $PREPARSER ./calc input
119125) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119126at_status=$? at_failed=false
119127$at_check_filter
119128echo stderr:; tee stderr <"$at_stderr"
119129at_fn_diff_devnull "$at_stdout" || at_failed=:
119130at_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"
119136at_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>&-
119139at_status=$? at_failed=false
119140$at_check_filter
119141echo stderr:; tee stderr <"$at_stderr"
119142at_fn_diff_devnull "$at_stdout" || at_failed=:
119143at_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.
119152sed '/^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
119167mv at-stderr stderr
119168# 2. Create the reference error message.
119169cat >expout <<'_ATEOF'
1191701.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.
119176sed 's/syntax error, .*$/syntax error/' expout >at-expout
119177mv at-expout expout
119178# 5. Check
119179{ set +x
119180$as_echo "$at_srcdir/calc.at:709: cat stderr"
119181at_fn_check_prepare_trace "calc.at:709"
119182( $at_check_trace; cat stderr
119183) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119184at_status=$? at_failed=false
119185$at_check_filter
119186at_fn_diff_devnull "$at_stderr" || at_failed=:
119187$at_diff expout "$at_stdout" || at_failed=:
119188at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
119189$at_failed && at_fn_log_failure
119190$at_traceon; }
119191
119192
119193cat >input <<'_ATEOF'
1191941 = 2 = 3
119195_ATEOF
119196
119197{ set +x
119198$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119199at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119200( $at_check_trace;  $PREPARSER ./calc input
119201) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119202at_status=$? at_failed=false
119203$at_check_filter
119204echo stderr:; tee stderr <"$at_stderr"
119205at_fn_diff_devnull "$at_stdout" || at_failed=:
119206at_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"
119212at_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>&-
119215at_status=$? at_failed=false
119216$at_check_filter
119217echo stderr:; tee stderr <"$at_stderr"
119218at_fn_diff_devnull "$at_stdout" || at_failed=:
119219at_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.
119228sed '/^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
119243mv at-stderr stderr
119244# 2. Create the reference error message.
119245cat >expout <<'_ATEOF'
1192461.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.
119252sed 's/syntax error, .*$/syntax error/' expout >at-expout
119253mv at-expout expout
119254# 5. Check
119255{ set +x
119256$as_echo "$at_srcdir/calc.at:709: cat stderr"
119257at_fn_check_prepare_trace "calc.at:709"
119258( $at_check_trace; cat stderr
119259) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119260at_status=$? at_failed=false
119261$at_check_filter
119262at_fn_diff_devnull "$at_stderr" || at_failed=:
119263$at_diff expout "$at_stdout" || at_failed=:
119264at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
119265$at_failed && at_fn_log_failure
119266$at_traceon; }
119267
119268
119269cat >input <<'_ATEOF'
119270
119271+1
119272_ATEOF
119273
119274{ set +x
119275$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119276at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119277( $at_check_trace;  $PREPARSER ./calc input
119278) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119279at_status=$? at_failed=false
119280$at_check_filter
119281echo stderr:; tee stderr <"$at_stderr"
119282at_fn_diff_devnull "$at_stdout" || at_failed=:
119283at_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"
119289at_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>&-
119292at_status=$? at_failed=false
119293$at_check_filter
119294echo stderr:; tee stderr <"$at_stderr"
119295at_fn_diff_devnull "$at_stdout" || at_failed=:
119296at_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.
119305sed '/^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
119320mv at-stderr stderr
119321# 2. Create the reference error message.
119322cat >expout <<'_ATEOF'
1193232.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.
119329sed 's/syntax error, .*$/syntax error/' expout >at-expout
119330mv at-expout expout
119331# 5. Check
119332{ set +x
119333$as_echo "$at_srcdir/calc.at:709: cat stderr"
119334at_fn_check_prepare_trace "calc.at:709"
119335( $at_check_trace; cat stderr
119336) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119337at_status=$? at_failed=false
119338$at_check_filter
119339at_fn_diff_devnull "$at_stderr" || at_failed=:
119340$at_diff expout "$at_stdout" || at_failed=:
119341at_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"
119349at_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>&-
119352at_status=$? at_failed=false
119353$at_check_filter
119354echo stderr:; tee stderr <"$at_stderr"
119355at_fn_diff_devnull "$at_stdout" || at_failed=:
119356at_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"
119362at_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>&-
119365at_status=$? at_failed=false
119366$at_check_filter
119367echo stderr:; tee stderr <"$at_stderr"
119368at_fn_diff_devnull "$at_stdout" || at_failed=:
119369at_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.
119378sed '/^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
119393mv at-stderr stderr
119394# 2. Create the reference error message.
119395cat >expout <<'_ATEOF'
1193961.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.
119402sed 's/syntax error, .*$/syntax error/' expout >at-expout
119403mv at-expout expout
119404# 5. Check
119405{ set +x
119406$as_echo "$at_srcdir/calc.at:709: cat stderr"
119407at_fn_check_prepare_trace "calc.at:709"
119408( $at_check_trace; cat stderr
119409) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119410at_status=$? at_failed=false
119411$at_check_filter
119412at_fn_diff_devnull "$at_stderr" || at_failed=:
119413$at_diff expout "$at_stdout" || at_failed=:
119414at_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#
119436cat >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"
119442at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119443( $at_check_trace;  $PREPARSER ./calc input
119444) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119445at_status=$? at_failed=false
119446$at_check_filter
119447echo stderr:; tee stderr <"$at_stderr"
119448at_fn_diff_devnull "$at_stdout" || at_failed=:
119449at_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"
119455at_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>&-
119458at_status=$? at_failed=false
119459$at_check_filter
119460echo stderr:; tee stderr <"$at_stderr"
119461at_fn_diff_devnull "$at_stdout" || at_failed=:
119462at_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.
119471sed '/^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
119486mv at-stderr stderr
119487# 2. Create the reference error message.
119488cat >expout <<'_ATEOF'
1194891.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1194901.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1194911.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1194921.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
119493calc: 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.
119499sed 's/syntax error, .*$/syntax error/' expout >at-expout
119500mv at-expout expout
119501# 5. Check
119502{ set +x
119503$as_echo "$at_srcdir/calc.at:709: cat stderr"
119504at_fn_check_prepare_trace "calc.at:709"
119505( $at_check_trace; cat stderr
119506) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119507at_status=$? at_failed=false
119508$at_check_filter
119509at_fn_diff_devnull "$at_stderr" || at_failed=:
119510$at_diff expout "$at_stdout" || at_failed=:
119511at_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.
119519cat >input <<'_ATEOF'
119520(!) + (1 2) = 1
119521_ATEOF
119522
119523{ set +x
119524$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119525at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119526( $at_check_trace;  $PREPARSER ./calc input
119527) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119528at_status=$? at_failed=false
119529$at_check_filter
119530echo stderr:; tee stderr <"$at_stderr"
119531at_fn_diff_devnull "$at_stdout" || at_failed=:
119532at_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"
119538at_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>&-
119541at_status=$? at_failed=false
119542$at_check_filter
119543echo stderr:; tee stderr <"$at_stderr"
119544at_fn_diff_devnull "$at_stdout" || at_failed=:
119545at_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.
119554sed '/^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
119569mv at-stderr stderr
119570# 2. Create the reference error message.
119571cat >expout <<'_ATEOF'
1195721.10: syntax error, unexpected number
119573calc: 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.
119579sed 's/syntax error, .*$/syntax error/' expout >at-expout
119580mv at-expout expout
119581# 5. Check
119582{ set +x
119583$as_echo "$at_srcdir/calc.at:709: cat stderr"
119584at_fn_check_prepare_trace "calc.at:709"
119585( $at_check_trace; cat stderr
119586) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119587at_status=$? at_failed=false
119588$at_check_filter
119589at_fn_diff_devnull "$at_stderr" || at_failed=:
119590$at_diff expout "$at_stdout" || at_failed=:
119591at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
119592$at_failed && at_fn_log_failure
119593$at_traceon; }
119594
119595
119596cat >input <<'_ATEOF'
119597(- *) + (1 2) = 1
119598_ATEOF
119599
119600{ set +x
119601$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119602at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119603( $at_check_trace;  $PREPARSER ./calc input
119604) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119605at_status=$? at_failed=false
119606$at_check_filter
119607echo stderr:; tee stderr <"$at_stderr"
119608at_fn_diff_devnull "$at_stdout" || at_failed=:
119609at_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"
119615at_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>&-
119618at_status=$? at_failed=false
119619$at_check_filter
119620echo stderr:; tee stderr <"$at_stderr"
119621at_fn_diff_devnull "$at_stdout" || at_failed=:
119622at_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.
119631sed '/^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
119646mv at-stderr stderr
119647# 2. Create the reference error message.
119648cat >expout <<'_ATEOF'
1196491.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1196501.12: syntax error, unexpected number
119651calc: 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.
119657sed 's/syntax error, .*$/syntax error/' expout >at-expout
119658mv at-expout expout
119659# 5. Check
119660{ set +x
119661$as_echo "$at_srcdir/calc.at:709: cat stderr"
119662at_fn_check_prepare_trace "calc.at:709"
119663( $at_check_trace; cat stderr
119664) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119665at_status=$? at_failed=false
119666$at_check_filter
119667at_fn_diff_devnull "$at_stderr" || at_failed=:
119668$at_diff expout "$at_stdout" || at_failed=:
119669at_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.
119677cat >input <<'_ATEOF'
119678(* *) + (*) + (*)
119679_ATEOF
119680
119681{ set +x
119682$as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
119683at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
119684( $at_check_trace;  $PREPARSER ./calc input
119685) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119686at_status=$? at_failed=false
119687$at_check_filter
119688echo stderr:; tee stderr <"$at_stderr"
119689at_fn_diff_devnull "$at_stdout" || at_failed=:
119690at_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"
119696at_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>&-
119699at_status=$? at_failed=false
119700$at_check_filter
119701echo stderr:; tee stderr <"$at_stderr"
119702at_fn_diff_devnull "$at_stdout" || at_failed=:
119703at_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.
119712sed '/^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
119727mv at-stderr stderr
119728# 2. Create the reference error message.
119729cat >expout <<'_ATEOF'
1197301.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1197311.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1197321.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.
119738sed 's/syntax error, .*$/syntax error/' expout >at-expout
119739mv at-expout expout
119740# 5. Check
119741{ set +x
119742$as_echo "$at_srcdir/calc.at:709: cat stderr"
119743at_fn_check_prepare_trace "calc.at:709"
119744( $at_check_trace; cat stderr
119745) >>"$at_stdout" 2>>"$at_stderr" 5>&-
119746at_status=$? at_failed=false
119747$at_check_filter
119748at_fn_diff_devnull "$at_stderr" || at_failed=:
119749$at_diff expout "$at_stdout" || at_failed=:
119750at_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
119761read at_status <"$at_status_file"
119762#AT_STOP_246
119763#AT_START_247
119764at_fn_group_banner 247 'calc.at:710' \
119765  "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 14
119766at_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
119780cat >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
119821FILE *input;
119822static int power (int base, int exponent);
119823
119824
119825int 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%%
119843input:
119844  line
119845| input line         {  }
119846;
119847
119848line:
119849  '\n'
119850| exp '\n'           { USE ($1); }
119851;
119852
119853exp:
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
119874static int
119875power (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.  */
119886void
119887calc::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
119896cat >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
119907int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
119908static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
119909static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
119910
119911
119912static calc::parser::location_type last_yylloc;
119913
119914static int
119915get_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
119932static void
119933unget_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
119943static int
119944read_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
119975int 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
120005cat >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.  */
120024int
120025calcparse ()
120026{
120027  calc::parser parser;
120028#if YYDEBUG
120029  parser.set_debug_level (1);
120030#endif
120031  return parser.parse ();
120032}
120033
120034
120035semantic_value global_result = 0;
120036int global_count = 0;
120037
120038/* A C main function.  */
120039int
120040main (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
120078if 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"
120086at_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>&-
120090at_status=$? at_failed=false
120091$at_check_filter
120092echo stderr:; cat "$at_stderr"
120093echo stdout:; cat "$at_stdout"
120094at_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"
120100at_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>&-
120103at_status=$? at_failed=false
120104$at_check_filter
120105echo stderr:; cat "$at_stderr"
120106echo stdout:; cat "$at_stdout"
120107at_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"
120116at_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>&-
120121at_status=$? at_failed=false
120122$at_check_filter
120123at_fn_diff_devnull "$at_stderr" || at_failed=:
120124$at_diff expout "$at_stdout" || at_failed=:
120125at_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"
120134at_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>&-
120139at_status=$? at_failed=false
120140$at_check_filter
120141at_fn_diff_devnull "$at_stderr" || at_failed=:
120142$at_diff expout "$at_stdout" || at_failed=:
120143at_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
120149fi
120150{ set +x
120151$as_echo "$at_srcdir/calc.at:710: bison -o calc.cc calc.y"
120152at_fn_check_prepare_trace "calc.at:710"
120153( $at_check_trace; bison -o calc.cc calc.y
120154) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120155at_status=$? at_failed=false
120156$at_check_filter
120157at_fn_diff_devnull "$at_stderr" || at_failed=:
120158at_fn_diff_devnull "$at_stdout" || at_failed=:
120159at_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"
120167at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:710"
120168( $at_check_trace; $BISON_CXX_WORKS
120169) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120170at_status=$? at_failed=false
120171$at_check_filter
120172echo stderr:; cat "$at_stderr"
120173echo stdout:; cat "$at_stdout"
120174at_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"
120180at_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>&-
120183at_status=$? at_failed=false
120184$at_check_filter
120185echo stderr:; cat "$at_stderr"
120186echo stdout:; cat "$at_stdout"
120187at_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"
120202at_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>&-
120213at_status=$? at_failed=false
120214$at_check_filter
120215at_fn_diff_devnull "$at_stderr" || at_failed=:
120216at_fn_diff_devnull "$at_stdout" || at_failed=:
120217at_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"
120231at_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>&-
120242at_status=$? at_failed=false
120243$at_check_filter
120244at_fn_diff_devnull "$at_stderr" || at_failed=:
120245at_fn_diff_devnull "$at_stdout" || at_failed=:
120246at_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.
120252cat >input <<'_ATEOF'
1202531 + 2 * 3 = 7
1202541 + 2 * -3 = -5
120255
120256-1^2 = -1
120257(-1)^2 = 1
120258
120259---1 = -1
120260
1202611 - 2 - 3 = -4
1202621 - (2 - 3) = 2
120263
1202642^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"
120270at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120271( $at_check_trace;  $PREPARSER ./calc input
120272) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120273at_status=$? at_failed=false
120274$at_check_filter
120275echo stderr:; tee stderr <"$at_stderr"
120276at_fn_diff_devnull "$at_stdout" || at_failed=:
120277at_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"
120283at_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>&-
120286at_status=$? at_failed=false
120287$at_check_filter
120288echo stderr:; tee stderr <"$at_stderr"
120289at_fn_diff_devnull "$at_stdout" || at_failed=:
120290at_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.
120298cat >input <<'_ATEOF'
1202991 2
120300_ATEOF
120301
120302{ set +x
120303$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120304at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120305( $at_check_trace;  $PREPARSER ./calc input
120306) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120307at_status=$? at_failed=false
120308$at_check_filter
120309echo stderr:; tee stderr <"$at_stderr"
120310at_fn_diff_devnull "$at_stdout" || at_failed=:
120311at_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"
120317at_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>&-
120320at_status=$? at_failed=false
120321$at_check_filter
120322echo stderr:; tee stderr <"$at_stderr"
120323at_fn_diff_devnull "$at_stdout" || at_failed=:
120324at_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.
120333sed '/^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
120348mv at-stderr stderr
120349# 2. Create the reference error message.
120350cat >expout <<'_ATEOF'
1203511.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"
120361at_fn_check_prepare_trace "calc.at:710"
120362( $at_check_trace; cat stderr
120363) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120364at_status=$? at_failed=false
120365$at_check_filter
120366at_fn_diff_devnull "$at_stderr" || at_failed=:
120367$at_diff expout "$at_stdout" || at_failed=:
120368at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
120369$at_failed && at_fn_log_failure
120370$at_traceon; }
120371
120372
120373cat >input <<'_ATEOF'
1203741//2
120375_ATEOF
120376
120377{ set +x
120378$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120379at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120380( $at_check_trace;  $PREPARSER ./calc input
120381) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120382at_status=$? at_failed=false
120383$at_check_filter
120384echo stderr:; tee stderr <"$at_stderr"
120385at_fn_diff_devnull "$at_stdout" || at_failed=:
120386at_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"
120392at_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>&-
120395at_status=$? at_failed=false
120396$at_check_filter
120397echo stderr:; tee stderr <"$at_stderr"
120398at_fn_diff_devnull "$at_stdout" || at_failed=:
120399at_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.
120408sed '/^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
120423mv at-stderr stderr
120424# 2. Create the reference error message.
120425cat >expout <<'_ATEOF'
1204261.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"
120436at_fn_check_prepare_trace "calc.at:710"
120437( $at_check_trace; cat stderr
120438) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120439at_status=$? at_failed=false
120440$at_check_filter
120441at_fn_diff_devnull "$at_stderr" || at_failed=:
120442$at_diff expout "$at_stdout" || at_failed=:
120443at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
120444$at_failed && at_fn_log_failure
120445$at_traceon; }
120446
120447
120448cat >input <<'_ATEOF'
120449error
120450_ATEOF
120451
120452{ set +x
120453$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120454at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120455( $at_check_trace;  $PREPARSER ./calc input
120456) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120457at_status=$? at_failed=false
120458$at_check_filter
120459echo stderr:; tee stderr <"$at_stderr"
120460at_fn_diff_devnull "$at_stdout" || at_failed=:
120461at_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"
120467at_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>&-
120470at_status=$? at_failed=false
120471$at_check_filter
120472echo stderr:; tee stderr <"$at_stderr"
120473at_fn_diff_devnull "$at_stdout" || at_failed=:
120474at_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.
120483sed '/^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
120498mv at-stderr stderr
120499# 2. Create the reference error message.
120500cat >expout <<'_ATEOF'
1205011.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"
120511at_fn_check_prepare_trace "calc.at:710"
120512( $at_check_trace; cat stderr
120513) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120514at_status=$? at_failed=false
120515$at_check_filter
120516at_fn_diff_devnull "$at_stderr" || at_failed=:
120517$at_diff expout "$at_stdout" || at_failed=:
120518at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
120519$at_failed && at_fn_log_failure
120520$at_traceon; }
120521
120522
120523cat >input <<'_ATEOF'
1205241 = 2 = 3
120525_ATEOF
120526
120527{ set +x
120528$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120529at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120530( $at_check_trace;  $PREPARSER ./calc input
120531) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120532at_status=$? at_failed=false
120533$at_check_filter
120534echo stderr:; tee stderr <"$at_stderr"
120535at_fn_diff_devnull "$at_stdout" || at_failed=:
120536at_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"
120542at_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>&-
120545at_status=$? at_failed=false
120546$at_check_filter
120547echo stderr:; tee stderr <"$at_stderr"
120548at_fn_diff_devnull "$at_stdout" || at_failed=:
120549at_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.
120558sed '/^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
120573mv at-stderr stderr
120574# 2. Create the reference error message.
120575cat >expout <<'_ATEOF'
1205761.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"
120586at_fn_check_prepare_trace "calc.at:710"
120587( $at_check_trace; cat stderr
120588) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120589at_status=$? at_failed=false
120590$at_check_filter
120591at_fn_diff_devnull "$at_stderr" || at_failed=:
120592$at_diff expout "$at_stdout" || at_failed=:
120593at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
120594$at_failed && at_fn_log_failure
120595$at_traceon; }
120596
120597
120598cat >input <<'_ATEOF'
120599
120600+1
120601_ATEOF
120602
120603{ set +x
120604$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120605at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120606( $at_check_trace;  $PREPARSER ./calc input
120607) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120608at_status=$? at_failed=false
120609$at_check_filter
120610echo stderr:; tee stderr <"$at_stderr"
120611at_fn_diff_devnull "$at_stdout" || at_failed=:
120612at_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"
120618at_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>&-
120621at_status=$? at_failed=false
120622$at_check_filter
120623echo stderr:; tee stderr <"$at_stderr"
120624at_fn_diff_devnull "$at_stdout" || at_failed=:
120625at_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.
120634sed '/^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
120649mv at-stderr stderr
120650# 2. Create the reference error message.
120651cat >expout <<'_ATEOF'
1206522.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"
120662at_fn_check_prepare_trace "calc.at:710"
120663( $at_check_trace; cat stderr
120664) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120665at_status=$? at_failed=false
120666$at_check_filter
120667at_fn_diff_devnull "$at_stderr" || at_failed=:
120668$at_diff expout "$at_stdout" || at_failed=:
120669at_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"
120677at_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>&-
120680at_status=$? at_failed=false
120681$at_check_filter
120682echo stderr:; tee stderr <"$at_stderr"
120683at_fn_diff_devnull "$at_stdout" || at_failed=:
120684at_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"
120690at_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>&-
120693at_status=$? at_failed=false
120694$at_check_filter
120695echo stderr:; tee stderr <"$at_stderr"
120696at_fn_diff_devnull "$at_stdout" || at_failed=:
120697at_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.
120706sed '/^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
120721mv at-stderr stderr
120722# 2. Create the reference error message.
120723cat >expout <<'_ATEOF'
1207241.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"
120734at_fn_check_prepare_trace "calc.at:710"
120735( $at_check_trace; cat stderr
120736) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120737at_status=$? at_failed=false
120738$at_check_filter
120739at_fn_diff_devnull "$at_stderr" || at_failed=:
120740$at_diff expout "$at_stdout" || at_failed=:
120741at_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#
120763cat >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"
120769at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120770( $at_check_trace;  $PREPARSER ./calc input
120771) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120772at_status=$? at_failed=false
120773$at_check_filter
120774echo stderr:; tee stderr <"$at_stderr"
120775at_fn_diff_devnull "$at_stdout" || at_failed=:
120776at_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"
120782at_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>&-
120785at_status=$? at_failed=false
120786$at_check_filter
120787echo stderr:; tee stderr <"$at_stderr"
120788at_fn_diff_devnull "$at_stdout" || at_failed=:
120789at_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.
120798sed '/^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
120813mv at-stderr stderr
120814# 2. Create the reference error message.
120815cat >expout <<'_ATEOF'
1208161.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1208171.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1208181.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1208191.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
120820calc: 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"
120830at_fn_check_prepare_trace "calc.at:710"
120831( $at_check_trace; cat stderr
120832) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120833at_status=$? at_failed=false
120834$at_check_filter
120835at_fn_diff_devnull "$at_stderr" || at_failed=:
120836$at_diff expout "$at_stdout" || at_failed=:
120837at_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.
120845cat >input <<'_ATEOF'
120846(!) + (1 2) = 1
120847_ATEOF
120848
120849{ set +x
120850$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120851at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120852( $at_check_trace;  $PREPARSER ./calc input
120853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120854at_status=$? at_failed=false
120855$at_check_filter
120856echo stderr:; tee stderr <"$at_stderr"
120857at_fn_diff_devnull "$at_stdout" || at_failed=:
120858at_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"
120864at_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>&-
120867at_status=$? at_failed=false
120868$at_check_filter
120869echo stderr:; tee stderr <"$at_stderr"
120870at_fn_diff_devnull "$at_stdout" || at_failed=:
120871at_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.
120880sed '/^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
120895mv at-stderr stderr
120896# 2. Create the reference error message.
120897cat >expout <<'_ATEOF'
1208981.10: syntax error, unexpected number
120899calc: 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"
120909at_fn_check_prepare_trace "calc.at:710"
120910( $at_check_trace; cat stderr
120911) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120912at_status=$? at_failed=false
120913$at_check_filter
120914at_fn_diff_devnull "$at_stderr" || at_failed=:
120915$at_diff expout "$at_stdout" || at_failed=:
120916at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
120917$at_failed && at_fn_log_failure
120918$at_traceon; }
120919
120920
120921cat >input <<'_ATEOF'
120922(- *) + (1 2) = 1
120923_ATEOF
120924
120925{ set +x
120926$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
120927at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
120928( $at_check_trace;  $PREPARSER ./calc input
120929) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120930at_status=$? at_failed=false
120931$at_check_filter
120932echo stderr:; tee stderr <"$at_stderr"
120933at_fn_diff_devnull "$at_stdout" || at_failed=:
120934at_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"
120940at_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>&-
120943at_status=$? at_failed=false
120944$at_check_filter
120945echo stderr:; tee stderr <"$at_stderr"
120946at_fn_diff_devnull "$at_stdout" || at_failed=:
120947at_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.
120956sed '/^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
120971mv at-stderr stderr
120972# 2. Create the reference error message.
120973cat >expout <<'_ATEOF'
1209741.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1209751.12: syntax error, unexpected number
120976calc: 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"
120986at_fn_check_prepare_trace "calc.at:710"
120987( $at_check_trace; cat stderr
120988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
120989at_status=$? at_failed=false
120990$at_check_filter
120991at_fn_diff_devnull "$at_stderr" || at_failed=:
120992$at_diff expout "$at_stdout" || at_failed=:
120993at_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.
121001cat >input <<'_ATEOF'
121002(* *) + (*) + (*)
121003_ATEOF
121004
121005{ set +x
121006$as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
121007at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
121008( $at_check_trace;  $PREPARSER ./calc input
121009) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121010at_status=$? at_failed=false
121011$at_check_filter
121012echo stderr:; tee stderr <"$at_stderr"
121013at_fn_diff_devnull "$at_stdout" || at_failed=:
121014at_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"
121020at_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>&-
121023at_status=$? at_failed=false
121024$at_check_filter
121025echo stderr:; tee stderr <"$at_stderr"
121026at_fn_diff_devnull "$at_stdout" || at_failed=:
121027at_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.
121036sed '/^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
121051mv at-stderr stderr
121052# 2. Create the reference error message.
121053cat >expout <<'_ATEOF'
1210541.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1210551.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1210561.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"
121066at_fn_check_prepare_trace "calc.at:710"
121067( $at_check_trace; cat stderr
121068) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121069at_status=$? at_failed=false
121070$at_check_filter
121071at_fn_diff_devnull "$at_stderr" || at_failed=:
121072$at_diff expout "$at_stdout" || at_failed=:
121073at_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
121084read at_status <"$at_status_file"
121085#AT_STOP_247
121086#AT_START_248
121087at_fn_group_banner 248 'calc.at:711' \
121088  "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 14
121089at_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
121103cat >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
121144FILE *input;
121145static int power (int base, int exponent);
121146
121147
121148int 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%%
121166input:
121167  line
121168| input line         {  }
121169;
121170
121171line:
121172  '\n'
121173| exp '\n'           { USE ($1); }
121174;
121175
121176exp:
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
121197static int
121198power (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.  */
121209void
121210calc::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
121219cat >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
121230int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
121231static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
121232static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
121233
121234
121235static calc::parser::location_type last_yylloc;
121236
121237static int
121238get_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
121255static void
121256unget_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
121266static int
121267read_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
121298int 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
121328cat >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.  */
121347int
121348calcparse ()
121349{
121350  calc::parser parser;
121351#if CALCDEBUG
121352  parser.set_debug_level (1);
121353#endif
121354  return parser.parse ();
121355}
121356
121357
121358semantic_value global_result = 0;
121359int global_count = 0;
121360
121361/* A C main function.  */
121362int
121363main (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
121401if 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"
121409at_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>&-
121413at_status=$? at_failed=false
121414$at_check_filter
121415echo stderr:; cat "$at_stderr"
121416echo stdout:; cat "$at_stdout"
121417at_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"
121423at_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>&-
121426at_status=$? at_failed=false
121427$at_check_filter
121428echo stderr:; cat "$at_stderr"
121429echo stdout:; cat "$at_stdout"
121430at_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"
121439at_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>&-
121444at_status=$? at_failed=false
121445$at_check_filter
121446at_fn_diff_devnull "$at_stderr" || at_failed=:
121447$at_diff expout "$at_stdout" || at_failed=:
121448at_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"
121457at_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>&-
121462at_status=$? at_failed=false
121463$at_check_filter
121464at_fn_diff_devnull "$at_stderr" || at_failed=:
121465$at_diff expout "$at_stdout" || at_failed=:
121466at_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
121472fi
121473{ set +x
121474$as_echo "$at_srcdir/calc.at:711: bison -o calc.cc calc.y"
121475at_fn_check_prepare_trace "calc.at:711"
121476( $at_check_trace; bison -o calc.cc calc.y
121477) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121478at_status=$? at_failed=false
121479$at_check_filter
121480at_fn_diff_devnull "$at_stderr" || at_failed=:
121481at_fn_diff_devnull "$at_stdout" || at_failed=:
121482at_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"
121490at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:711"
121491( $at_check_trace; $BISON_CXX_WORKS
121492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121493at_status=$? at_failed=false
121494$at_check_filter
121495echo stderr:; cat "$at_stderr"
121496echo stdout:; cat "$at_stdout"
121497at_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"
121503at_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>&-
121506at_status=$? at_failed=false
121507$at_check_filter
121508echo stderr:; cat "$at_stderr"
121509echo stdout:; cat "$at_stdout"
121510at_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"
121525at_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>&-
121536at_status=$? at_failed=false
121537$at_check_filter
121538at_fn_diff_devnull "$at_stderr" || at_failed=:
121539at_fn_diff_devnull "$at_stdout" || at_failed=:
121540at_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"
121554at_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>&-
121565at_status=$? at_failed=false
121566$at_check_filter
121567at_fn_diff_devnull "$at_stderr" || at_failed=:
121568at_fn_diff_devnull "$at_stdout" || at_failed=:
121569at_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.
121575cat >input <<'_ATEOF'
1215761 + 2 * 3 = 7
1215771 + 2 * -3 = -5
121578
121579-1^2 = -1
121580(-1)^2 = 1
121581
121582---1 = -1
121583
1215841 - 2 - 3 = -4
1215851 - (2 - 3) = 2
121586
1215872^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"
121593at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121594( $at_check_trace;  $PREPARSER ./calc input
121595) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121596at_status=$? at_failed=false
121597$at_check_filter
121598echo stderr:; tee stderr <"$at_stderr"
121599at_fn_diff_devnull "$at_stdout" || at_failed=:
121600at_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"
121606at_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>&-
121609at_status=$? at_failed=false
121610$at_check_filter
121611echo stderr:; tee stderr <"$at_stderr"
121612at_fn_diff_devnull "$at_stdout" || at_failed=:
121613at_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.
121621cat >input <<'_ATEOF'
1216221 2
121623_ATEOF
121624
121625{ set +x
121626$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
121627at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121628( $at_check_trace;  $PREPARSER ./calc input
121629) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121630at_status=$? at_failed=false
121631$at_check_filter
121632echo stderr:; tee stderr <"$at_stderr"
121633at_fn_diff_devnull "$at_stdout" || at_failed=:
121634at_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"
121640at_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>&-
121643at_status=$? at_failed=false
121644$at_check_filter
121645echo stderr:; tee stderr <"$at_stderr"
121646at_fn_diff_devnull "$at_stdout" || at_failed=:
121647at_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.
121656sed '/^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
121671mv at-stderr stderr
121672# 2. Create the reference error message.
121673cat >expout <<'_ATEOF'
1216741.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"
121684at_fn_check_prepare_trace "calc.at:711"
121685( $at_check_trace; cat stderr
121686) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121687at_status=$? at_failed=false
121688$at_check_filter
121689at_fn_diff_devnull "$at_stderr" || at_failed=:
121690$at_diff expout "$at_stdout" || at_failed=:
121691at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
121692$at_failed && at_fn_log_failure
121693$at_traceon; }
121694
121695
121696cat >input <<'_ATEOF'
1216971//2
121698_ATEOF
121699
121700{ set +x
121701$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
121702at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121703( $at_check_trace;  $PREPARSER ./calc input
121704) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121705at_status=$? at_failed=false
121706$at_check_filter
121707echo stderr:; tee stderr <"$at_stderr"
121708at_fn_diff_devnull "$at_stdout" || at_failed=:
121709at_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"
121715at_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>&-
121718at_status=$? at_failed=false
121719$at_check_filter
121720echo stderr:; tee stderr <"$at_stderr"
121721at_fn_diff_devnull "$at_stdout" || at_failed=:
121722at_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.
121731sed '/^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
121746mv at-stderr stderr
121747# 2. Create the reference error message.
121748cat >expout <<'_ATEOF'
1217491.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"
121759at_fn_check_prepare_trace "calc.at:711"
121760( $at_check_trace; cat stderr
121761) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121762at_status=$? at_failed=false
121763$at_check_filter
121764at_fn_diff_devnull "$at_stderr" || at_failed=:
121765$at_diff expout "$at_stdout" || at_failed=:
121766at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
121767$at_failed && at_fn_log_failure
121768$at_traceon; }
121769
121770
121771cat >input <<'_ATEOF'
121772error
121773_ATEOF
121774
121775{ set +x
121776$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
121777at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121778( $at_check_trace;  $PREPARSER ./calc input
121779) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121780at_status=$? at_failed=false
121781$at_check_filter
121782echo stderr:; tee stderr <"$at_stderr"
121783at_fn_diff_devnull "$at_stdout" || at_failed=:
121784at_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"
121790at_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>&-
121793at_status=$? at_failed=false
121794$at_check_filter
121795echo stderr:; tee stderr <"$at_stderr"
121796at_fn_diff_devnull "$at_stdout" || at_failed=:
121797at_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.
121806sed '/^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
121821mv at-stderr stderr
121822# 2. Create the reference error message.
121823cat >expout <<'_ATEOF'
1218241.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"
121834at_fn_check_prepare_trace "calc.at:711"
121835( $at_check_trace; cat stderr
121836) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121837at_status=$? at_failed=false
121838$at_check_filter
121839at_fn_diff_devnull "$at_stderr" || at_failed=:
121840$at_diff expout "$at_stdout" || at_failed=:
121841at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
121842$at_failed && at_fn_log_failure
121843$at_traceon; }
121844
121845
121846cat >input <<'_ATEOF'
1218471 = 2 = 3
121848_ATEOF
121849
121850{ set +x
121851$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
121852at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121853( $at_check_trace;  $PREPARSER ./calc input
121854) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121855at_status=$? at_failed=false
121856$at_check_filter
121857echo stderr:; tee stderr <"$at_stderr"
121858at_fn_diff_devnull "$at_stdout" || at_failed=:
121859at_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"
121865at_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>&-
121868at_status=$? at_failed=false
121869$at_check_filter
121870echo stderr:; tee stderr <"$at_stderr"
121871at_fn_diff_devnull "$at_stdout" || at_failed=:
121872at_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.
121881sed '/^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
121896mv at-stderr stderr
121897# 2. Create the reference error message.
121898cat >expout <<'_ATEOF'
1218991.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"
121909at_fn_check_prepare_trace "calc.at:711"
121910( $at_check_trace; cat stderr
121911) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121912at_status=$? at_failed=false
121913$at_check_filter
121914at_fn_diff_devnull "$at_stderr" || at_failed=:
121915$at_diff expout "$at_stdout" || at_failed=:
121916at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
121917$at_failed && at_fn_log_failure
121918$at_traceon; }
121919
121920
121921cat >input <<'_ATEOF'
121922
121923+1
121924_ATEOF
121925
121926{ set +x
121927$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
121928at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
121929( $at_check_trace;  $PREPARSER ./calc input
121930) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121931at_status=$? at_failed=false
121932$at_check_filter
121933echo stderr:; tee stderr <"$at_stderr"
121934at_fn_diff_devnull "$at_stdout" || at_failed=:
121935at_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"
121941at_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>&-
121944at_status=$? at_failed=false
121945$at_check_filter
121946echo stderr:; tee stderr <"$at_stderr"
121947at_fn_diff_devnull "$at_stdout" || at_failed=:
121948at_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.
121957sed '/^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
121972mv at-stderr stderr
121973# 2. Create the reference error message.
121974cat >expout <<'_ATEOF'
1219752.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"
121985at_fn_check_prepare_trace "calc.at:711"
121986( $at_check_trace; cat stderr
121987) >>"$at_stdout" 2>>"$at_stderr" 5>&-
121988at_status=$? at_failed=false
121989$at_check_filter
121990at_fn_diff_devnull "$at_stderr" || at_failed=:
121991$at_diff expout "$at_stdout" || at_failed=:
121992at_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"
122000at_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>&-
122003at_status=$? at_failed=false
122004$at_check_filter
122005echo stderr:; tee stderr <"$at_stderr"
122006at_fn_diff_devnull "$at_stdout" || at_failed=:
122007at_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"
122013at_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>&-
122016at_status=$? at_failed=false
122017$at_check_filter
122018echo stderr:; tee stderr <"$at_stderr"
122019at_fn_diff_devnull "$at_stdout" || at_failed=:
122020at_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.
122029sed '/^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
122044mv at-stderr stderr
122045# 2. Create the reference error message.
122046cat >expout <<'_ATEOF'
1220471.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"
122057at_fn_check_prepare_trace "calc.at:711"
122058( $at_check_trace; cat stderr
122059) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122060at_status=$? at_failed=false
122061$at_check_filter
122062at_fn_diff_devnull "$at_stderr" || at_failed=:
122063$at_diff expout "$at_stdout" || at_failed=:
122064at_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#
122086cat >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"
122092at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
122093( $at_check_trace;  $PREPARSER ./calc input
122094) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122095at_status=$? at_failed=false
122096$at_check_filter
122097echo stderr:; tee stderr <"$at_stderr"
122098at_fn_diff_devnull "$at_stdout" || at_failed=:
122099at_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"
122105at_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>&-
122108at_status=$? at_failed=false
122109$at_check_filter
122110echo stderr:; tee stderr <"$at_stderr"
122111at_fn_diff_devnull "$at_stdout" || at_failed=:
122112at_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.
122121sed '/^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
122136mv at-stderr stderr
122137# 2. Create the reference error message.
122138cat >expout <<'_ATEOF'
1221391.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1221401.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1221411.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1221421.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
122143calc: 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"
122153at_fn_check_prepare_trace "calc.at:711"
122154( $at_check_trace; cat stderr
122155) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122156at_status=$? at_failed=false
122157$at_check_filter
122158at_fn_diff_devnull "$at_stderr" || at_failed=:
122159$at_diff expout "$at_stdout" || at_failed=:
122160at_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.
122168cat >input <<'_ATEOF'
122169(!) + (1 2) = 1
122170_ATEOF
122171
122172{ set +x
122173$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
122174at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
122175( $at_check_trace;  $PREPARSER ./calc input
122176) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122177at_status=$? at_failed=false
122178$at_check_filter
122179echo stderr:; tee stderr <"$at_stderr"
122180at_fn_diff_devnull "$at_stdout" || at_failed=:
122181at_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"
122187at_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>&-
122190at_status=$? at_failed=false
122191$at_check_filter
122192echo stderr:; tee stderr <"$at_stderr"
122193at_fn_diff_devnull "$at_stdout" || at_failed=:
122194at_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.
122203sed '/^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
122218mv at-stderr stderr
122219# 2. Create the reference error message.
122220cat >expout <<'_ATEOF'
1222211.10: syntax error, unexpected number
122222calc: 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"
122232at_fn_check_prepare_trace "calc.at:711"
122233( $at_check_trace; cat stderr
122234) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122235at_status=$? at_failed=false
122236$at_check_filter
122237at_fn_diff_devnull "$at_stderr" || at_failed=:
122238$at_diff expout "$at_stdout" || at_failed=:
122239at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
122240$at_failed && at_fn_log_failure
122241$at_traceon; }
122242
122243
122244cat >input <<'_ATEOF'
122245(- *) + (1 2) = 1
122246_ATEOF
122247
122248{ set +x
122249$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
122250at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
122251( $at_check_trace;  $PREPARSER ./calc input
122252) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122253at_status=$? at_failed=false
122254$at_check_filter
122255echo stderr:; tee stderr <"$at_stderr"
122256at_fn_diff_devnull "$at_stdout" || at_failed=:
122257at_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"
122263at_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>&-
122266at_status=$? at_failed=false
122267$at_check_filter
122268echo stderr:; tee stderr <"$at_stderr"
122269at_fn_diff_devnull "$at_stdout" || at_failed=:
122270at_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.
122279sed '/^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
122294mv at-stderr stderr
122295# 2. Create the reference error message.
122296cat >expout <<'_ATEOF'
1222971.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1222981.12: syntax error, unexpected number
122299calc: 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"
122309at_fn_check_prepare_trace "calc.at:711"
122310( $at_check_trace; cat stderr
122311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122312at_status=$? at_failed=false
122313$at_check_filter
122314at_fn_diff_devnull "$at_stderr" || at_failed=:
122315$at_diff expout "$at_stdout" || at_failed=:
122316at_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.
122324cat >input <<'_ATEOF'
122325(* *) + (*) + (*)
122326_ATEOF
122327
122328{ set +x
122329$as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
122330at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
122331( $at_check_trace;  $PREPARSER ./calc input
122332) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122333at_status=$? at_failed=false
122334$at_check_filter
122335echo stderr:; tee stderr <"$at_stderr"
122336at_fn_diff_devnull "$at_stdout" || at_failed=:
122337at_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"
122343at_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>&-
122346at_status=$? at_failed=false
122347$at_check_filter
122348echo stderr:; tee stderr <"$at_stderr"
122349at_fn_diff_devnull "$at_stdout" || at_failed=:
122350at_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.
122359sed '/^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
122374mv at-stderr stderr
122375# 2. Create the reference error message.
122376cat >expout <<'_ATEOF'
1223771.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1223781.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1223791.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"
122389at_fn_check_prepare_trace "calc.at:711"
122390( $at_check_trace; cat stderr
122391) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122392at_status=$? at_failed=false
122393$at_check_filter
122394at_fn_diff_devnull "$at_stderr" || at_failed=:
122395$at_diff expout "$at_stdout" || at_failed=:
122396at_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
122407read at_status <"$at_status_file"
122408#AT_STOP_248
122409#AT_START_249
122410at_fn_group_banner 249 'calc.at:713' \
122411  "Calculator %language \"C++\" %glr-parser %defines %locations %debug" "" 14
122412at_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
122426cat >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
122467FILE *input;
122468static int power (int base, int exponent);
122469
122470
122471int 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%%
122489input:
122490  line
122491| input line         {  }
122492;
122493
122494line:
122495  '\n'
122496| exp '\n'           { USE ($1); }
122497;
122498
122499exp:
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
122520static int
122521power (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.  */
122532void
122533yy::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
122542cat >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
122553int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
122554static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
122555static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
122556
122557
122558static yy::parser::location_type last_yylloc;
122559
122560static int
122561get_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
122578static void
122579unget_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
122589static int
122590read_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
122621int 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
122651cat >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.  */
122670int
122671yyparse ()
122672{
122673  yy::parser parser;
122674#if YYDEBUG
122675  parser.set_debug_level (1);
122676#endif
122677  return parser.parse ();
122678}
122679
122680
122681semantic_value global_result = 0;
122682int global_count = 0;
122683
122684/* A C main function.  */
122685int
122686main (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
122724if 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"
122732at_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>&-
122736at_status=$? at_failed=false
122737$at_check_filter
122738echo stderr:; cat "$at_stderr"
122739echo stdout:; cat "$at_stdout"
122740at_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"
122746at_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>&-
122749at_status=$? at_failed=false
122750$at_check_filter
122751echo stderr:; cat "$at_stderr"
122752echo stdout:; cat "$at_stdout"
122753at_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"
122762at_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>&-
122767at_status=$? at_failed=false
122768$at_check_filter
122769at_fn_diff_devnull "$at_stderr" || at_failed=:
122770$at_diff expout "$at_stdout" || at_failed=:
122771at_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"
122780at_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>&-
122785at_status=$? at_failed=false
122786$at_check_filter
122787at_fn_diff_devnull "$at_stderr" || at_failed=:
122788$at_diff expout "$at_stdout" || at_failed=:
122789at_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
122795fi
122796{ set +x
122797$as_echo "$at_srcdir/calc.at:713: bison -o calc.cc calc.y"
122798at_fn_check_prepare_trace "calc.at:713"
122799( $at_check_trace; bison -o calc.cc calc.y
122800) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122801at_status=$? at_failed=false
122802$at_check_filter
122803at_fn_diff_devnull "$at_stderr" || at_failed=:
122804at_fn_diff_devnull "$at_stdout" || at_failed=:
122805at_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"
122813at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713"
122814( $at_check_trace; $BISON_CXX_WORKS
122815) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122816at_status=$? at_failed=false
122817$at_check_filter
122818echo stderr:; cat "$at_stderr"
122819echo stdout:; cat "$at_stdout"
122820at_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"
122826at_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>&-
122829at_status=$? at_failed=false
122830$at_check_filter
122831echo stderr:; cat "$at_stderr"
122832echo stdout:; cat "$at_stdout"
122833at_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"
122848at_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>&-
122859at_status=$? at_failed=false
122860$at_check_filter
122861at_fn_diff_devnull "$at_stderr" || at_failed=:
122862at_fn_diff_devnull "$at_stdout" || at_failed=:
122863at_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"
122877at_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>&-
122888at_status=$? at_failed=false
122889$at_check_filter
122890at_fn_diff_devnull "$at_stderr" || at_failed=:
122891at_fn_diff_devnull "$at_stdout" || at_failed=:
122892at_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.
122898cat >input <<'_ATEOF'
1228991 + 2 * 3 = 7
1229001 + 2 * -3 = -5
122901
122902-1^2 = -1
122903(-1)^2 = 1
122904
122905---1 = -1
122906
1229071 - 2 - 3 = -4
1229081 - (2 - 3) = 2
122909
1229102^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"
122916at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
122917( $at_check_trace;  $PREPARSER ./calc input
122918) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122919at_status=$? at_failed=false
122920$at_check_filter
122921echo stderr:; tee stderr <"$at_stderr"
122922at_fn_diff_devnull "$at_stdout" || at_failed=:
122923at_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"
122929at_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>&-
122932at_status=$? at_failed=false
122933$at_check_filter
122934echo stderr:; tee stderr <"$at_stderr"
122935at_fn_diff_devnull "$at_stdout" || at_failed=:
122936at_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.
122944cat >input <<'_ATEOF'
1229451 2
122946_ATEOF
122947
122948{ set +x
122949$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
122950at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
122951( $at_check_trace;  $PREPARSER ./calc input
122952) >>"$at_stdout" 2>>"$at_stderr" 5>&-
122953at_status=$? at_failed=false
122954$at_check_filter
122955echo stderr:; tee stderr <"$at_stderr"
122956at_fn_diff_devnull "$at_stdout" || at_failed=:
122957at_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"
122963at_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>&-
122966at_status=$? at_failed=false
122967$at_check_filter
122968echo stderr:; tee stderr <"$at_stderr"
122969at_fn_diff_devnull "$at_stdout" || at_failed=:
122970at_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.
122979sed '/^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
122994mv at-stderr stderr
122995# 2. Create the reference error message.
122996cat >expout <<'_ATEOF'
1229971.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.
123003sed 's/syntax error, .*$/syntax error/' expout >at-expout
123004mv at-expout expout
123005# 5. Check
123006{ set +x
123007$as_echo "$at_srcdir/calc.at:713: cat stderr"
123008at_fn_check_prepare_trace "calc.at:713"
123009( $at_check_trace; cat stderr
123010) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123011at_status=$? at_failed=false
123012$at_check_filter
123013at_fn_diff_devnull "$at_stderr" || at_failed=:
123014$at_diff expout "$at_stdout" || at_failed=:
123015at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
123016$at_failed && at_fn_log_failure
123017$at_traceon; }
123018
123019
123020cat >input <<'_ATEOF'
1230211//2
123022_ATEOF
123023
123024{ set +x
123025$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123026at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123027( $at_check_trace;  $PREPARSER ./calc input
123028) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123029at_status=$? at_failed=false
123030$at_check_filter
123031echo stderr:; tee stderr <"$at_stderr"
123032at_fn_diff_devnull "$at_stdout" || at_failed=:
123033at_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"
123039at_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>&-
123042at_status=$? at_failed=false
123043$at_check_filter
123044echo stderr:; tee stderr <"$at_stderr"
123045at_fn_diff_devnull "$at_stdout" || at_failed=:
123046at_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.
123055sed '/^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
123070mv at-stderr stderr
123071# 2. Create the reference error message.
123072cat >expout <<'_ATEOF'
1230731.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.
123079sed 's/syntax error, .*$/syntax error/' expout >at-expout
123080mv at-expout expout
123081# 5. Check
123082{ set +x
123083$as_echo "$at_srcdir/calc.at:713: cat stderr"
123084at_fn_check_prepare_trace "calc.at:713"
123085( $at_check_trace; cat stderr
123086) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123087at_status=$? at_failed=false
123088$at_check_filter
123089at_fn_diff_devnull "$at_stderr" || at_failed=:
123090$at_diff expout "$at_stdout" || at_failed=:
123091at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
123092$at_failed && at_fn_log_failure
123093$at_traceon; }
123094
123095
123096cat >input <<'_ATEOF'
123097error
123098_ATEOF
123099
123100{ set +x
123101$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123102at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123103( $at_check_trace;  $PREPARSER ./calc input
123104) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123105at_status=$? at_failed=false
123106$at_check_filter
123107echo stderr:; tee stderr <"$at_stderr"
123108at_fn_diff_devnull "$at_stdout" || at_failed=:
123109at_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"
123115at_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>&-
123118at_status=$? at_failed=false
123119$at_check_filter
123120echo stderr:; tee stderr <"$at_stderr"
123121at_fn_diff_devnull "$at_stdout" || at_failed=:
123122at_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.
123131sed '/^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
123146mv at-stderr stderr
123147# 2. Create the reference error message.
123148cat >expout <<'_ATEOF'
1231491.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.
123155sed 's/syntax error, .*$/syntax error/' expout >at-expout
123156mv at-expout expout
123157# 5. Check
123158{ set +x
123159$as_echo "$at_srcdir/calc.at:713: cat stderr"
123160at_fn_check_prepare_trace "calc.at:713"
123161( $at_check_trace; cat stderr
123162) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123163at_status=$? at_failed=false
123164$at_check_filter
123165at_fn_diff_devnull "$at_stderr" || at_failed=:
123166$at_diff expout "$at_stdout" || at_failed=:
123167at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
123168$at_failed && at_fn_log_failure
123169$at_traceon; }
123170
123171
123172cat >input <<'_ATEOF'
1231731 = 2 = 3
123174_ATEOF
123175
123176{ set +x
123177$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123178at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123179( $at_check_trace;  $PREPARSER ./calc input
123180) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123181at_status=$? at_failed=false
123182$at_check_filter
123183echo stderr:; tee stderr <"$at_stderr"
123184at_fn_diff_devnull "$at_stdout" || at_failed=:
123185at_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"
123191at_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>&-
123194at_status=$? at_failed=false
123195$at_check_filter
123196echo stderr:; tee stderr <"$at_stderr"
123197at_fn_diff_devnull "$at_stdout" || at_failed=:
123198at_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.
123207sed '/^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
123222mv at-stderr stderr
123223# 2. Create the reference error message.
123224cat >expout <<'_ATEOF'
1232251.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.
123231sed 's/syntax error, .*$/syntax error/' expout >at-expout
123232mv at-expout expout
123233# 5. Check
123234{ set +x
123235$as_echo "$at_srcdir/calc.at:713: cat stderr"
123236at_fn_check_prepare_trace "calc.at:713"
123237( $at_check_trace; cat stderr
123238) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123239at_status=$? at_failed=false
123240$at_check_filter
123241at_fn_diff_devnull "$at_stderr" || at_failed=:
123242$at_diff expout "$at_stdout" || at_failed=:
123243at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
123244$at_failed && at_fn_log_failure
123245$at_traceon; }
123246
123247
123248cat >input <<'_ATEOF'
123249
123250+1
123251_ATEOF
123252
123253{ set +x
123254$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123255at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123256( $at_check_trace;  $PREPARSER ./calc input
123257) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123258at_status=$? at_failed=false
123259$at_check_filter
123260echo stderr:; tee stderr <"$at_stderr"
123261at_fn_diff_devnull "$at_stdout" || at_failed=:
123262at_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"
123268at_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>&-
123271at_status=$? at_failed=false
123272$at_check_filter
123273echo stderr:; tee stderr <"$at_stderr"
123274at_fn_diff_devnull "$at_stdout" || at_failed=:
123275at_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.
123284sed '/^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
123299mv at-stderr stderr
123300# 2. Create the reference error message.
123301cat >expout <<'_ATEOF'
1233022.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.
123308sed 's/syntax error, .*$/syntax error/' expout >at-expout
123309mv at-expout expout
123310# 5. Check
123311{ set +x
123312$as_echo "$at_srcdir/calc.at:713: cat stderr"
123313at_fn_check_prepare_trace "calc.at:713"
123314( $at_check_trace; cat stderr
123315) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123316at_status=$? at_failed=false
123317$at_check_filter
123318at_fn_diff_devnull "$at_stderr" || at_failed=:
123319$at_diff expout "$at_stdout" || at_failed=:
123320at_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"
123328at_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>&-
123331at_status=$? at_failed=false
123332$at_check_filter
123333echo stderr:; tee stderr <"$at_stderr"
123334at_fn_diff_devnull "$at_stdout" || at_failed=:
123335at_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"
123341at_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>&-
123344at_status=$? at_failed=false
123345$at_check_filter
123346echo stderr:; tee stderr <"$at_stderr"
123347at_fn_diff_devnull "$at_stdout" || at_failed=:
123348at_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.
123357sed '/^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
123372mv at-stderr stderr
123373# 2. Create the reference error message.
123374cat >expout <<'_ATEOF'
1233751.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.
123381sed 's/syntax error, .*$/syntax error/' expout >at-expout
123382mv at-expout expout
123383# 5. Check
123384{ set +x
123385$as_echo "$at_srcdir/calc.at:713: cat stderr"
123386at_fn_check_prepare_trace "calc.at:713"
123387( $at_check_trace; cat stderr
123388) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123389at_status=$? at_failed=false
123390$at_check_filter
123391at_fn_diff_devnull "$at_stderr" || at_failed=:
123392$at_diff expout "$at_stdout" || at_failed=:
123393at_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#
123415cat >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"
123421at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123422( $at_check_trace;  $PREPARSER ./calc input
123423) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123424at_status=$? at_failed=false
123425$at_check_filter
123426echo stderr:; tee stderr <"$at_stderr"
123427at_fn_diff_devnull "$at_stdout" || at_failed=:
123428at_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"
123434at_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>&-
123437at_status=$? at_failed=false
123438$at_check_filter
123439echo stderr:; tee stderr <"$at_stderr"
123440at_fn_diff_devnull "$at_stdout" || at_failed=:
123441at_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.
123450sed '/^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
123465mv at-stderr stderr
123466# 2. Create the reference error message.
123467cat >expout <<'_ATEOF'
1234681.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1234691.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1234701.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1234711.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
123472calc: 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.
123478sed 's/syntax error, .*$/syntax error/' expout >at-expout
123479mv at-expout expout
123480# 5. Check
123481{ set +x
123482$as_echo "$at_srcdir/calc.at:713: cat stderr"
123483at_fn_check_prepare_trace "calc.at:713"
123484( $at_check_trace; cat stderr
123485) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123486at_status=$? at_failed=false
123487$at_check_filter
123488at_fn_diff_devnull "$at_stderr" || at_failed=:
123489$at_diff expout "$at_stdout" || at_failed=:
123490at_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.
123498cat >input <<'_ATEOF'
123499(!) + (1 2) = 1
123500_ATEOF
123501
123502{ set +x
123503$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123504at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123505( $at_check_trace;  $PREPARSER ./calc input
123506) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123507at_status=$? at_failed=false
123508$at_check_filter
123509echo stderr:; tee stderr <"$at_stderr"
123510at_fn_diff_devnull "$at_stdout" || at_failed=:
123511at_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"
123517at_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>&-
123520at_status=$? at_failed=false
123521$at_check_filter
123522echo stderr:; tee stderr <"$at_stderr"
123523at_fn_diff_devnull "$at_stdout" || at_failed=:
123524at_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.
123533sed '/^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
123548mv at-stderr stderr
123549# 2. Create the reference error message.
123550cat >expout <<'_ATEOF'
1235511.10: syntax error, unexpected number
123552calc: 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.
123558sed 's/syntax error, .*$/syntax error/' expout >at-expout
123559mv at-expout expout
123560# 5. Check
123561{ set +x
123562$as_echo "$at_srcdir/calc.at:713: cat stderr"
123563at_fn_check_prepare_trace "calc.at:713"
123564( $at_check_trace; cat stderr
123565) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123566at_status=$? at_failed=false
123567$at_check_filter
123568at_fn_diff_devnull "$at_stderr" || at_failed=:
123569$at_diff expout "$at_stdout" || at_failed=:
123570at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
123571$at_failed && at_fn_log_failure
123572$at_traceon; }
123573
123574
123575cat >input <<'_ATEOF'
123576(- *) + (1 2) = 1
123577_ATEOF
123578
123579{ set +x
123580$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123581at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123582( $at_check_trace;  $PREPARSER ./calc input
123583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123584at_status=$? at_failed=false
123585$at_check_filter
123586echo stderr:; tee stderr <"$at_stderr"
123587at_fn_diff_devnull "$at_stdout" || at_failed=:
123588at_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"
123594at_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>&-
123597at_status=$? at_failed=false
123598$at_check_filter
123599echo stderr:; tee stderr <"$at_stderr"
123600at_fn_diff_devnull "$at_stdout" || at_failed=:
123601at_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.
123610sed '/^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
123625mv at-stderr stderr
123626# 2. Create the reference error message.
123627cat >expout <<'_ATEOF'
1236281.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1236291.12: syntax error, unexpected number
123630calc: 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.
123636sed 's/syntax error, .*$/syntax error/' expout >at-expout
123637mv at-expout expout
123638# 5. Check
123639{ set +x
123640$as_echo "$at_srcdir/calc.at:713: cat stderr"
123641at_fn_check_prepare_trace "calc.at:713"
123642( $at_check_trace; cat stderr
123643) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123644at_status=$? at_failed=false
123645$at_check_filter
123646at_fn_diff_devnull "$at_stderr" || at_failed=:
123647$at_diff expout "$at_stdout" || at_failed=:
123648at_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.
123656cat >input <<'_ATEOF'
123657(* *) + (*) + (*)
123658_ATEOF
123659
123660{ set +x
123661$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
123662at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
123663( $at_check_trace;  $PREPARSER ./calc input
123664) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123665at_status=$? at_failed=false
123666$at_check_filter
123667echo stderr:; tee stderr <"$at_stderr"
123668at_fn_diff_devnull "$at_stdout" || at_failed=:
123669at_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"
123675at_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>&-
123678at_status=$? at_failed=false
123679$at_check_filter
123680echo stderr:; tee stderr <"$at_stderr"
123681at_fn_diff_devnull "$at_stdout" || at_failed=:
123682at_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.
123691sed '/^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
123706mv at-stderr stderr
123707# 2. Create the reference error message.
123708cat >expout <<'_ATEOF'
1237091.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1237101.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1237111.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.
123717sed 's/syntax error, .*$/syntax error/' expout >at-expout
123718mv at-expout expout
123719# 5. Check
123720{ set +x
123721$as_echo "$at_srcdir/calc.at:713: cat stderr"
123722at_fn_check_prepare_trace "calc.at:713"
123723( $at_check_trace; cat stderr
123724) >>"$at_stdout" 2>>"$at_stderr" 5>&-
123725at_status=$? at_failed=false
123726$at_check_filter
123727at_fn_diff_devnull "$at_stderr" || at_failed=:
123728$at_diff expout "$at_stdout" || at_failed=:
123729at_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
123740read at_status <"$at_status_file"
123741#AT_STOP_249
123742#AT_START_250
123743at_fn_group_banner 250 'calc.at:714' \
123744  "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14
123745at_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
123759cat >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
123800FILE *input;
123801static int power (int base, int exponent);
123802
123803
123804int 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%%
123822input:
123823  line
123824| input line         {  }
123825;
123826
123827line:
123828  '\n'
123829| exp '\n'           { USE ($1); }
123830;
123831
123832exp:
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
123853static int
123854power (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.  */
123865void
123866calc::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
123875cat >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
123886int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
123887static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
123888static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
123889
123890
123891static calc::parser::location_type last_yylloc;
123892
123893static int
123894get_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
123911static void
123912unget_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
123922static int
123923read_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
123954int 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
123984cat >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.  */
124003int
124004calcparse ()
124005{
124006  calc::parser parser;
124007#if YYDEBUG
124008  parser.set_debug_level (1);
124009#endif
124010  return parser.parse ();
124011}
124012
124013
124014semantic_value global_result = 0;
124015int global_count = 0;
124016
124017/* A C main function.  */
124018int
124019main (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
124057if 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"
124065at_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>&-
124069at_status=$? at_failed=false
124070$at_check_filter
124071echo stderr:; cat "$at_stderr"
124072echo stdout:; cat "$at_stdout"
124073at_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"
124079at_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>&-
124082at_status=$? at_failed=false
124083$at_check_filter
124084echo stderr:; cat "$at_stderr"
124085echo stdout:; cat "$at_stdout"
124086at_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"
124095at_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>&-
124100at_status=$? at_failed=false
124101$at_check_filter
124102at_fn_diff_devnull "$at_stderr" || at_failed=:
124103$at_diff expout "$at_stdout" || at_failed=:
124104at_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"
124113at_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>&-
124118at_status=$? at_failed=false
124119$at_check_filter
124120at_fn_diff_devnull "$at_stderr" || at_failed=:
124121$at_diff expout "$at_stdout" || at_failed=:
124122at_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
124128fi
124129{ set +x
124130$as_echo "$at_srcdir/calc.at:714: bison -o calc.cc calc.y"
124131at_fn_check_prepare_trace "calc.at:714"
124132( $at_check_trace; bison -o calc.cc calc.y
124133) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124134at_status=$? at_failed=false
124135$at_check_filter
124136at_fn_diff_devnull "$at_stderr" || at_failed=:
124137at_fn_diff_devnull "$at_stdout" || at_failed=:
124138at_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"
124146at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714"
124147( $at_check_trace; $BISON_CXX_WORKS
124148) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124149at_status=$? at_failed=false
124150$at_check_filter
124151echo stderr:; cat "$at_stderr"
124152echo stdout:; cat "$at_stdout"
124153at_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"
124159at_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>&-
124162at_status=$? at_failed=false
124163$at_check_filter
124164echo stderr:; cat "$at_stderr"
124165echo stdout:; cat "$at_stdout"
124166at_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"
124181at_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>&-
124192at_status=$? at_failed=false
124193$at_check_filter
124194at_fn_diff_devnull "$at_stderr" || at_failed=:
124195at_fn_diff_devnull "$at_stdout" || at_failed=:
124196at_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"
124210at_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>&-
124221at_status=$? at_failed=false
124222$at_check_filter
124223at_fn_diff_devnull "$at_stderr" || at_failed=:
124224at_fn_diff_devnull "$at_stdout" || at_failed=:
124225at_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.
124231cat >input <<'_ATEOF'
1242321 + 2 * 3 = 7
1242331 + 2 * -3 = -5
124234
124235-1^2 = -1
124236(-1)^2 = 1
124237
124238---1 = -1
124239
1242401 - 2 - 3 = -4
1242411 - (2 - 3) = 2
124242
1242432^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"
124249at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124250( $at_check_trace;  $PREPARSER ./calc input
124251) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124252at_status=$? at_failed=false
124253$at_check_filter
124254echo stderr:; tee stderr <"$at_stderr"
124255at_fn_diff_devnull "$at_stdout" || at_failed=:
124256at_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"
124262at_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>&-
124265at_status=$? at_failed=false
124266$at_check_filter
124267echo stderr:; tee stderr <"$at_stderr"
124268at_fn_diff_devnull "$at_stdout" || at_failed=:
124269at_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.
124277cat >input <<'_ATEOF'
1242781 2
124279_ATEOF
124280
124281{ set +x
124282$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124283at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124284( $at_check_trace;  $PREPARSER ./calc input
124285) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124286at_status=$? at_failed=false
124287$at_check_filter
124288echo stderr:; tee stderr <"$at_stderr"
124289at_fn_diff_devnull "$at_stdout" || at_failed=:
124290at_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"
124296at_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>&-
124299at_status=$? at_failed=false
124300$at_check_filter
124301echo stderr:; tee stderr <"$at_stderr"
124302at_fn_diff_devnull "$at_stdout" || at_failed=:
124303at_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.
124312sed '/^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
124327mv at-stderr stderr
124328# 2. Create the reference error message.
124329cat >expout <<'_ATEOF'
1243301.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"
124340at_fn_check_prepare_trace "calc.at:714"
124341( $at_check_trace; cat stderr
124342) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124343at_status=$? at_failed=false
124344$at_check_filter
124345at_fn_diff_devnull "$at_stderr" || at_failed=:
124346$at_diff expout "$at_stdout" || at_failed=:
124347at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
124348$at_failed && at_fn_log_failure
124349$at_traceon; }
124350
124351
124352cat >input <<'_ATEOF'
1243531//2
124354_ATEOF
124355
124356{ set +x
124357$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124358at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124359( $at_check_trace;  $PREPARSER ./calc input
124360) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124361at_status=$? at_failed=false
124362$at_check_filter
124363echo stderr:; tee stderr <"$at_stderr"
124364at_fn_diff_devnull "$at_stdout" || at_failed=:
124365at_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"
124371at_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>&-
124374at_status=$? at_failed=false
124375$at_check_filter
124376echo stderr:; tee stderr <"$at_stderr"
124377at_fn_diff_devnull "$at_stdout" || at_failed=:
124378at_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.
124387sed '/^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
124402mv at-stderr stderr
124403# 2. Create the reference error message.
124404cat >expout <<'_ATEOF'
1244051.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"
124415at_fn_check_prepare_trace "calc.at:714"
124416( $at_check_trace; cat stderr
124417) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124418at_status=$? at_failed=false
124419$at_check_filter
124420at_fn_diff_devnull "$at_stderr" || at_failed=:
124421$at_diff expout "$at_stdout" || at_failed=:
124422at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
124423$at_failed && at_fn_log_failure
124424$at_traceon; }
124425
124426
124427cat >input <<'_ATEOF'
124428error
124429_ATEOF
124430
124431{ set +x
124432$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124433at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124434( $at_check_trace;  $PREPARSER ./calc input
124435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124436at_status=$? at_failed=false
124437$at_check_filter
124438echo stderr:; tee stderr <"$at_stderr"
124439at_fn_diff_devnull "$at_stdout" || at_failed=:
124440at_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"
124446at_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>&-
124449at_status=$? at_failed=false
124450$at_check_filter
124451echo stderr:; tee stderr <"$at_stderr"
124452at_fn_diff_devnull "$at_stdout" || at_failed=:
124453at_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.
124462sed '/^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
124477mv at-stderr stderr
124478# 2. Create the reference error message.
124479cat >expout <<'_ATEOF'
1244801.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"
124490at_fn_check_prepare_trace "calc.at:714"
124491( $at_check_trace; cat stderr
124492) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124493at_status=$? at_failed=false
124494$at_check_filter
124495at_fn_diff_devnull "$at_stderr" || at_failed=:
124496$at_diff expout "$at_stdout" || at_failed=:
124497at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
124498$at_failed && at_fn_log_failure
124499$at_traceon; }
124500
124501
124502cat >input <<'_ATEOF'
1245031 = 2 = 3
124504_ATEOF
124505
124506{ set +x
124507$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124508at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124509( $at_check_trace;  $PREPARSER ./calc input
124510) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124511at_status=$? at_failed=false
124512$at_check_filter
124513echo stderr:; tee stderr <"$at_stderr"
124514at_fn_diff_devnull "$at_stdout" || at_failed=:
124515at_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"
124521at_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>&-
124524at_status=$? at_failed=false
124525$at_check_filter
124526echo stderr:; tee stderr <"$at_stderr"
124527at_fn_diff_devnull "$at_stdout" || at_failed=:
124528at_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.
124537sed '/^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
124552mv at-stderr stderr
124553# 2. Create the reference error message.
124554cat >expout <<'_ATEOF'
1245551.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"
124565at_fn_check_prepare_trace "calc.at:714"
124566( $at_check_trace; cat stderr
124567) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124568at_status=$? at_failed=false
124569$at_check_filter
124570at_fn_diff_devnull "$at_stderr" || at_failed=:
124571$at_diff expout "$at_stdout" || at_failed=:
124572at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
124573$at_failed && at_fn_log_failure
124574$at_traceon; }
124575
124576
124577cat >input <<'_ATEOF'
124578
124579+1
124580_ATEOF
124581
124582{ set +x
124583$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124584at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124585( $at_check_trace;  $PREPARSER ./calc input
124586) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124587at_status=$? at_failed=false
124588$at_check_filter
124589echo stderr:; tee stderr <"$at_stderr"
124590at_fn_diff_devnull "$at_stdout" || at_failed=:
124591at_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"
124597at_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>&-
124600at_status=$? at_failed=false
124601$at_check_filter
124602echo stderr:; tee stderr <"$at_stderr"
124603at_fn_diff_devnull "$at_stdout" || at_failed=:
124604at_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.
124613sed '/^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
124628mv at-stderr stderr
124629# 2. Create the reference error message.
124630cat >expout <<'_ATEOF'
1246312.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"
124641at_fn_check_prepare_trace "calc.at:714"
124642( $at_check_trace; cat stderr
124643) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124644at_status=$? at_failed=false
124645$at_check_filter
124646at_fn_diff_devnull "$at_stderr" || at_failed=:
124647$at_diff expout "$at_stdout" || at_failed=:
124648at_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"
124656at_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>&-
124659at_status=$? at_failed=false
124660$at_check_filter
124661echo stderr:; tee stderr <"$at_stderr"
124662at_fn_diff_devnull "$at_stdout" || at_failed=:
124663at_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"
124669at_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>&-
124672at_status=$? at_failed=false
124673$at_check_filter
124674echo stderr:; tee stderr <"$at_stderr"
124675at_fn_diff_devnull "$at_stdout" || at_failed=:
124676at_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.
124685sed '/^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
124700mv at-stderr stderr
124701# 2. Create the reference error message.
124702cat >expout <<'_ATEOF'
1247031.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"
124713at_fn_check_prepare_trace "calc.at:714"
124714( $at_check_trace; cat stderr
124715) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124716at_status=$? at_failed=false
124717$at_check_filter
124718at_fn_diff_devnull "$at_stderr" || at_failed=:
124719$at_diff expout "$at_stdout" || at_failed=:
124720at_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#
124742cat >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"
124748at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124749( $at_check_trace;  $PREPARSER ./calc input
124750) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124751at_status=$? at_failed=false
124752$at_check_filter
124753echo stderr:; tee stderr <"$at_stderr"
124754at_fn_diff_devnull "$at_stdout" || at_failed=:
124755at_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"
124761at_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>&-
124764at_status=$? at_failed=false
124765$at_check_filter
124766echo stderr:; tee stderr <"$at_stderr"
124767at_fn_diff_devnull "$at_stdout" || at_failed=:
124768at_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.
124777sed '/^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
124792mv at-stderr stderr
124793# 2. Create the reference error message.
124794cat >expout <<'_ATEOF'
1247951.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1247961.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1247971.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1247981.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
124799calc: 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"
124809at_fn_check_prepare_trace "calc.at:714"
124810( $at_check_trace; cat stderr
124811) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124812at_status=$? at_failed=false
124813$at_check_filter
124814at_fn_diff_devnull "$at_stderr" || at_failed=:
124815$at_diff expout "$at_stdout" || at_failed=:
124816at_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.
124824cat >input <<'_ATEOF'
124825(!) + (1 2) = 1
124826_ATEOF
124827
124828{ set +x
124829$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124830at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124831( $at_check_trace;  $PREPARSER ./calc input
124832) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124833at_status=$? at_failed=false
124834$at_check_filter
124835echo stderr:; tee stderr <"$at_stderr"
124836at_fn_diff_devnull "$at_stdout" || at_failed=:
124837at_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"
124843at_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>&-
124846at_status=$? at_failed=false
124847$at_check_filter
124848echo stderr:; tee stderr <"$at_stderr"
124849at_fn_diff_devnull "$at_stdout" || at_failed=:
124850at_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.
124859sed '/^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
124874mv at-stderr stderr
124875# 2. Create the reference error message.
124876cat >expout <<'_ATEOF'
1248771.10: syntax error, unexpected number
124878calc: 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"
124888at_fn_check_prepare_trace "calc.at:714"
124889( $at_check_trace; cat stderr
124890) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124891at_status=$? at_failed=false
124892$at_check_filter
124893at_fn_diff_devnull "$at_stderr" || at_failed=:
124894$at_diff expout "$at_stdout" || at_failed=:
124895at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
124896$at_failed && at_fn_log_failure
124897$at_traceon; }
124898
124899
124900cat >input <<'_ATEOF'
124901(- *) + (1 2) = 1
124902_ATEOF
124903
124904{ set +x
124905$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124906at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124907( $at_check_trace;  $PREPARSER ./calc input
124908) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124909at_status=$? at_failed=false
124910$at_check_filter
124911echo stderr:; tee stderr <"$at_stderr"
124912at_fn_diff_devnull "$at_stdout" || at_failed=:
124913at_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"
124919at_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>&-
124922at_status=$? at_failed=false
124923$at_check_filter
124924echo stderr:; tee stderr <"$at_stderr"
124925at_fn_diff_devnull "$at_stdout" || at_failed=:
124926at_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.
124935sed '/^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
124950mv at-stderr stderr
124951# 2. Create the reference error message.
124952cat >expout <<'_ATEOF'
1249531.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1249541.12: syntax error, unexpected number
124955calc: 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"
124965at_fn_check_prepare_trace "calc.at:714"
124966( $at_check_trace; cat stderr
124967) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124968at_status=$? at_failed=false
124969$at_check_filter
124970at_fn_diff_devnull "$at_stderr" || at_failed=:
124971$at_diff expout "$at_stdout" || at_failed=:
124972at_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.
124980cat >input <<'_ATEOF'
124981(* *) + (*) + (*)
124982_ATEOF
124983
124984{ set +x
124985$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
124986at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
124987( $at_check_trace;  $PREPARSER ./calc input
124988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
124989at_status=$? at_failed=false
124990$at_check_filter
124991echo stderr:; tee stderr <"$at_stderr"
124992at_fn_diff_devnull "$at_stdout" || at_failed=:
124993at_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"
124999at_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>&-
125002at_status=$? at_failed=false
125003$at_check_filter
125004echo stderr:; tee stderr <"$at_stderr"
125005at_fn_diff_devnull "$at_stdout" || at_failed=:
125006at_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.
125015sed '/^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
125030mv at-stderr stderr
125031# 2. Create the reference error message.
125032cat >expout <<'_ATEOF'
1250331.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1250341.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1250351.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"
125045at_fn_check_prepare_trace "calc.at:714"
125046( $at_check_trace; cat stderr
125047) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125048at_status=$? at_failed=false
125049$at_check_filter
125050at_fn_diff_devnull "$at_stderr" || at_failed=:
125051$at_diff expout "$at_stdout" || at_failed=:
125052at_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
125063read at_status <"$at_status_file"
125064#AT_STOP_250
125065#AT_START_251
125066at_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
125068at_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
125082cat >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
125123FILE *input;
125124static int power (int base, int exponent);
125125
125126
125127int 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%%
125145input:
125146  line
125147| input line         {  }
125148;
125149
125150line:
125151  '\n'
125152| exp '\n'           { USE ($1); }
125153;
125154
125155exp:
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
125176static int
125177power (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.  */
125188void
125189calc::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
125198cat >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
125209int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
125210static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
125211static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
125212
125213
125214static calc::parser::location_type last_yylloc;
125215
125216static int
125217get_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
125234static void
125235unget_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
125245static int
125246read_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
125277int 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
125307cat >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.  */
125326int
125327calcparse ()
125328{
125329  calc::parser parser;
125330#if YYDEBUG
125331  parser.set_debug_level (1);
125332#endif
125333  return parser.parse ();
125334}
125335
125336
125337semantic_value global_result = 0;
125338int global_count = 0;
125339
125340/* A C main function.  */
125341int
125342main (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
125380if 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"
125388at_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>&-
125392at_status=$? at_failed=false
125393$at_check_filter
125394echo stderr:; cat "$at_stderr"
125395echo stdout:; cat "$at_stdout"
125396at_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"
125402at_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>&-
125405at_status=$? at_failed=false
125406$at_check_filter
125407echo stderr:; cat "$at_stderr"
125408echo stdout:; cat "$at_stdout"
125409at_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"
125418at_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>&-
125423at_status=$? at_failed=false
125424$at_check_filter
125425at_fn_diff_devnull "$at_stderr" || at_failed=:
125426$at_diff expout "$at_stdout" || at_failed=:
125427at_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"
125436at_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>&-
125441at_status=$? at_failed=false
125442$at_check_filter
125443at_fn_diff_devnull "$at_stderr" || at_failed=:
125444$at_diff expout "$at_stdout" || at_failed=:
125445at_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
125451fi
125452{ set +x
125453$as_echo "$at_srcdir/calc.at:716: bison -o calc.cc calc.y"
125454at_fn_check_prepare_trace "calc.at:716"
125455( $at_check_trace; bison -o calc.cc calc.y
125456) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125457at_status=$? at_failed=false
125458$at_check_filter
125459at_fn_diff_devnull "$at_stderr" || at_failed=:
125460at_fn_diff_devnull "$at_stdout" || at_failed=:
125461at_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"
125469at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716"
125470( $at_check_trace; $BISON_CXX_WORKS
125471) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125472at_status=$? at_failed=false
125473$at_check_filter
125474echo stderr:; cat "$at_stderr"
125475echo stdout:; cat "$at_stdout"
125476at_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"
125482at_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>&-
125485at_status=$? at_failed=false
125486$at_check_filter
125487echo stderr:; cat "$at_stderr"
125488echo stdout:; cat "$at_stdout"
125489at_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"
125504at_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>&-
125515at_status=$? at_failed=false
125516$at_check_filter
125517at_fn_diff_devnull "$at_stderr" || at_failed=:
125518at_fn_diff_devnull "$at_stdout" || at_failed=:
125519at_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"
125533at_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>&-
125544at_status=$? at_failed=false
125545$at_check_filter
125546at_fn_diff_devnull "$at_stderr" || at_failed=:
125547at_fn_diff_devnull "$at_stdout" || at_failed=:
125548at_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.
125554cat >input <<'_ATEOF'
1255551 + 2 * 3 = 7
1255561 + 2 * -3 = -5
125557
125558-1^2 = -1
125559(-1)^2 = 1
125560
125561---1 = -1
125562
1255631 - 2 - 3 = -4
1255641 - (2 - 3) = 2
125565
1255662^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"
125572at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125573( $at_check_trace;  $PREPARSER ./calc input
125574) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125575at_status=$? at_failed=false
125576$at_check_filter
125577echo stderr:; tee stderr <"$at_stderr"
125578at_fn_diff_devnull "$at_stdout" || at_failed=:
125579at_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"
125585at_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>&-
125588at_status=$? at_failed=false
125589$at_check_filter
125590echo stderr:; tee stderr <"$at_stderr"
125591at_fn_diff_devnull "$at_stdout" || at_failed=:
125592at_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.
125600cat >input <<'_ATEOF'
1256011 2
125602_ATEOF
125603
125604{ set +x
125605$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
125606at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125607( $at_check_trace;  $PREPARSER ./calc input
125608) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125609at_status=$? at_failed=false
125610$at_check_filter
125611echo stderr:; tee stderr <"$at_stderr"
125612at_fn_diff_devnull "$at_stdout" || at_failed=:
125613at_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"
125619at_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>&-
125622at_status=$? at_failed=false
125623$at_check_filter
125624echo stderr:; tee stderr <"$at_stderr"
125625at_fn_diff_devnull "$at_stdout" || at_failed=:
125626at_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.
125635sed '/^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
125650mv at-stderr stderr
125651# 2. Create the reference error message.
125652cat >expout <<'_ATEOF'
1256531.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"
125663at_fn_check_prepare_trace "calc.at:716"
125664( $at_check_trace; cat stderr
125665) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125666at_status=$? at_failed=false
125667$at_check_filter
125668at_fn_diff_devnull "$at_stderr" || at_failed=:
125669$at_diff expout "$at_stdout" || at_failed=:
125670at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
125671$at_failed && at_fn_log_failure
125672$at_traceon; }
125673
125674
125675cat >input <<'_ATEOF'
1256761//2
125677_ATEOF
125678
125679{ set +x
125680$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
125681at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125682( $at_check_trace;  $PREPARSER ./calc input
125683) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125684at_status=$? at_failed=false
125685$at_check_filter
125686echo stderr:; tee stderr <"$at_stderr"
125687at_fn_diff_devnull "$at_stdout" || at_failed=:
125688at_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"
125694at_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>&-
125697at_status=$? at_failed=false
125698$at_check_filter
125699echo stderr:; tee stderr <"$at_stderr"
125700at_fn_diff_devnull "$at_stdout" || at_failed=:
125701at_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.
125710sed '/^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
125725mv at-stderr stderr
125726# 2. Create the reference error message.
125727cat >expout <<'_ATEOF'
1257281.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"
125738at_fn_check_prepare_trace "calc.at:716"
125739( $at_check_trace; cat stderr
125740) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125741at_status=$? at_failed=false
125742$at_check_filter
125743at_fn_diff_devnull "$at_stderr" || at_failed=:
125744$at_diff expout "$at_stdout" || at_failed=:
125745at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
125746$at_failed && at_fn_log_failure
125747$at_traceon; }
125748
125749
125750cat >input <<'_ATEOF'
125751error
125752_ATEOF
125753
125754{ set +x
125755$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
125756at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125757( $at_check_trace;  $PREPARSER ./calc input
125758) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125759at_status=$? at_failed=false
125760$at_check_filter
125761echo stderr:; tee stderr <"$at_stderr"
125762at_fn_diff_devnull "$at_stdout" || at_failed=:
125763at_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"
125769at_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>&-
125772at_status=$? at_failed=false
125773$at_check_filter
125774echo stderr:; tee stderr <"$at_stderr"
125775at_fn_diff_devnull "$at_stdout" || at_failed=:
125776at_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.
125785sed '/^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
125800mv at-stderr stderr
125801# 2. Create the reference error message.
125802cat >expout <<'_ATEOF'
1258031.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"
125813at_fn_check_prepare_trace "calc.at:716"
125814( $at_check_trace; cat stderr
125815) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125816at_status=$? at_failed=false
125817$at_check_filter
125818at_fn_diff_devnull "$at_stderr" || at_failed=:
125819$at_diff expout "$at_stdout" || at_failed=:
125820at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
125821$at_failed && at_fn_log_failure
125822$at_traceon; }
125823
125824
125825cat >input <<'_ATEOF'
1258261 = 2 = 3
125827_ATEOF
125828
125829{ set +x
125830$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
125831at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125832( $at_check_trace;  $PREPARSER ./calc input
125833) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125834at_status=$? at_failed=false
125835$at_check_filter
125836echo stderr:; tee stderr <"$at_stderr"
125837at_fn_diff_devnull "$at_stdout" || at_failed=:
125838at_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"
125844at_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>&-
125847at_status=$? at_failed=false
125848$at_check_filter
125849echo stderr:; tee stderr <"$at_stderr"
125850at_fn_diff_devnull "$at_stdout" || at_failed=:
125851at_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.
125860sed '/^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
125875mv at-stderr stderr
125876# 2. Create the reference error message.
125877cat >expout <<'_ATEOF'
1258781.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"
125888at_fn_check_prepare_trace "calc.at:716"
125889( $at_check_trace; cat stderr
125890) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125891at_status=$? at_failed=false
125892$at_check_filter
125893at_fn_diff_devnull "$at_stderr" || at_failed=:
125894$at_diff expout "$at_stdout" || at_failed=:
125895at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
125896$at_failed && at_fn_log_failure
125897$at_traceon; }
125898
125899
125900cat >input <<'_ATEOF'
125901
125902+1
125903_ATEOF
125904
125905{ set +x
125906$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
125907at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
125908( $at_check_trace;  $PREPARSER ./calc input
125909) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125910at_status=$? at_failed=false
125911$at_check_filter
125912echo stderr:; tee stderr <"$at_stderr"
125913at_fn_diff_devnull "$at_stdout" || at_failed=:
125914at_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"
125920at_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>&-
125923at_status=$? at_failed=false
125924$at_check_filter
125925echo stderr:; tee stderr <"$at_stderr"
125926at_fn_diff_devnull "$at_stdout" || at_failed=:
125927at_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.
125936sed '/^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
125951mv at-stderr stderr
125952# 2. Create the reference error message.
125953cat >expout <<'_ATEOF'
1259542.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"
125964at_fn_check_prepare_trace "calc.at:716"
125965( $at_check_trace; cat stderr
125966) >>"$at_stdout" 2>>"$at_stderr" 5>&-
125967at_status=$? at_failed=false
125968$at_check_filter
125969at_fn_diff_devnull "$at_stderr" || at_failed=:
125970$at_diff expout "$at_stdout" || at_failed=:
125971at_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"
125979at_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>&-
125982at_status=$? at_failed=false
125983$at_check_filter
125984echo stderr:; tee stderr <"$at_stderr"
125985at_fn_diff_devnull "$at_stdout" || at_failed=:
125986at_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"
125992at_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>&-
125995at_status=$? at_failed=false
125996$at_check_filter
125997echo stderr:; tee stderr <"$at_stderr"
125998at_fn_diff_devnull "$at_stdout" || at_failed=:
125999at_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.
126008sed '/^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
126023mv at-stderr stderr
126024# 2. Create the reference error message.
126025cat >expout <<'_ATEOF'
1260261.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"
126036at_fn_check_prepare_trace "calc.at:716"
126037( $at_check_trace; cat stderr
126038) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126039at_status=$? at_failed=false
126040$at_check_filter
126041at_fn_diff_devnull "$at_stderr" || at_failed=:
126042$at_diff expout "$at_stdout" || at_failed=:
126043at_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#
126065cat >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"
126071at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
126072( $at_check_trace;  $PREPARSER ./calc input
126073) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126074at_status=$? at_failed=false
126075$at_check_filter
126076echo stderr:; tee stderr <"$at_stderr"
126077at_fn_diff_devnull "$at_stdout" || at_failed=:
126078at_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"
126084at_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>&-
126087at_status=$? at_failed=false
126088$at_check_filter
126089echo stderr:; tee stderr <"$at_stderr"
126090at_fn_diff_devnull "$at_stdout" || at_failed=:
126091at_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.
126100sed '/^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
126115mv at-stderr stderr
126116# 2. Create the reference error message.
126117cat >expout <<'_ATEOF'
1261181.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1261191.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1261201.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1261211.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
126122calc: 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"
126132at_fn_check_prepare_trace "calc.at:716"
126133( $at_check_trace; cat stderr
126134) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126135at_status=$? at_failed=false
126136$at_check_filter
126137at_fn_diff_devnull "$at_stderr" || at_failed=:
126138$at_diff expout "$at_stdout" || at_failed=:
126139at_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.
126147cat >input <<'_ATEOF'
126148(!) + (1 2) = 1
126149_ATEOF
126150
126151{ set +x
126152$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
126153at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
126154( $at_check_trace;  $PREPARSER ./calc input
126155) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126156at_status=$? at_failed=false
126157$at_check_filter
126158echo stderr:; tee stderr <"$at_stderr"
126159at_fn_diff_devnull "$at_stdout" || at_failed=:
126160at_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"
126166at_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>&-
126169at_status=$? at_failed=false
126170$at_check_filter
126171echo stderr:; tee stderr <"$at_stderr"
126172at_fn_diff_devnull "$at_stdout" || at_failed=:
126173at_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.
126182sed '/^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
126197mv at-stderr stderr
126198# 2. Create the reference error message.
126199cat >expout <<'_ATEOF'
1262001.10: syntax error, unexpected number
126201calc: 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"
126211at_fn_check_prepare_trace "calc.at:716"
126212( $at_check_trace; cat stderr
126213) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126214at_status=$? at_failed=false
126215$at_check_filter
126216at_fn_diff_devnull "$at_stderr" || at_failed=:
126217$at_diff expout "$at_stdout" || at_failed=:
126218at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
126219$at_failed && at_fn_log_failure
126220$at_traceon; }
126221
126222
126223cat >input <<'_ATEOF'
126224(- *) + (1 2) = 1
126225_ATEOF
126226
126227{ set +x
126228$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
126229at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
126230( $at_check_trace;  $PREPARSER ./calc input
126231) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126232at_status=$? at_failed=false
126233$at_check_filter
126234echo stderr:; tee stderr <"$at_stderr"
126235at_fn_diff_devnull "$at_stdout" || at_failed=:
126236at_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"
126242at_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>&-
126245at_status=$? at_failed=false
126246$at_check_filter
126247echo stderr:; tee stderr <"$at_stderr"
126248at_fn_diff_devnull "$at_stdout" || at_failed=:
126249at_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.
126258sed '/^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
126273mv at-stderr stderr
126274# 2. Create the reference error message.
126275cat >expout <<'_ATEOF'
1262761.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1262771.12: syntax error, unexpected number
126278calc: 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"
126288at_fn_check_prepare_trace "calc.at:716"
126289( $at_check_trace; cat stderr
126290) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126291at_status=$? at_failed=false
126292$at_check_filter
126293at_fn_diff_devnull "$at_stderr" || at_failed=:
126294$at_diff expout "$at_stdout" || at_failed=:
126295at_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.
126303cat >input <<'_ATEOF'
126304(* *) + (*) + (*)
126305_ATEOF
126306
126307{ set +x
126308$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
126309at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
126310( $at_check_trace;  $PREPARSER ./calc input
126311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126312at_status=$? at_failed=false
126313$at_check_filter
126314echo stderr:; tee stderr <"$at_stderr"
126315at_fn_diff_devnull "$at_stdout" || at_failed=:
126316at_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"
126322at_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>&-
126325at_status=$? at_failed=false
126326$at_check_filter
126327echo stderr:; tee stderr <"$at_stderr"
126328at_fn_diff_devnull "$at_stdout" || at_failed=:
126329at_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.
126338sed '/^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
126353mv at-stderr stderr
126354# 2. Create the reference error message.
126355cat >expout <<'_ATEOF'
1263561.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1263571.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1263581.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"
126368at_fn_check_prepare_trace "calc.at:716"
126369( $at_check_trace; cat stderr
126370) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126371at_status=$? at_failed=false
126372$at_check_filter
126373at_fn_diff_devnull "$at_stderr" || at_failed=:
126374$at_diff expout "$at_stdout" || at_failed=:
126375at_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
126386read at_status <"$at_status_file"
126387#AT_STOP_251
126388#AT_START_252
126389at_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
126391at_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
126405cat >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
126446FILE *input;
126447static int power (int base, int exponent);
126448
126449
126450int 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%%
126468input:
126469  line
126470| input line         { ++*count; ++global_count; }
126471;
126472
126473line:
126474  '\n'
126475| exp '\n'           { *result = global_result = $1; }
126476;
126477
126478exp:
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
126499static int
126500power (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.  */
126511void
126512calc::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
126521cat >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
126532int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
126533static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
126534static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
126535
126536
126537static calc::parser::location_type last_yylloc;
126538
126539static int
126540get_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
126557static void
126558unget_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
126568static int
126569read_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
126600int 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
126630cat >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.  */
126649int
126650calcparse (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
126660semantic_value global_result = 0;
126661int global_count = 0;
126662
126663/* A C main function.  */
126664int
126665main (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
126703if 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"
126711at_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>&-
126715at_status=$? at_failed=false
126716$at_check_filter
126717echo stderr:; cat "$at_stderr"
126718echo stdout:; cat "$at_stdout"
126719at_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"
126725at_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>&-
126728at_status=$? at_failed=false
126729$at_check_filter
126730echo stderr:; cat "$at_stderr"
126731echo stdout:; cat "$at_stdout"
126732at_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"
126741at_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>&-
126746at_status=$? at_failed=false
126747$at_check_filter
126748at_fn_diff_devnull "$at_stderr" || at_failed=:
126749$at_diff expout "$at_stdout" || at_failed=:
126750at_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"
126759at_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>&-
126764at_status=$? at_failed=false
126765$at_check_filter
126766at_fn_diff_devnull "$at_stderr" || at_failed=:
126767$at_diff expout "$at_stdout" || at_failed=:
126768at_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
126774fi
126775{ set +x
126776$as_echo "$at_srcdir/calc.at:718: bison -o calc.cc calc.y"
126777at_fn_check_prepare_trace "calc.at:718"
126778( $at_check_trace; bison -o calc.cc calc.y
126779) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126780at_status=$? at_failed=false
126781$at_check_filter
126782at_fn_diff_devnull "$at_stderr" || at_failed=:
126783at_fn_diff_devnull "$at_stdout" || at_failed=:
126784at_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"
126792at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718"
126793( $at_check_trace; $BISON_CXX_WORKS
126794) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126795at_status=$? at_failed=false
126796$at_check_filter
126797echo stderr:; cat "$at_stderr"
126798echo stdout:; cat "$at_stdout"
126799at_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"
126805at_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>&-
126808at_status=$? at_failed=false
126809$at_check_filter
126810echo stderr:; cat "$at_stderr"
126811echo stdout:; cat "$at_stdout"
126812at_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"
126827at_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>&-
126838at_status=$? at_failed=false
126839$at_check_filter
126840at_fn_diff_devnull "$at_stderr" || at_failed=:
126841at_fn_diff_devnull "$at_stdout" || at_failed=:
126842at_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"
126856at_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>&-
126867at_status=$? at_failed=false
126868$at_check_filter
126869at_fn_diff_devnull "$at_stderr" || at_failed=:
126870at_fn_diff_devnull "$at_stdout" || at_failed=:
126871at_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.
126877cat >input <<'_ATEOF'
1268781 + 2 * 3 = 7
1268791 + 2 * -3 = -5
126880
126881-1^2 = -1
126882(-1)^2 = 1
126883
126884---1 = -1
126885
1268861 - 2 - 3 = -4
1268871 - (2 - 3) = 2
126888
1268892^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"
126895at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
126896( $at_check_trace;  $PREPARSER ./calc input
126897) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126898at_status=$? at_failed=false
126899$at_check_filter
126900echo stderr:; tee stderr <"$at_stderr"
126901at_fn_diff_devnull "$at_stdout" || at_failed=:
126902at_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"
126908at_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>&-
126911at_status=$? at_failed=false
126912$at_check_filter
126913echo stderr:; tee stderr <"$at_stderr"
126914at_fn_diff_devnull "$at_stdout" || at_failed=:
126915at_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.
126923cat >input <<'_ATEOF'
1269241 2
126925_ATEOF
126926
126927{ set +x
126928$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
126929at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
126930( $at_check_trace;  $PREPARSER ./calc input
126931) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126932at_status=$? at_failed=false
126933$at_check_filter
126934echo stderr:; tee stderr <"$at_stderr"
126935at_fn_diff_devnull "$at_stdout" || at_failed=:
126936at_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"
126942at_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>&-
126945at_status=$? at_failed=false
126946$at_check_filter
126947echo stderr:; tee stderr <"$at_stderr"
126948at_fn_diff_devnull "$at_stdout" || at_failed=:
126949at_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.
126958sed '/^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
126973mv at-stderr stderr
126974# 2. Create the reference error message.
126975cat >expout <<'_ATEOF'
1269761.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"
126986at_fn_check_prepare_trace "calc.at:718"
126987( $at_check_trace; cat stderr
126988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
126989at_status=$? at_failed=false
126990$at_check_filter
126991at_fn_diff_devnull "$at_stderr" || at_failed=:
126992$at_diff expout "$at_stdout" || at_failed=:
126993at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
126994$at_failed && at_fn_log_failure
126995$at_traceon; }
126996
126997
126998cat >input <<'_ATEOF'
1269991//2
127000_ATEOF
127001
127002{ set +x
127003$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127004at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127005( $at_check_trace;  $PREPARSER ./calc input
127006) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127007at_status=$? at_failed=false
127008$at_check_filter
127009echo stderr:; tee stderr <"$at_stderr"
127010at_fn_diff_devnull "$at_stdout" || at_failed=:
127011at_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"
127017at_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>&-
127020at_status=$? at_failed=false
127021$at_check_filter
127022echo stderr:; tee stderr <"$at_stderr"
127023at_fn_diff_devnull "$at_stdout" || at_failed=:
127024at_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.
127033sed '/^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
127048mv at-stderr stderr
127049# 2. Create the reference error message.
127050cat >expout <<'_ATEOF'
1270511.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"
127061at_fn_check_prepare_trace "calc.at:718"
127062( $at_check_trace; cat stderr
127063) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127064at_status=$? at_failed=false
127065$at_check_filter
127066at_fn_diff_devnull "$at_stderr" || at_failed=:
127067$at_diff expout "$at_stdout" || at_failed=:
127068at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
127069$at_failed && at_fn_log_failure
127070$at_traceon; }
127071
127072
127073cat >input <<'_ATEOF'
127074error
127075_ATEOF
127076
127077{ set +x
127078$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127079at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127080( $at_check_trace;  $PREPARSER ./calc input
127081) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127082at_status=$? at_failed=false
127083$at_check_filter
127084echo stderr:; tee stderr <"$at_stderr"
127085at_fn_diff_devnull "$at_stdout" || at_failed=:
127086at_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"
127092at_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>&-
127095at_status=$? at_failed=false
127096$at_check_filter
127097echo stderr:; tee stderr <"$at_stderr"
127098at_fn_diff_devnull "$at_stdout" || at_failed=:
127099at_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.
127108sed '/^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
127123mv at-stderr stderr
127124# 2. Create the reference error message.
127125cat >expout <<'_ATEOF'
1271261.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"
127136at_fn_check_prepare_trace "calc.at:718"
127137( $at_check_trace; cat stderr
127138) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127139at_status=$? at_failed=false
127140$at_check_filter
127141at_fn_diff_devnull "$at_stderr" || at_failed=:
127142$at_diff expout "$at_stdout" || at_failed=:
127143at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
127144$at_failed && at_fn_log_failure
127145$at_traceon; }
127146
127147
127148cat >input <<'_ATEOF'
1271491 = 2 = 3
127150_ATEOF
127151
127152{ set +x
127153$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127154at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127155( $at_check_trace;  $PREPARSER ./calc input
127156) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127157at_status=$? at_failed=false
127158$at_check_filter
127159echo stderr:; tee stderr <"$at_stderr"
127160at_fn_diff_devnull "$at_stdout" || at_failed=:
127161at_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"
127167at_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>&-
127170at_status=$? at_failed=false
127171$at_check_filter
127172echo stderr:; tee stderr <"$at_stderr"
127173at_fn_diff_devnull "$at_stdout" || at_failed=:
127174at_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.
127183sed '/^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
127198mv at-stderr stderr
127199# 2. Create the reference error message.
127200cat >expout <<'_ATEOF'
1272011.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"
127211at_fn_check_prepare_trace "calc.at:718"
127212( $at_check_trace; cat stderr
127213) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127214at_status=$? at_failed=false
127215$at_check_filter
127216at_fn_diff_devnull "$at_stderr" || at_failed=:
127217$at_diff expout "$at_stdout" || at_failed=:
127218at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
127219$at_failed && at_fn_log_failure
127220$at_traceon; }
127221
127222
127223cat >input <<'_ATEOF'
127224
127225+1
127226_ATEOF
127227
127228{ set +x
127229$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127230at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127231( $at_check_trace;  $PREPARSER ./calc input
127232) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127233at_status=$? at_failed=false
127234$at_check_filter
127235echo stderr:; tee stderr <"$at_stderr"
127236at_fn_diff_devnull "$at_stdout" || at_failed=:
127237at_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"
127243at_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>&-
127246at_status=$? at_failed=false
127247$at_check_filter
127248echo stderr:; tee stderr <"$at_stderr"
127249at_fn_diff_devnull "$at_stdout" || at_failed=:
127250at_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.
127259sed '/^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
127274mv at-stderr stderr
127275# 2. Create the reference error message.
127276cat >expout <<'_ATEOF'
1272772.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"
127287at_fn_check_prepare_trace "calc.at:718"
127288( $at_check_trace; cat stderr
127289) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127290at_status=$? at_failed=false
127291$at_check_filter
127292at_fn_diff_devnull "$at_stderr" || at_failed=:
127293$at_diff expout "$at_stdout" || at_failed=:
127294at_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"
127302at_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>&-
127305at_status=$? at_failed=false
127306$at_check_filter
127307echo stderr:; tee stderr <"$at_stderr"
127308at_fn_diff_devnull "$at_stdout" || at_failed=:
127309at_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"
127315at_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>&-
127318at_status=$? at_failed=false
127319$at_check_filter
127320echo stderr:; tee stderr <"$at_stderr"
127321at_fn_diff_devnull "$at_stdout" || at_failed=:
127322at_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.
127331sed '/^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
127346mv at-stderr stderr
127347# 2. Create the reference error message.
127348cat >expout <<'_ATEOF'
1273491.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"
127359at_fn_check_prepare_trace "calc.at:718"
127360( $at_check_trace; cat stderr
127361) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127362at_status=$? at_failed=false
127363$at_check_filter
127364at_fn_diff_devnull "$at_stderr" || at_failed=:
127365$at_diff expout "$at_stdout" || at_failed=:
127366at_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#
127388cat >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"
127394at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127395( $at_check_trace;  $PREPARSER ./calc input
127396) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127397at_status=$? at_failed=false
127398$at_check_filter
127399echo stderr:; tee stderr <"$at_stderr"
127400at_fn_diff_devnull "$at_stdout" || at_failed=:
127401at_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"
127407at_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>&-
127410at_status=$? at_failed=false
127411$at_check_filter
127412echo stderr:; tee stderr <"$at_stderr"
127413at_fn_diff_devnull "$at_stdout" || at_failed=:
127414at_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.
127423sed '/^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
127438mv at-stderr stderr
127439# 2. Create the reference error message.
127440cat >expout <<'_ATEOF'
1274411.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1274421.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1274431.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1274441.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
127445calc: 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"
127455at_fn_check_prepare_trace "calc.at:718"
127456( $at_check_trace; cat stderr
127457) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127458at_status=$? at_failed=false
127459$at_check_filter
127460at_fn_diff_devnull "$at_stderr" || at_failed=:
127461$at_diff expout "$at_stdout" || at_failed=:
127462at_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.
127470cat >input <<'_ATEOF'
127471(!) + (1 2) = 1
127472_ATEOF
127473
127474{ set +x
127475$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127476at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127477( $at_check_trace;  $PREPARSER ./calc input
127478) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127479at_status=$? at_failed=false
127480$at_check_filter
127481echo stderr:; tee stderr <"$at_stderr"
127482at_fn_diff_devnull "$at_stdout" || at_failed=:
127483at_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"
127489at_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>&-
127492at_status=$? at_failed=false
127493$at_check_filter
127494echo stderr:; tee stderr <"$at_stderr"
127495at_fn_diff_devnull "$at_stdout" || at_failed=:
127496at_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.
127505sed '/^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
127520mv at-stderr stderr
127521# 2. Create the reference error message.
127522cat >expout <<'_ATEOF'
1275231.10: syntax error, unexpected number
127524calc: 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"
127534at_fn_check_prepare_trace "calc.at:718"
127535( $at_check_trace; cat stderr
127536) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127537at_status=$? at_failed=false
127538$at_check_filter
127539at_fn_diff_devnull "$at_stderr" || at_failed=:
127540$at_diff expout "$at_stdout" || at_failed=:
127541at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
127542$at_failed && at_fn_log_failure
127543$at_traceon; }
127544
127545
127546cat >input <<'_ATEOF'
127547(- *) + (1 2) = 1
127548_ATEOF
127549
127550{ set +x
127551$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127552at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127553( $at_check_trace;  $PREPARSER ./calc input
127554) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127555at_status=$? at_failed=false
127556$at_check_filter
127557echo stderr:; tee stderr <"$at_stderr"
127558at_fn_diff_devnull "$at_stdout" || at_failed=:
127559at_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"
127565at_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>&-
127568at_status=$? at_failed=false
127569$at_check_filter
127570echo stderr:; tee stderr <"$at_stderr"
127571at_fn_diff_devnull "$at_stdout" || at_failed=:
127572at_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.
127581sed '/^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
127596mv at-stderr stderr
127597# 2. Create the reference error message.
127598cat >expout <<'_ATEOF'
1275991.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1276001.12: syntax error, unexpected number
127601calc: 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"
127611at_fn_check_prepare_trace "calc.at:718"
127612( $at_check_trace; cat stderr
127613) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127614at_status=$? at_failed=false
127615$at_check_filter
127616at_fn_diff_devnull "$at_stderr" || at_failed=:
127617$at_diff expout "$at_stdout" || at_failed=:
127618at_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.
127626cat >input <<'_ATEOF'
127627(* *) + (*) + (*)
127628_ATEOF
127629
127630{ set +x
127631$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
127632at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
127633( $at_check_trace;  $PREPARSER ./calc input
127634) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127635at_status=$? at_failed=false
127636$at_check_filter
127637echo stderr:; tee stderr <"$at_stderr"
127638at_fn_diff_devnull "$at_stdout" || at_failed=:
127639at_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"
127645at_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>&-
127648at_status=$? at_failed=false
127649$at_check_filter
127650echo stderr:; tee stderr <"$at_stderr"
127651at_fn_diff_devnull "$at_stdout" || at_failed=:
127652at_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.
127661sed '/^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
127676mv at-stderr stderr
127677# 2. Create the reference error message.
127678cat >expout <<'_ATEOF'
1276791.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1276801.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1276811.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"
127691at_fn_check_prepare_trace "calc.at:718"
127692( $at_check_trace; cat stderr
127693) >>"$at_stdout" 2>>"$at_stderr" 5>&-
127694at_status=$? at_failed=false
127695$at_check_filter
127696at_fn_diff_devnull "$at_stderr" || at_failed=:
127697$at_diff expout "$at_stdout" || at_failed=:
127698at_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
127709read at_status <"$at_status_file"
127710#AT_STOP_252
127711#AT_START_253
127712at_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
127714at_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
127728cat >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
127769FILE *input;
127770static int power (int base, int exponent);
127771
127772
127773int 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%%
127791input:
127792  line
127793| input line         { ++*count; ++global_count; }
127794;
127795
127796line:
127797  '\n'
127798| exp '\n'           { *result = global_result = $1; }
127799;
127800
127801exp:
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
127822static int
127823power (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.  */
127834void
127835calc::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
127844cat >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
127855int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
127856static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
127857static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
127858
127859
127860static calc::parser::location_type last_yylloc;
127861
127862static int
127863get_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
127880static void
127881unget_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
127891static int
127892read_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
127923int 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
127953cat >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.  */
127972int
127973calcparse (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
127983semantic_value global_result = 0;
127984int global_count = 0;
127985
127986/* A C main function.  */
127987int
127988main (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
128026if 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"
128034at_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>&-
128038at_status=$? at_failed=false
128039$at_check_filter
128040echo stderr:; cat "$at_stderr"
128041echo stdout:; cat "$at_stdout"
128042at_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"
128048at_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>&-
128051at_status=$? at_failed=false
128052$at_check_filter
128053echo stderr:; cat "$at_stderr"
128054echo stdout:; cat "$at_stdout"
128055at_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"
128064at_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>&-
128069at_status=$? at_failed=false
128070$at_check_filter
128071at_fn_diff_devnull "$at_stderr" || at_failed=:
128072$at_diff expout "$at_stdout" || at_failed=:
128073at_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"
128082at_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>&-
128087at_status=$? at_failed=false
128088$at_check_filter
128089at_fn_diff_devnull "$at_stderr" || at_failed=:
128090$at_diff expout "$at_stdout" || at_failed=:
128091at_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
128097fi
128098{ set +x
128099$as_echo "$at_srcdir/calc.at:719: bison -o calc.cc calc.y"
128100at_fn_check_prepare_trace "calc.at:719"
128101( $at_check_trace; bison -o calc.cc calc.y
128102) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128103at_status=$? at_failed=false
128104$at_check_filter
128105at_fn_diff_devnull "$at_stderr" || at_failed=:
128106at_fn_diff_devnull "$at_stdout" || at_failed=:
128107at_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"
128115at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:719"
128116( $at_check_trace; $BISON_CXX_WORKS
128117) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128118at_status=$? at_failed=false
128119$at_check_filter
128120echo stderr:; cat "$at_stderr"
128121echo stdout:; cat "$at_stdout"
128122at_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"
128128at_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>&-
128131at_status=$? at_failed=false
128132$at_check_filter
128133echo stderr:; cat "$at_stderr"
128134echo stdout:; cat "$at_stdout"
128135at_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"
128150at_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>&-
128161at_status=$? at_failed=false
128162$at_check_filter
128163at_fn_diff_devnull "$at_stderr" || at_failed=:
128164at_fn_diff_devnull "$at_stdout" || at_failed=:
128165at_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"
128179at_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>&-
128190at_status=$? at_failed=false
128191$at_check_filter
128192at_fn_diff_devnull "$at_stderr" || at_failed=:
128193at_fn_diff_devnull "$at_stdout" || at_failed=:
128194at_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.
128200cat >input <<'_ATEOF'
1282011 + 2 * 3 = 7
1282021 + 2 * -3 = -5
128203
128204-1^2 = -1
128205(-1)^2 = 1
128206
128207---1 = -1
128208
1282091 - 2 - 3 = -4
1282101 - (2 - 3) = 2
128211
1282122^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"
128218at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128219( $at_check_trace;  $PREPARSER ./calc input
128220) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128221at_status=$? at_failed=false
128222$at_check_filter
128223echo stderr:; tee stderr <"$at_stderr"
128224at_fn_diff_devnull "$at_stdout" || at_failed=:
128225at_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"
128231at_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>&-
128234at_status=$? at_failed=false
128235$at_check_filter
128236echo stderr:; tee stderr <"$at_stderr"
128237at_fn_diff_devnull "$at_stdout" || at_failed=:
128238at_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.
128246cat >input <<'_ATEOF'
1282471 2
128248_ATEOF
128249
128250{ set +x
128251$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128252at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128253( $at_check_trace;  $PREPARSER ./calc input
128254) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128255at_status=$? at_failed=false
128256$at_check_filter
128257echo stderr:; tee stderr <"$at_stderr"
128258at_fn_diff_devnull "$at_stdout" || at_failed=:
128259at_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"
128265at_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>&-
128268at_status=$? at_failed=false
128269$at_check_filter
128270echo stderr:; tee stderr <"$at_stderr"
128271at_fn_diff_devnull "$at_stdout" || at_failed=:
128272at_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.
128281sed '/^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
128296mv at-stderr stderr
128297# 2. Create the reference error message.
128298cat >expout <<'_ATEOF'
1282991.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"
128309at_fn_check_prepare_trace "calc.at:719"
128310( $at_check_trace; cat stderr
128311) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128312at_status=$? at_failed=false
128313$at_check_filter
128314at_fn_diff_devnull "$at_stderr" || at_failed=:
128315$at_diff expout "$at_stdout" || at_failed=:
128316at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
128317$at_failed && at_fn_log_failure
128318$at_traceon; }
128319
128320
128321cat >input <<'_ATEOF'
1283221//2
128323_ATEOF
128324
128325{ set +x
128326$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128327at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128328( $at_check_trace;  $PREPARSER ./calc input
128329) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128330at_status=$? at_failed=false
128331$at_check_filter
128332echo stderr:; tee stderr <"$at_stderr"
128333at_fn_diff_devnull "$at_stdout" || at_failed=:
128334at_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"
128340at_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>&-
128343at_status=$? at_failed=false
128344$at_check_filter
128345echo stderr:; tee stderr <"$at_stderr"
128346at_fn_diff_devnull "$at_stdout" || at_failed=:
128347at_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.
128356sed '/^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
128371mv at-stderr stderr
128372# 2. Create the reference error message.
128373cat >expout <<'_ATEOF'
1283741.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"
128384at_fn_check_prepare_trace "calc.at:719"
128385( $at_check_trace; cat stderr
128386) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128387at_status=$? at_failed=false
128388$at_check_filter
128389at_fn_diff_devnull "$at_stderr" || at_failed=:
128390$at_diff expout "$at_stdout" || at_failed=:
128391at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
128392$at_failed && at_fn_log_failure
128393$at_traceon; }
128394
128395
128396cat >input <<'_ATEOF'
128397error
128398_ATEOF
128399
128400{ set +x
128401$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128402at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128403( $at_check_trace;  $PREPARSER ./calc input
128404) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128405at_status=$? at_failed=false
128406$at_check_filter
128407echo stderr:; tee stderr <"$at_stderr"
128408at_fn_diff_devnull "$at_stdout" || at_failed=:
128409at_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"
128415at_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>&-
128418at_status=$? at_failed=false
128419$at_check_filter
128420echo stderr:; tee stderr <"$at_stderr"
128421at_fn_diff_devnull "$at_stdout" || at_failed=:
128422at_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.
128431sed '/^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
128446mv at-stderr stderr
128447# 2. Create the reference error message.
128448cat >expout <<'_ATEOF'
1284491.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"
128459at_fn_check_prepare_trace "calc.at:719"
128460( $at_check_trace; cat stderr
128461) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128462at_status=$? at_failed=false
128463$at_check_filter
128464at_fn_diff_devnull "$at_stderr" || at_failed=:
128465$at_diff expout "$at_stdout" || at_failed=:
128466at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
128467$at_failed && at_fn_log_failure
128468$at_traceon; }
128469
128470
128471cat >input <<'_ATEOF'
1284721 = 2 = 3
128473_ATEOF
128474
128475{ set +x
128476$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128477at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128478( $at_check_trace;  $PREPARSER ./calc input
128479) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128480at_status=$? at_failed=false
128481$at_check_filter
128482echo stderr:; tee stderr <"$at_stderr"
128483at_fn_diff_devnull "$at_stdout" || at_failed=:
128484at_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"
128490at_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>&-
128493at_status=$? at_failed=false
128494$at_check_filter
128495echo stderr:; tee stderr <"$at_stderr"
128496at_fn_diff_devnull "$at_stdout" || at_failed=:
128497at_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.
128506sed '/^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
128521mv at-stderr stderr
128522# 2. Create the reference error message.
128523cat >expout <<'_ATEOF'
1285241.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"
128534at_fn_check_prepare_trace "calc.at:719"
128535( $at_check_trace; cat stderr
128536) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128537at_status=$? at_failed=false
128538$at_check_filter
128539at_fn_diff_devnull "$at_stderr" || at_failed=:
128540$at_diff expout "$at_stdout" || at_failed=:
128541at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
128542$at_failed && at_fn_log_failure
128543$at_traceon; }
128544
128545
128546cat >input <<'_ATEOF'
128547
128548+1
128549_ATEOF
128550
128551{ set +x
128552$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128553at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128554( $at_check_trace;  $PREPARSER ./calc input
128555) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128556at_status=$? at_failed=false
128557$at_check_filter
128558echo stderr:; tee stderr <"$at_stderr"
128559at_fn_diff_devnull "$at_stdout" || at_failed=:
128560at_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"
128566at_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>&-
128569at_status=$? at_failed=false
128570$at_check_filter
128571echo stderr:; tee stderr <"$at_stderr"
128572at_fn_diff_devnull "$at_stdout" || at_failed=:
128573at_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.
128582sed '/^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
128597mv at-stderr stderr
128598# 2. Create the reference error message.
128599cat >expout <<'_ATEOF'
1286002.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"
128610at_fn_check_prepare_trace "calc.at:719"
128611( $at_check_trace; cat stderr
128612) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128613at_status=$? at_failed=false
128614$at_check_filter
128615at_fn_diff_devnull "$at_stderr" || at_failed=:
128616$at_diff expout "$at_stdout" || at_failed=:
128617at_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"
128625at_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>&-
128628at_status=$? at_failed=false
128629$at_check_filter
128630echo stderr:; tee stderr <"$at_stderr"
128631at_fn_diff_devnull "$at_stdout" || at_failed=:
128632at_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"
128638at_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>&-
128641at_status=$? at_failed=false
128642$at_check_filter
128643echo stderr:; tee stderr <"$at_stderr"
128644at_fn_diff_devnull "$at_stdout" || at_failed=:
128645at_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.
128654sed '/^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
128669mv at-stderr stderr
128670# 2. Create the reference error message.
128671cat >expout <<'_ATEOF'
1286721.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"
128682at_fn_check_prepare_trace "calc.at:719"
128683( $at_check_trace; cat stderr
128684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128685at_status=$? at_failed=false
128686$at_check_filter
128687at_fn_diff_devnull "$at_stderr" || at_failed=:
128688$at_diff expout "$at_stdout" || at_failed=:
128689at_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#
128711cat >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"
128717at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128718( $at_check_trace;  $PREPARSER ./calc input
128719) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128720at_status=$? at_failed=false
128721$at_check_filter
128722echo stderr:; tee stderr <"$at_stderr"
128723at_fn_diff_devnull "$at_stdout" || at_failed=:
128724at_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"
128730at_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>&-
128733at_status=$? at_failed=false
128734$at_check_filter
128735echo stderr:; tee stderr <"$at_stderr"
128736at_fn_diff_devnull "$at_stdout" || at_failed=:
128737at_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.
128746sed '/^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
128761mv at-stderr stderr
128762# 2. Create the reference error message.
128763cat >expout <<'_ATEOF'
1287641.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1287651.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1287661.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1287671.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
128768calc: 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"
128778at_fn_check_prepare_trace "calc.at:719"
128779( $at_check_trace; cat stderr
128780) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128781at_status=$? at_failed=false
128782$at_check_filter
128783at_fn_diff_devnull "$at_stderr" || at_failed=:
128784$at_diff expout "$at_stdout" || at_failed=:
128785at_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.
128793cat >input <<'_ATEOF'
128794(!) + (1 2) = 1
128795_ATEOF
128796
128797{ set +x
128798$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128799at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128800( $at_check_trace;  $PREPARSER ./calc input
128801) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128802at_status=$? at_failed=false
128803$at_check_filter
128804echo stderr:; tee stderr <"$at_stderr"
128805at_fn_diff_devnull "$at_stdout" || at_failed=:
128806at_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"
128812at_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>&-
128815at_status=$? at_failed=false
128816$at_check_filter
128817echo stderr:; tee stderr <"$at_stderr"
128818at_fn_diff_devnull "$at_stdout" || at_failed=:
128819at_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.
128828sed '/^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
128843mv at-stderr stderr
128844# 2. Create the reference error message.
128845cat >expout <<'_ATEOF'
1288461.10: syntax error, unexpected number
128847calc: 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"
128857at_fn_check_prepare_trace "calc.at:719"
128858( $at_check_trace; cat stderr
128859) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128860at_status=$? at_failed=false
128861$at_check_filter
128862at_fn_diff_devnull "$at_stderr" || at_failed=:
128863$at_diff expout "$at_stdout" || at_failed=:
128864at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
128865$at_failed && at_fn_log_failure
128866$at_traceon; }
128867
128868
128869cat >input <<'_ATEOF'
128870(- *) + (1 2) = 1
128871_ATEOF
128872
128873{ set +x
128874$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128875at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128876( $at_check_trace;  $PREPARSER ./calc input
128877) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128878at_status=$? at_failed=false
128879$at_check_filter
128880echo stderr:; tee stderr <"$at_stderr"
128881at_fn_diff_devnull "$at_stdout" || at_failed=:
128882at_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"
128888at_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>&-
128891at_status=$? at_failed=false
128892$at_check_filter
128893echo stderr:; tee stderr <"$at_stderr"
128894at_fn_diff_devnull "$at_stdout" || at_failed=:
128895at_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.
128904sed '/^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
128919mv at-stderr stderr
128920# 2. Create the reference error message.
128921cat >expout <<'_ATEOF'
1289221.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1289231.12: syntax error, unexpected number
128924calc: 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"
128934at_fn_check_prepare_trace "calc.at:719"
128935( $at_check_trace; cat stderr
128936) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128937at_status=$? at_failed=false
128938$at_check_filter
128939at_fn_diff_devnull "$at_stderr" || at_failed=:
128940$at_diff expout "$at_stdout" || at_failed=:
128941at_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.
128949cat >input <<'_ATEOF'
128950(* *) + (*) + (*)
128951_ATEOF
128952
128953{ set +x
128954$as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
128955at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
128956( $at_check_trace;  $PREPARSER ./calc input
128957) >>"$at_stdout" 2>>"$at_stderr" 5>&-
128958at_status=$? at_failed=false
128959$at_check_filter
128960echo stderr:; tee stderr <"$at_stderr"
128961at_fn_diff_devnull "$at_stdout" || at_failed=:
128962at_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"
128968at_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>&-
128971at_status=$? at_failed=false
128972$at_check_filter
128973echo stderr:; tee stderr <"$at_stderr"
128974at_fn_diff_devnull "$at_stdout" || at_failed=:
128975at_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.
128984sed '/^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
128999mv at-stderr stderr
129000# 2. Create the reference error message.
129001cat >expout <<'_ATEOF'
1290021.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1290031.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1290041.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"
129014at_fn_check_prepare_trace "calc.at:719"
129015( $at_check_trace; cat stderr
129016) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129017at_status=$? at_failed=false
129018$at_check_filter
129019at_fn_diff_devnull "$at_stderr" || at_failed=:
129020$at_diff expout "$at_stdout" || at_failed=:
129021at_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
129032read at_status <"$at_status_file"
129033#AT_STOP_253
129034#AT_START_254
129035at_fn_group_banner 254 'torture.at:137' \
129036  "Big triangle" "                                   " 15
129037at_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
129048cat >gengram.pl <<'_ATEOF'
129049#! /usr/bin/perl -w
129050
129051use strict;
129052my $max = $ARGV[0] || 10;
129053
129054print <<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
129070static int yylex (void);
129071static void yyerror ( const char *msg);
129072%}
129073%union
129074{
129075  int val;
129076};
129077
129078%token END "end"
129079%type <val> exp input
129080EOF
129081
129082for my $size (1 .. $max)
129083  {
129084    print "%token t$size $size \"$size\"\n";
129085  };
129086
129087print <<EOF;
129088%%
129089input:
129090  exp        { assert (\$1 == 0); \$\$ = \$1; }
129091| input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
129092;
129093
129094exp:
129095  END
129096    { \$\$ = 0; }
129097EOF
129098
129099for my $size (1 .. $max)
129100  {
129101    use Text::Wrap;
129102    print wrap ("| ", "   ",
129103		(map { "\"$_\"" } (1 .. $size)),
129104		" END \n"),
129105		  "    { \$\$ = $size; }\n";
129106  };
129107print ";\n";
129108
129109print <<\EOF;
129110%%
129111#include <stdio.h>
129112/* A C error reporting function.  */
129113static
129114void yyerror ( const char *msg)
129115{
129116  fprintf (stderr, "%s\n", msg);
129117}
129118static int
129119yylex (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}
129133int
129134main (void)
129135{
129136  yydebug = !!getenv ("YYDEBUG");
129137  return yyparse ();
129138}
129139EOF
129140_ATEOF
129141
129142
129143
129144{ set +x
129145$as_echo "$at_srcdir/torture.at:143: \$PERL -w ./gengram.pl 200 || exit 77"
129146at_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>&-
129149at_status=$? at_failed=false
129150$at_check_filter
129151at_fn_diff_devnull "$at_stderr" || at_failed=:
129152echo stdout:; tee stdout <"$at_stdout"
129153at_fn_check_status 0 $at_status "$at_srcdir/torture.at:143"
129154$at_failed && at_fn_log_failure
129155$at_traceon; }
129156
129157mv stdout input.y
129158
129159{ set +x
129160$as_echo "$at_srcdir/torture.at:144: bison -v -o input.c input.y"
129161at_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>&-
129164at_status=$? at_failed=false
129165$at_check_filter
129166at_fn_diff_devnull "$at_stderr" || at_failed=:
129167at_fn_diff_devnull "$at_stdout" || at_failed=:
129168at_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"
129175at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:145"
129176( $at_check_trace; $BISON_C_WORKS
129177) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129178at_status=$? at_failed=false
129179$at_check_filter
129180echo stderr:; cat "$at_stderr"
129181echo stdout:; cat "$at_stdout"
129182at_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"
129188at_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>&-
129191at_status=$? at_failed=false
129192$at_check_filter
129193echo stderr:; cat "$at_stderr"
129194echo stdout:; cat "$at_stdout"
129195at_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"
129201at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:146"
129202( $at_check_trace;  $PREPARSER ./input
129203) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129204at_status=$? at_failed=false
129205$at_check_filter
129206echo stderr:; tee stderr <"$at_stderr"
129207at_fn_diff_devnull "$at_stdout" || at_failed=:
129208at_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"
129214at_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>&-
129217at_status=$? at_failed=false
129218$at_check_filter
129219at_fn_diff_devnull "$at_stderr" || at_failed=:
129220at_fn_diff_devnull "$at_stdout" || at_failed=:
129221at_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
129230read at_status <"$at_status_file"
129231#AT_STOP_254
129232#AT_START_255
129233at_fn_group_banner 255 'torture.at:227' \
129234  "Big horizontal" "                                 " 15
129235at_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
129254cat >gengram.pl <<'_ATEOF'
129255#! /usr/bin/perl -w
129256
129257use strict;
129258my $max = $ARGV[0] || 10;
129259
129260print <<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
129275static int yylex (void);
129276static void yyerror ( const char *msg);
129277%}
129278
129279%token
129280EOF
129281for my $size (1 .. $max)
129282  {
129283    print "    t$size $size \"$size\"\n";
129284  };
129285
129286print <<EOF;
129287
129288%%
129289EOF
129290
129291use Text::Wrap;
129292print
129293  wrap ("exp: ", "  ",
129294	(map { "\"$_\"" } (1 .. $max)), ";"),
129295  "\n";
129296
129297print <<\EOF;
129298%%
129299#include <assert.h>
129300#include <stdio.h>
129301/* A C error reporting function.  */
129302static
129303void yyerror ( const char *msg)
129304{
129305  fprintf (stderr, "%s\n", msg);
129306}
129307static int
129308yylex (void)
129309{
129310  static int counter = 1;
129311  if (counter <= MAX)
129312    return counter++;
129313  assert (counter++ == MAX + 1);
129314  return 0;
129315}
129316
129317int
129318main (void)
129319{
129320  yydebug = !!getenv ("YYDEBUG");
129321  return yyparse ();
129322}
129323EOF
129324_ATEOF
129325
129326
129327{ set +x
129328$as_echo "$at_srcdir/torture.at:241: \$PERL -w ./gengram.pl 1000 || exit 77"
129329at_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>&-
129332at_status=$? at_failed=false
129333$at_check_filter
129334at_fn_diff_devnull "$at_stderr" || at_failed=:
129335echo stdout:; tee stdout <"$at_stdout"
129336at_fn_check_status 0 $at_status "$at_srcdir/torture.at:241"
129337$at_failed && at_fn_log_failure
129338$at_traceon; }
129339
129340mv 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.
129346data_limit=`(ulimit -S -d) 2>/dev/null`
129347case $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"
129352at_fn_check_prepare_trace "torture.at:245"
129353( $at_check_trace; ulimit -S -d 204000 || exit 77
129354) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129355at_status=$? at_failed=false
129356$at_check_filter
129357at_fn_diff_devnull "$at_stderr" || at_failed=:
129358at_fn_diff_devnull "$at_stdout" || at_failed=:
129359at_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
129365esac
129366
129367{ set +x
129368$as_echo "$at_srcdir/torture.at:247: bison -v -o input.c input.y"
129369at_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>&-
129372at_status=$? at_failed=false
129373$at_check_filter
129374at_fn_diff_devnull "$at_stderr" || at_failed=:
129375at_fn_diff_devnull "$at_stdout" || at_failed=:
129376at_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"
129383at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:248"
129384( $at_check_trace; $BISON_C_WORKS
129385) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129386at_status=$? at_failed=false
129387$at_check_filter
129388echo stderr:; cat "$at_stderr"
129389echo stdout:; cat "$at_stdout"
129390at_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"
129396at_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>&-
129399at_status=$? at_failed=false
129400$at_check_filter
129401echo stderr:; cat "$at_stderr"
129402echo stdout:; cat "$at_stdout"
129403at_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"
129409at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:249"
129410( $at_check_trace;  $PREPARSER ./input
129411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129412at_status=$? at_failed=false
129413$at_check_filter
129414echo stderr:; tee stderr <"$at_stderr"
129415at_fn_diff_devnull "$at_stdout" || at_failed=:
129416at_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"
129422at_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>&-
129425at_status=$? at_failed=false
129426$at_check_filter
129427at_fn_diff_devnull "$at_stderr" || at_failed=:
129428at_fn_diff_devnull "$at_stdout" || at_failed=:
129429at_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
129438read at_status <"$at_status_file"
129439#AT_STOP_255
129440#AT_START_256
129441at_fn_group_banner 256 'torture.at:364' \
129442  "Many lookahead tokens" "                          " 15
129443at_xfail=no
129444(
129445  $as_echo "256. $at_setup_line: testing $at_desc ..."
129446  $at_traceon
129447
129448
129449
129450cat >gengram.pl <<'_ATEOF'
129451#! /usr/bin/perl -w
129452
129453use strict;
129454use Text::Wrap;
129455my $max = $ARGV[0] || 10;
129456
129457print <<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
129471static int yylex (void);
129472static void yyerror ( const char *msg);
129473%}
129474%union
129475{
129476  int val;
129477};
129478
129479%type <val> input exp
129480%token token
129481EOF
129482
129483print
129484  wrap ("%type <val> ",
129485	"            ",
129486	map { "n$_" } (1 .. $max)),
129487  "\n";
129488
129489print "%token\n";
129490for my $count (1 .. $max)
129491  {
129492    print "    t$count $count \"$count\"\n";
129493  };
129494
129495print <<EOF;
129496%%
129497input:
129498  exp        { assert (\$1 == 1); \$\$ = \$1; }
129499| input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
129500;
129501
129502exp:
129503  n1 "1" { assert (\$1 == 1); \$\$ = \$1; }
129504EOF
129505
129506for my $count (2 .. $max)
129507  {
129508    print "| n$count \"$count\" { assert (\$1 == $count); \$\$ = \$1; }\n";
129509  };
129510print ";\n";
129511
129512for my $count (1 .. $max)
129513  {
129514    print "n$count: token { \$\$ = $count; };\n";
129515  };
129516
129517print <<\EOF;
129518%%
129519#include <stdio.h>
129520/* A C error reporting function.  */
129521static
129522void yyerror ( const char *msg)
129523{
129524  fprintf (stderr, "%s\n", msg);
129525}
129526static int
129527yylex (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
129545int
129546main (void)
129547{
129548  yydebug = !!getenv ("YYDEBUG");
129549  return yyparse ();
129550}
129551EOF
129552_ATEOF
129553
129554
129555{ set +x
129556$as_echo "$at_srcdir/torture.at:366: \$PERL -w ./gengram.pl 1000 || exit 77"
129557at_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>&-
129560at_status=$? at_failed=false
129561$at_check_filter
129562at_fn_diff_devnull "$at_stderr" || at_failed=:
129563echo stdout:; tee stdout <"$at_stdout"
129564at_fn_check_status 0 $at_status "$at_srcdir/torture.at:366"
129565$at_failed && at_fn_log_failure
129566$at_traceon; }
129567
129568mv 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.
129574data_limit=`(ulimit -S -d) 2>/dev/null`
129575case $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"
129580at_fn_check_prepare_trace "torture.at:370"
129581( $at_check_trace; ulimit -S -d 204000 || exit 77
129582) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129583at_status=$? at_failed=false
129584$at_check_filter
129585at_fn_diff_devnull "$at_stderr" || at_failed=:
129586at_fn_diff_devnull "$at_stdout" || at_failed=:
129587at_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
129593esac
129594
129595if 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"
129603at_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>&-
129607at_status=$? at_failed=false
129608$at_check_filter
129609echo stderr:; cat "$at_stderr"
129610echo stdout:; cat "$at_stdout"
129611at_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"
129617at_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>&-
129620at_status=$? at_failed=false
129621$at_check_filter
129622echo stderr:; cat "$at_stderr"
129623echo stdout:; cat "$at_stdout"
129624at_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"
129633at_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>&-
129638at_status=$? at_failed=false
129639$at_check_filter
129640at_fn_diff_devnull "$at_stderr" || at_failed=:
129641$at_diff expout "$at_stdout" || at_failed=:
129642at_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"
129651at_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>&-
129656at_status=$? at_failed=false
129657$at_check_filter
129658at_fn_diff_devnull "$at_stderr" || at_failed=:
129659$at_diff expout "$at_stdout" || at_failed=:
129660at_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
129666fi
129667{ set +x
129668$as_echo "$at_srcdir/torture.at:372: bison -v -o input.c input.y"
129669at_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>&-
129672at_status=$? at_failed=false
129673$at_check_filter
129674at_fn_diff_devnull "$at_stderr" || at_failed=:
129675at_fn_diff_devnull "$at_stdout" || at_failed=:
129676at_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"
129683at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:373"
129684( $at_check_trace; $BISON_C_WORKS
129685) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129686at_status=$? at_failed=false
129687$at_check_filter
129688echo stderr:; cat "$at_stderr"
129689echo stdout:; cat "$at_stdout"
129690at_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"
129696at_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>&-
129699at_status=$? at_failed=false
129700$at_check_filter
129701echo stderr:; cat "$at_stderr"
129702echo stdout:; cat "$at_stdout"
129703at_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"
129709at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:374"
129710( $at_check_trace;  $PREPARSER ./input
129711) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129712at_status=$? at_failed=false
129713$at_check_filter
129714echo stderr:; tee stderr <"$at_stderr"
129715at_fn_diff_devnull "$at_stdout" || at_failed=:
129716at_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"
129722at_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>&-
129725at_status=$? at_failed=false
129726$at_check_filter
129727at_fn_diff_devnull "$at_stderr" || at_failed=:
129728at_fn_diff_devnull "$at_stdout" || at_failed=:
129729at_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
129738read at_status <"$at_status_file"
129739#AT_STOP_256
129740#AT_START_257
129741at_fn_group_banner 257 'torture.at:466' \
129742  "Exploding the Stack Size with Alloca" "           " 15
129743at_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:
129754cat >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%%
129782exp: WAIT_FOR_EOF exp | ;
129783%%
129784#include <stdio.h>
129785/* A C error reporting function.  */
129786static
129787void yyerror ( const char *msg)
129788{
129789  fprintf (stderr, "%s\n", msg);
129790}
129791#include <assert.h>
129792static int
129793yylex (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. */
129803static int
129804get_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
129817int
129818main (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
129840if 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"
129848at_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>&-
129852at_status=$? at_failed=false
129853$at_check_filter
129854echo stderr:; cat "$at_stderr"
129855echo stdout:; cat "$at_stdout"
129856at_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"
129862at_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>&-
129865at_status=$? at_failed=false
129866$at_check_filter
129867echo stderr:; cat "$at_stderr"
129868echo stdout:; cat "$at_stdout"
129869at_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"
129878at_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>&-
129883at_status=$? at_failed=false
129884$at_check_filter
129885at_fn_diff_devnull "$at_stderr" || at_failed=:
129886$at_diff expout "$at_stdout" || at_failed=:
129887at_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"
129896at_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>&-
129901at_status=$? at_failed=false
129902$at_check_filter
129903at_fn_diff_devnull "$at_stderr" || at_failed=:
129904$at_diff expout "$at_stdout" || at_failed=:
129905at_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
129911fi
129912{ set +x
129913$as_echo "$at_srcdir/torture.at:475: bison -o input.c input.y"
129914at_fn_check_prepare_trace "torture.at:475"
129915( $at_check_trace; bison -o input.c input.y
129916) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129917at_status=$? at_failed=false
129918$at_check_filter
129919at_fn_diff_devnull "$at_stderr" || at_failed=:
129920at_fn_diff_devnull "$at_stdout" || at_failed=:
129921at_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"
129928at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:475"
129929( $at_check_trace; $BISON_C_WORKS
129930) >>"$at_stdout" 2>>"$at_stderr" 5>&-
129931at_status=$? at_failed=false
129932$at_check_filter
129933echo stderr:; cat "$at_stderr"
129934echo stdout:; cat "$at_stdout"
129935at_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"
129941at_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>&-
129944at_status=$? at_failed=false
129945$at_check_filter
129946echo stderr:; cat "$at_stderr"
129947echo stdout:; cat "$at_stdout"
129948at_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"
129957at_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>&-
129960at_status=$? at_failed=false
129961$at_check_filter
129962echo stderr:; tee stderr <"$at_stderr"
129963at_fn_diff_devnull "$at_stdout" || at_failed=:
129964at_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"
129970at_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>&-
129973at_status=$? at_failed=false
129974$at_check_filter
129975echo stderr:; cat "$at_stderr"
129976at_fn_diff_devnull "$at_stdout" || at_failed=:
129977at_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"
129985at_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>&-
129988at_status=$? at_failed=false
129989$at_check_filter
129990echo stderr:; tee stderr <"$at_stderr"
129991at_fn_diff_devnull "$at_stdout" || at_failed=:
129992at_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"
129998at_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>&-
130001at_status=$? at_failed=false
130002$at_check_filter
130003echo stderr:; cat "$at_stderr"
130004at_fn_diff_devnull "$at_stdout" || at_failed=:
130005at_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"
130014at_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>&-
130017at_status=$? at_failed=false
130018$at_check_filter
130019echo stderr:; tee stderr <"$at_stderr"
130020at_fn_diff_devnull "$at_stdout" || at_failed=:
130021at_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"
130027at_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>&-
130030at_status=$? at_failed=false
130031$at_check_filter
130032echo stderr:; cat "$at_stderr"
130033at_fn_diff_devnull "$at_stdout" || at_failed=:
130034at_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:
130046cat >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%%
130075exp: WAIT_FOR_EOF exp | ;
130076%%
130077#include <stdio.h>
130078/* A C error reporting function.  */
130079static
130080void yyerror ( const char *msg)
130081{
130082  fprintf (stderr, "%s\n", msg);
130083}
130084#include <assert.h>
130085static int
130086yylex (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. */
130096static int
130097get_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
130110int
130111main (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
130135if 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"
130143at_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>&-
130147at_status=$? at_failed=false
130148$at_check_filter
130149echo stderr:; cat "$at_stderr"
130150echo stdout:; cat "$at_stdout"
130151at_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"
130157at_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>&-
130160at_status=$? at_failed=false
130161$at_check_filter
130162echo stderr:; cat "$at_stderr"
130163echo stdout:; cat "$at_stdout"
130164at_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"
130173at_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>&-
130178at_status=$? at_failed=false
130179$at_check_filter
130180at_fn_diff_devnull "$at_stderr" || at_failed=:
130181$at_diff expout "$at_stdout" || at_failed=:
130182at_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"
130191at_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>&-
130196at_status=$? at_failed=false
130197$at_check_filter
130198at_fn_diff_devnull "$at_stderr" || at_failed=:
130199$at_diff expout "$at_stdout" || at_failed=:
130200at_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
130206fi
130207{ set +x
130208$as_echo "$at_srcdir/torture.at:491: bison -o input.c input.y"
130209at_fn_check_prepare_trace "torture.at:491"
130210( $at_check_trace; bison -o input.c input.y
130211) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130212at_status=$? at_failed=false
130213$at_check_filter
130214at_fn_diff_devnull "$at_stderr" || at_failed=:
130215at_fn_diff_devnull "$at_stdout" || at_failed=:
130216at_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"
130223at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:491"
130224( $at_check_trace; $BISON_C_WORKS
130225) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130226at_status=$? at_failed=false
130227$at_check_filter
130228echo stderr:; cat "$at_stderr"
130229echo stdout:; cat "$at_stdout"
130230at_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"
130236at_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>&-
130239at_status=$? at_failed=false
130240$at_check_filter
130241echo stderr:; cat "$at_stderr"
130242echo stdout:; cat "$at_stdout"
130243at_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"
130250at_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>&-
130253at_status=$? at_failed=false
130254$at_check_filter
130255echo stderr:; tee stderr <"$at_stderr"
130256at_fn_diff_devnull "$at_stdout" || at_failed=:
130257at_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"
130263at_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>&-
130266at_status=$? at_failed=false
130267$at_check_filter
130268echo stderr:; cat "$at_stderr"
130269at_fn_diff_devnull "$at_stdout" || at_failed=:
130270at_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"
130277at_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>&-
130280at_status=$? at_failed=false
130281$at_check_filter
130282echo stderr:; tee stderr <"$at_stderr"
130283at_fn_diff_devnull "$at_stdout" || at_failed=:
130284at_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"
130290at_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>&-
130293at_status=$? at_failed=false
130294$at_check_filter
130295echo stderr:; cat "$at_stderr"
130296at_fn_diff_devnull "$at_stdout" || at_failed=:
130297at_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"
130304at_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>&-
130307at_status=$? at_failed=false
130308$at_check_filter
130309echo stderr:; tee stderr <"$at_stderr"
130310at_fn_diff_devnull "$at_stdout" || at_failed=:
130311at_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"
130317at_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>&-
130320at_status=$? at_failed=false
130321$at_check_filter
130322echo stderr:; cat "$at_stderr"
130323at_fn_diff_devnull "$at_stdout" || at_failed=:
130324at_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
130335read at_status <"$at_status_file"
130336#AT_STOP_257
130337#AT_START_258
130338at_fn_group_banner 258 'torture.at:512' \
130339  "Exploding the Stack Size with Malloc" "           " 15
130340at_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:
130351cat >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%%
130374exp: WAIT_FOR_EOF exp | ;
130375%%
130376#include <stdio.h>
130377/* A C error reporting function.  */
130378static
130379void yyerror ( const char *msg)
130380{
130381  fprintf (stderr, "%s\n", msg);
130382}
130383#include <assert.h>
130384static int
130385yylex (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. */
130395static int
130396get_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
130409int
130410main (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
130432if 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"
130440at_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>&-
130444at_status=$? at_failed=false
130445$at_check_filter
130446echo stderr:; cat "$at_stderr"
130447echo stdout:; cat "$at_stdout"
130448at_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"
130454at_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>&-
130457at_status=$? at_failed=false
130458$at_check_filter
130459echo stderr:; cat "$at_stderr"
130460echo stdout:; cat "$at_stdout"
130461at_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"
130470at_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>&-
130475at_status=$? at_failed=false
130476$at_check_filter
130477at_fn_diff_devnull "$at_stderr" || at_failed=:
130478$at_diff expout "$at_stdout" || at_failed=:
130479at_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"
130488at_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>&-
130493at_status=$? at_failed=false
130494$at_check_filter
130495at_fn_diff_devnull "$at_stderr" || at_failed=:
130496$at_diff expout "$at_stdout" || at_failed=:
130497at_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
130503fi
130504{ set +x
130505$as_echo "$at_srcdir/torture.at:516: bison -o input.c input.y"
130506at_fn_check_prepare_trace "torture.at:516"
130507( $at_check_trace; bison -o input.c input.y
130508) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130509at_status=$? at_failed=false
130510$at_check_filter
130511at_fn_diff_devnull "$at_stderr" || at_failed=:
130512at_fn_diff_devnull "$at_stdout" || at_failed=:
130513at_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"
130520at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:516"
130521( $at_check_trace; $BISON_C_WORKS
130522) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130523at_status=$? at_failed=false
130524$at_check_filter
130525echo stderr:; cat "$at_stderr"
130526echo stdout:; cat "$at_stdout"
130527at_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"
130533at_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>&-
130536at_status=$? at_failed=false
130537$at_check_filter
130538echo stderr:; cat "$at_stderr"
130539echo stdout:; cat "$at_stdout"
130540at_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"
130549at_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>&-
130552at_status=$? at_failed=false
130553$at_check_filter
130554echo stderr:; tee stderr <"$at_stderr"
130555at_fn_diff_devnull "$at_stdout" || at_failed=:
130556at_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"
130562at_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>&-
130565at_status=$? at_failed=false
130566$at_check_filter
130567echo stderr:; cat "$at_stderr"
130568at_fn_diff_devnull "$at_stdout" || at_failed=:
130569at_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"
130577at_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>&-
130580at_status=$? at_failed=false
130581$at_check_filter
130582echo stderr:; tee stderr <"$at_stderr"
130583at_fn_diff_devnull "$at_stdout" || at_failed=:
130584at_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"
130590at_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>&-
130593at_status=$? at_failed=false
130594$at_check_filter
130595echo stderr:; cat "$at_stderr"
130596at_fn_diff_devnull "$at_stdout" || at_failed=:
130597at_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"
130606at_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>&-
130609at_status=$? at_failed=false
130610$at_check_filter
130611echo stderr:; tee stderr <"$at_stderr"
130612at_fn_diff_devnull "$at_stdout" || at_failed=:
130613at_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"
130619at_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>&-
130622at_status=$? at_failed=false
130623$at_check_filter
130624echo stderr:; cat "$at_stderr"
130625at_fn_diff_devnull "$at_stdout" || at_failed=:
130626at_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:
130635cat >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%%
130659exp: WAIT_FOR_EOF exp | ;
130660%%
130661#include <stdio.h>
130662/* A C error reporting function.  */
130663static
130664void yyerror ( const char *msg)
130665{
130666  fprintf (stderr, "%s\n", msg);
130667}
130668#include <assert.h>
130669static int
130670yylex (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. */
130680static int
130681get_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
130694int
130695main (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
130719if 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"
130727at_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>&-
130731at_status=$? at_failed=false
130732$at_check_filter
130733echo stderr:; cat "$at_stderr"
130734echo stdout:; cat "$at_stdout"
130735at_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"
130741at_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>&-
130744at_status=$? at_failed=false
130745$at_check_filter
130746echo stderr:; cat "$at_stderr"
130747echo stdout:; cat "$at_stdout"
130748at_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"
130757at_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>&-
130762at_status=$? at_failed=false
130763$at_check_filter
130764at_fn_diff_devnull "$at_stderr" || at_failed=:
130765$at_diff expout "$at_stdout" || at_failed=:
130766at_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"
130775at_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>&-
130780at_status=$? at_failed=false
130781$at_check_filter
130782at_fn_diff_devnull "$at_stderr" || at_failed=:
130783$at_diff expout "$at_stdout" || at_failed=:
130784at_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
130790fi
130791{ set +x
130792$as_echo "$at_srcdir/torture.at:529: bison -o input.c input.y"
130793at_fn_check_prepare_trace "torture.at:529"
130794( $at_check_trace; bison -o input.c input.y
130795) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130796at_status=$? at_failed=false
130797$at_check_filter
130798at_fn_diff_devnull "$at_stderr" || at_failed=:
130799at_fn_diff_devnull "$at_stdout" || at_failed=:
130800at_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"
130807at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:529"
130808( $at_check_trace; $BISON_C_WORKS
130809) >>"$at_stdout" 2>>"$at_stderr" 5>&-
130810at_status=$? at_failed=false
130811$at_check_filter
130812echo stderr:; cat "$at_stderr"
130813echo stdout:; cat "$at_stdout"
130814at_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"
130820at_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>&-
130823at_status=$? at_failed=false
130824$at_check_filter
130825echo stderr:; cat "$at_stderr"
130826echo stdout:; cat "$at_stdout"
130827at_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"
130834at_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>&-
130837at_status=$? at_failed=false
130838$at_check_filter
130839echo stderr:; tee stderr <"$at_stderr"
130840at_fn_diff_devnull "$at_stdout" || at_failed=:
130841at_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"
130847at_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>&-
130850at_status=$? at_failed=false
130851$at_check_filter
130852echo stderr:; cat "$at_stderr"
130853at_fn_diff_devnull "$at_stdout" || at_failed=:
130854at_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"
130861at_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>&-
130864at_status=$? at_failed=false
130865$at_check_filter
130866echo stderr:; tee stderr <"$at_stderr"
130867at_fn_diff_devnull "$at_stdout" || at_failed=:
130868at_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"
130874at_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>&-
130877at_status=$? at_failed=false
130878$at_check_filter
130879echo stderr:; cat "$at_stderr"
130880at_fn_diff_devnull "$at_stdout" || at_failed=:
130881at_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"
130888at_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>&-
130891at_status=$? at_failed=false
130892$at_check_filter
130893echo stderr:; tee stderr <"$at_stderr"
130894at_fn_diff_devnull "$at_stdout" || at_failed=:
130895at_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"
130901at_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>&-
130904at_status=$? at_failed=false
130905$at_check_filter
130906echo stderr:; cat "$at_stderr"
130907at_fn_diff_devnull "$at_stdout" || at_failed=:
130908at_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
130919read at_status <"$at_status_file"
130920#AT_STOP_258
130921#AT_START_259
130922at_fn_group_banner 259 'existing.at:79' \
130923  "GNU AWK 3.1.0 Grammar: LALR(1)" "                 " 16
130924at_xfail=no
130925(
130926  $as_echo "259. $at_setup_line: testing $at_desc ..."
130927  $at_traceon
130928
130929
130930cat >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
130986start
130987	: opt_nls program opt_nls
130988	;
130989
130990program
130991	: rule
130992	| program rule
130993	| error
130994	| program error
130995	| /* empty */
130996	;
130997
130998rule
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
131009func_name
131010	: NAME
131011	| FUNC_CALL
131012	| lex_builtin
131013	;
131014
131015lex_builtin
131016	: LEX_BUILTIN
131017	| LEX_LENGTH
131018	;
131019
131020function_prologue
131021	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
131022	;
131023
131024function_body
131025	: l_brace statements r_brace opt_semi opt_nls
131026	| l_brace r_brace opt_semi opt_nls
131027	;
131028
131029pattern
131030	: exp
131031	| exp ',' exp
131032	;
131033
131034regexp
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
131042action
131043	: l_brace statements r_brace opt_semi opt_nls
131044	| l_brace r_brace opt_semi opt_nls
131045	;
131046
131047statements
131048	: statement
131049	| statements statement
131050	| error
131051	| statements error
131052	;
131053
131054statement_term
131055	: nls
131056	| semi opt_nls
131057	;
131058
131059statement
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
131082print
131083	: LEX_PRINT
131084	| LEX_PRINTF
131085	;
131086
131087if_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
131093nls
131094	: NEWLINE
131095	| nls NEWLINE
131096	;
131097
131098opt_nls
131099	: /* empty */
131100	| nls
131101	;
131102
131103input_redir
131104	: /* empty */
131105	| '<' simp_exp
131106	;
131107
131108output_redir
131109	: /* empty */
131110	| '>' exp
131111	| APPEND_OP exp
131112	| '|' exp
131113	| TWOWAYIO exp
131114	;
131115
131116opt_param_list
131117	: /* empty */
131118	| param_list
131119	;
131120
131121param_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 */
131130opt_exp
131131	: /* empty */
131132	| exp
131133	;
131134
131135opt_rexpression_list
131136	: /* empty */
131137	| rexpression_list
131138	;
131139
131140rexpression_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
131149opt_expression_list
131150	: /* empty */
131151	| expression_list
131152	;
131153
131154expression_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.  */
131164exp	: 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
131183rexp
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
131198simp_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
131211non_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
131228opt_variable
131229	: /* empty */
131230	| variable
131231	;
131232
131233variable
131234	: NAME
131235	| NAME '[' expression_list ']'
131236	| '$' non_post_simp_exp
131237	;
131238
131239l_brace
131240	: '{' opt_nls
131241	;
131242
131243r_brace
131244	: '}' opt_nls
131245	;
131246
131247r_paren
131248	: ')'
131249	;
131250
131251opt_semi
131252	: /* empty */
131253	| semi
131254	;
131255
131256semi
131257	: ';'
131258	;
131259
131260comma	: ',' opt_nls
131261	;
131262
131263
131264%%
131265#include <stdio.h>
131266/* A C error reporting function.  */
131267static
131268void yyerror ( const char *msg)
131269{
131270  fprintf (stderr, "%s\n", msg);
131271}
131272static int
131273yylex (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
131282int
131283main (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
131297if 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"
131305at_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>&-
131309at_status=$? at_failed=false
131310$at_check_filter
131311echo stderr:; cat "$at_stderr"
131312echo stdout:; cat "$at_stdout"
131313at_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"
131319at_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>&-
131322at_status=$? at_failed=false
131323$at_check_filter
131324echo stderr:; cat "$at_stderr"
131325echo stdout:; cat "$at_stdout"
131326at_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"
131335at_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>&-
131340at_status=$? at_failed=false
131341$at_check_filter
131342at_fn_diff_devnull "$at_stderr" || at_failed=:
131343$at_diff expout "$at_stdout" || at_failed=:
131344at_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"
131353at_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>&-
131358at_status=$? at_failed=false
131359$at_check_filter
131360at_fn_diff_devnull "$at_stderr" || at_failed=:
131361$at_diff expout "$at_stdout" || at_failed=:
131362at_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
131368fi
131369{ set +x
131370$as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y"
131371at_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>&-
131374at_status=$? at_failed=false
131375$at_check_filter
131376echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce
131377" | \
131378  $at_diff - "$at_stderr" || at_failed=:
131379at_fn_diff_devnull "$at_stdout" || at_failed=:
131380at_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"
131388at_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>&-
131391at_status=$? at_failed=false
131392$at_check_filter
131393at_fn_diff_devnull "$at_stderr" || at_failed=:
131394echo >>"$at_stdout"; $as_echo "319
131395" | \
131396  $at_diff - "$at_stdout" || at_failed=:
131397at_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"
131404at_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>&-
131407at_status=$? at_failed=false
131408$at_check_filter
131409at_fn_diff_devnull "$at_stderr" || at_failed=:
131410echo stdout:; cat "$at_stdout"
131411at_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"
131418at_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>&-
131421at_status=$? at_failed=false
131422$at_check_filter
131423at_fn_diff_devnull "$at_stderr" || at_failed=:
131424at_fn_diff_devnull "$at_stdout" || at_failed=:
131425at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
131426$at_failed && at_fn_log_failure
131427$at_traceon; }
131428
131429if 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"
131437at_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>&-
131441at_status=$? at_failed=false
131442$at_check_filter
131443echo stderr:; cat "$at_stderr"
131444echo stdout:; cat "$at_stdout"
131445at_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"
131451at_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>&-
131454at_status=$? at_failed=false
131455$at_check_filter
131456echo stderr:; cat "$at_stderr"
131457echo stdout:; cat "$at_stdout"
131458at_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"
131467at_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>&-
131472at_status=$? at_failed=false
131473$at_check_filter
131474at_fn_diff_devnull "$at_stderr" || at_failed=:
131475$at_diff expout "$at_stdout" || at_failed=:
131476at_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"
131485at_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>&-
131490at_status=$? at_failed=false
131491$at_check_filter
131492at_fn_diff_devnull "$at_stderr" || at_failed=:
131493$at_diff expout "$at_stdout" || at_failed=:
131494at_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
131500fi
131501{ set +x
131502$as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y"
131503at_fn_check_prepare_trace "existing.at:79"
131504( $at_check_trace; bison --report=all input-lalr.y
131505) >>"$at_stdout" 2>>"$at_stderr" 5>&-
131506at_status=$? at_failed=false
131507$at_check_filter
131508echo stderr:; cat "$at_stderr"
131509echo stdout:; cat "$at_stdout"
131510at_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/^ \$//'"
131518at_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>&-
131522at_status=$? at_failed=false
131523$at_check_filter
131524at_fn_diff_devnull "$at_stderr" || at_failed=:
131525at_fn_diff_devnull "$at_stdout" || at_failed=:
131526at_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"
131540at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
131541( $at_check_trace; $BISON_C_WORKS
131542) >>"$at_stdout" 2>>"$at_stderr" 5>&-
131543at_status=$? at_failed=false
131544$at_check_filter
131545echo stderr:; cat "$at_stderr"
131546echo stdout:; cat "$at_stdout"
131547at_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"
131553at_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>&-
131556at_status=$? at_failed=false
131557$at_check_filter
131558echo stderr:; cat "$at_stderr"
131559echo stdout:; cat "$at_stdout"
131560at_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"
131567at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
131568( $at_check_trace;  $PREPARSER ./input
131569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
131570at_status=$? at_failed=false
131571$at_check_filter
131572echo stderr:; tee stderr <"$at_stderr"
131573at_fn_diff_devnull "$at_stdout" || at_failed=:
131574at_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"
131580at_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>&-
131583at_status=$? at_failed=false
131584$at_check_filter
131585echo >>"$at_stderr"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';'
131586" | \
131587  $at_diff - "$at_stderr" || at_failed=:
131588at_fn_diff_devnull "$at_stdout" || at_failed=:
131589at_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
131599read at_status <"$at_status_file"
131600#AT_STOP_259
131601#AT_START_260
131602at_fn_group_banner 260 'existing.at:79' \
131603  "GNU AWK 3.1.0 Grammar: IELR(1)" "                 " 16
131604at_xfail=no
131605(
131606  $as_echo "260. $at_setup_line: testing $at_desc ..."
131607  $at_traceon
131608
131609
131610cat >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
131666start
131667	: opt_nls program opt_nls
131668	;
131669
131670program
131671	: rule
131672	| program rule
131673	| error
131674	| program error
131675	| /* empty */
131676	;
131677
131678rule
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
131689func_name
131690	: NAME
131691	| FUNC_CALL
131692	| lex_builtin
131693	;
131694
131695lex_builtin
131696	: LEX_BUILTIN
131697	| LEX_LENGTH
131698	;
131699
131700function_prologue
131701	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
131702	;
131703
131704function_body
131705	: l_brace statements r_brace opt_semi opt_nls
131706	| l_brace r_brace opt_semi opt_nls
131707	;
131708
131709pattern
131710	: exp
131711	| exp ',' exp
131712	;
131713
131714regexp
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
131722action
131723	: l_brace statements r_brace opt_semi opt_nls
131724	| l_brace r_brace opt_semi opt_nls
131725	;
131726
131727statements
131728	: statement
131729	| statements statement
131730	| error
131731	| statements error
131732	;
131733
131734statement_term
131735	: nls
131736	| semi opt_nls
131737	;
131738
131739statement
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
131762print
131763	: LEX_PRINT
131764	| LEX_PRINTF
131765	;
131766
131767if_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
131773nls
131774	: NEWLINE
131775	| nls NEWLINE
131776	;
131777
131778opt_nls
131779	: /* empty */
131780	| nls
131781	;
131782
131783input_redir
131784	: /* empty */
131785	| '<' simp_exp
131786	;
131787
131788output_redir
131789	: /* empty */
131790	| '>' exp
131791	| APPEND_OP exp
131792	| '|' exp
131793	| TWOWAYIO exp
131794	;
131795
131796opt_param_list
131797	: /* empty */
131798	| param_list
131799	;
131800
131801param_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 */
131810opt_exp
131811	: /* empty */
131812	| exp
131813	;
131814
131815opt_rexpression_list
131816	: /* empty */
131817	| rexpression_list
131818	;
131819
131820rexpression_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
131829opt_expression_list
131830	: /* empty */
131831	| expression_list
131832	;
131833
131834expression_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.  */
131844exp	: 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
131863rexp
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
131878simp_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
131891non_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
131908opt_variable
131909	: /* empty */
131910	| variable
131911	;
131912
131913variable
131914	: NAME
131915	| NAME '[' expression_list ']'
131916	| '$' non_post_simp_exp
131917	;
131918
131919l_brace
131920	: '{' opt_nls
131921	;
131922
131923r_brace
131924	: '}' opt_nls
131925	;
131926
131927r_paren
131928	: ')'
131929	;
131930
131931opt_semi
131932	: /* empty */
131933	| semi
131934	;
131935
131936semi
131937	: ';'
131938	;
131939
131940comma	: ',' opt_nls
131941	;
131942
131943
131944%%
131945#include <stdio.h>
131946/* A C error reporting function.  */
131947static
131948void yyerror ( const char *msg)
131949{
131950  fprintf (stderr, "%s\n", msg);
131951}
131952static int
131953yylex (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
131962int
131963main (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
131977if 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"
131985at_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>&-
131989at_status=$? at_failed=false
131990$at_check_filter
131991echo stderr:; cat "$at_stderr"
131992echo stdout:; cat "$at_stdout"
131993at_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"
131999at_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>&-
132002at_status=$? at_failed=false
132003$at_check_filter
132004echo stderr:; cat "$at_stderr"
132005echo stdout:; cat "$at_stdout"
132006at_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"
132015at_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>&-
132020at_status=$? at_failed=false
132021$at_check_filter
132022at_fn_diff_devnull "$at_stderr" || at_failed=:
132023$at_diff expout "$at_stdout" || at_failed=:
132024at_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"
132033at_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>&-
132038at_status=$? at_failed=false
132039$at_check_filter
132040at_fn_diff_devnull "$at_stderr" || at_failed=:
132041$at_diff expout "$at_stdout" || at_failed=:
132042at_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
132048fi
132049{ set +x
132050$as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y"
132051at_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>&-
132054at_status=$? at_failed=false
132055$at_check_filter
132056echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce
132057" | \
132058  $at_diff - "$at_stderr" || at_failed=:
132059at_fn_diff_devnull "$at_stdout" || at_failed=:
132060at_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"
132068at_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>&-
132071at_status=$? at_failed=false
132072$at_check_filter
132073at_fn_diff_devnull "$at_stderr" || at_failed=:
132074echo >>"$at_stdout"; $as_echo "328
132075" | \
132076  $at_diff - "$at_stdout" || at_failed=:
132077at_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"
132084at_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>&-
132087at_status=$? at_failed=false
132088$at_check_filter
132089at_fn_diff_devnull "$at_stderr" || at_failed=:
132090echo stdout:; cat "$at_stdout"
132091at_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"
132098at_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>&-
132101at_status=$? at_failed=false
132102$at_check_filter
132103at_fn_diff_devnull "$at_stderr" || at_failed=:
132104at_fn_diff_devnull "$at_stdout" || at_failed=:
132105at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
132106$at_failed && at_fn_log_failure
132107$at_traceon; }
132108
132109if 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"
132117at_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>&-
132121at_status=$? at_failed=false
132122$at_check_filter
132123echo stderr:; cat "$at_stderr"
132124echo stdout:; cat "$at_stdout"
132125at_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"
132131at_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>&-
132134at_status=$? at_failed=false
132135$at_check_filter
132136echo stderr:; cat "$at_stderr"
132137echo stdout:; cat "$at_stdout"
132138at_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"
132147at_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>&-
132152at_status=$? at_failed=false
132153$at_check_filter
132154at_fn_diff_devnull "$at_stderr" || at_failed=:
132155$at_diff expout "$at_stdout" || at_failed=:
132156at_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"
132165at_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>&-
132170at_status=$? at_failed=false
132171$at_check_filter
132172at_fn_diff_devnull "$at_stderr" || at_failed=:
132173$at_diff expout "$at_stdout" || at_failed=:
132174at_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
132180fi
132181{ set +x
132182$as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y"
132183at_fn_check_prepare_trace "existing.at:79"
132184( $at_check_trace; bison --report=all input-lalr.y
132185) >>"$at_stdout" 2>>"$at_stderr" 5>&-
132186at_status=$? at_failed=false
132187$at_check_filter
132188echo stderr:; cat "$at_stderr"
132189echo stdout:; cat "$at_stdout"
132190at_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/^ \$//'"
132198at_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>&-
132202at_status=$? at_failed=false
132203$at_check_filter
132204at_fn_diff_devnull "$at_stderr" || at_failed=:
132205echo >>"$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=:
132518at_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"
132532at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
132533( $at_check_trace; $BISON_C_WORKS
132534) >>"$at_stdout" 2>>"$at_stderr" 5>&-
132535at_status=$? at_failed=false
132536$at_check_filter
132537echo stderr:; cat "$at_stderr"
132538echo stdout:; cat "$at_stdout"
132539at_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"
132545at_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>&-
132548at_status=$? at_failed=false
132549$at_check_filter
132550echo stderr:; cat "$at_stderr"
132551echo stdout:; cat "$at_stdout"
132552at_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"
132559at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
132560( $at_check_trace;  $PREPARSER ./input
132561) >>"$at_stdout" 2>>"$at_stderr" 5>&-
132562at_status=$? at_failed=false
132563$at_check_filter
132564echo stderr:; tee stderr <"$at_stderr"
132565at_fn_diff_devnull "$at_stdout" || at_failed=:
132566at_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"
132572at_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>&-
132575at_status=$? at_failed=false
132576$at_check_filter
132577at_fn_diff_devnull "$at_stderr" || at_failed=:
132578at_fn_diff_devnull "$at_stdout" || at_failed=:
132579at_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
132589read at_status <"$at_status_file"
132590#AT_STOP_260
132591#AT_START_261
132592at_fn_group_banner 261 'existing.at:79' \
132593  "GNU AWK 3.1.0 Grammar: Canonical LR(1)" "         " 16
132594at_xfail=no
132595(
132596  $as_echo "261. $at_setup_line: testing $at_desc ..."
132597  $at_traceon
132598
132599
132600cat >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
132656start
132657	: opt_nls program opt_nls
132658	;
132659
132660program
132661	: rule
132662	| program rule
132663	| error
132664	| program error
132665	| /* empty */
132666	;
132667
132668rule
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
132679func_name
132680	: NAME
132681	| FUNC_CALL
132682	| lex_builtin
132683	;
132684
132685lex_builtin
132686	: LEX_BUILTIN
132687	| LEX_LENGTH
132688	;
132689
132690function_prologue
132691	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
132692	;
132693
132694function_body
132695	: l_brace statements r_brace opt_semi opt_nls
132696	| l_brace r_brace opt_semi opt_nls
132697	;
132698
132699pattern
132700	: exp
132701	| exp ',' exp
132702	;
132703
132704regexp
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
132712action
132713	: l_brace statements r_brace opt_semi opt_nls
132714	| l_brace r_brace opt_semi opt_nls
132715	;
132716
132717statements
132718	: statement
132719	| statements statement
132720	| error
132721	| statements error
132722	;
132723
132724statement_term
132725	: nls
132726	| semi opt_nls
132727	;
132728
132729statement
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
132752print
132753	: LEX_PRINT
132754	| LEX_PRINTF
132755	;
132756
132757if_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
132763nls
132764	: NEWLINE
132765	| nls NEWLINE
132766	;
132767
132768opt_nls
132769	: /* empty */
132770	| nls
132771	;
132772
132773input_redir
132774	: /* empty */
132775	| '<' simp_exp
132776	;
132777
132778output_redir
132779	: /* empty */
132780	| '>' exp
132781	| APPEND_OP exp
132782	| '|' exp
132783	| TWOWAYIO exp
132784	;
132785
132786opt_param_list
132787	: /* empty */
132788	| param_list
132789	;
132790
132791param_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 */
132800opt_exp
132801	: /* empty */
132802	| exp
132803	;
132804
132805opt_rexpression_list
132806	: /* empty */
132807	| rexpression_list
132808	;
132809
132810rexpression_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
132819opt_expression_list
132820	: /* empty */
132821	| expression_list
132822	;
132823
132824expression_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.  */
132834exp	: 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
132853rexp
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
132868simp_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
132881non_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
132898opt_variable
132899	: /* empty */
132900	| variable
132901	;
132902
132903variable
132904	: NAME
132905	| NAME '[' expression_list ']'
132906	| '$' non_post_simp_exp
132907	;
132908
132909l_brace
132910	: '{' opt_nls
132911	;
132912
132913r_brace
132914	: '}' opt_nls
132915	;
132916
132917r_paren
132918	: ')'
132919	;
132920
132921opt_semi
132922	: /* empty */
132923	| semi
132924	;
132925
132926semi
132927	: ';'
132928	;
132929
132930comma	: ',' opt_nls
132931	;
132932
132933
132934%%
132935#include <stdio.h>
132936/* A C error reporting function.  */
132937static
132938void yyerror ( const char *msg)
132939{
132940  fprintf (stderr, "%s\n", msg);
132941}
132942static int
132943yylex (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
132952int
132953main (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"
132969at_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>&-
132972at_status=$? at_failed=false
132973$at_check_filter
132974echo >>"$at_stderr"; $as_echo "input.y: conflicts: 265 shift/reduce
132975" | \
132976  $at_diff - "$at_stderr" || at_failed=:
132977at_fn_diff_devnull "$at_stdout" || at_failed=:
132978at_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"
132986at_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>&-
132989at_status=$? at_failed=false
132990$at_check_filter
132991at_fn_diff_devnull "$at_stderr" || at_failed=:
132992echo >>"$at_stdout"; $as_echo "2358
132993" | \
132994  $at_diff - "$at_stdout" || at_failed=:
132995at_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.
133008if test 32767 -lt `wc -l < input.c`; then
133009  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
133010  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
133011fi
133012{ set +x
133013$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
133014at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
133015( $at_check_trace; $BISON_C_WORKS
133016) >>"$at_stdout" 2>>"$at_stderr" 5>&-
133017at_status=$? at_failed=false
133018$at_check_filter
133019echo stderr:; cat "$at_stderr"
133020echo stdout:; cat "$at_stdout"
133021at_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"
133027at_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>&-
133030at_status=$? at_failed=false
133031$at_check_filter
133032echo stderr:; cat "$at_stderr"
133033echo stdout:; cat "$at_stdout"
133034at_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"
133041at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
133042( $at_check_trace;  $PREPARSER ./input
133043) >>"$at_stdout" 2>>"$at_stderr" 5>&-
133044at_status=$? at_failed=false
133045$at_check_filter
133046echo stderr:; tee stderr <"$at_stderr"
133047at_fn_diff_devnull "$at_stdout" || at_failed=:
133048at_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"
133054at_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>&-
133057at_status=$? at_failed=false
133058$at_check_filter
133059at_fn_diff_devnull "$at_stderr" || at_failed=:
133060at_fn_diff_devnull "$at_stdout" || at_failed=:
133061at_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
133071read at_status <"$at_status_file"
133072#AT_STOP_261
133073#AT_START_262
133074at_fn_group_banner 262 'existing.at:783' \
133075  "GNU Cim Grammar: LALR(1)" "                       " 16
133076at_xfail=no
133077(
133078  $as_echo "262. $at_setup_line: testing $at_desc ..."
133079  $at_traceon
133080
133081
133082cat >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 */
133164MAIN_MODULE     :       {}
133165			MODULS
133166		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
133167		;
133168EXT_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		;
133186EXTERNAL_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		;
133199MBEE_REST_EXT_LIST:	/* EMPTY
133200		|	HPAREXPSEPARATOR EXT_KIND_LIST
133201		;
133202EXT_KIND_LIST	:	EXT_KIND_ITEM
133203		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
133204		;
133205EXT_KIND_ITEM	:	HIDENTIFIER
133206			EXT_IDENT
133207				{}*/
133208		;
133209EMPTY_BLOCK	:	/*EMPT*/
133210		|	HBEGIN HEND
133211		;
133212EXT_LIST	:	EXT_ITEM
133213		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
133214		;
133215EXT_ITEM	:	HIDENTIFIER
133216			EXT_IDENT
133217		;
133218EXT_IDENT	:	/* EMPTY */
133219		|	HVALRELOPERATOR {}
133220			HTEXTKONST
133221		;
133222/* GRAMATIKK FOR TYPER */
133223NO_TYPE         :       /*EMPT*/
133224		;
133225MBEE_TYPE       :       NO_TYPE
133226		|       TYPE
133227		;
133228TYPE            :       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 */
133242MBEE_ELSE_PART  :       /*EMPT*/
133243/*		|	HELSE
133244			HIF
133245			EXPRESSION
133246			HTHEN   {}
133247			BLOCK   {}
133248			MBEE_ELSE_PART          {}*/
133249		|       HELSE   {}
133250			BLOCK
133251		;
133252FOR_LIST        :       FOR_LIST_ELEMENT
133253		|       FOR_LIST_ELEMENT
133254			HPAREXPSEPARATOR
133255			FOR_LIST
133256		;
133257FOR_LIST_ELEMENT:       EXPRESSION
133258			MBEE_F_L_EL_R_PT
133259		;
133260MBEE_F_L_EL_R_PT:       /*EMPT*/
133261		|       HWHILE
133262			EXPRESSION
133263		|       HSTEP
133264			EXPRESSION
133265			HUNTIL
133266			EXPRESSION
133267		;
133268GOTO            :       HGO
133269			HTO
133270		|       HGOTO
133271		;
133272CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
133273		|       HDO   {}
133274			BLOCK
133275		;
133276WHEN_CLAUSE_LIST:       HWHEN
133277			HIDENTIFIER
133278			HDO    {}
133279			BLOCK
133280		|       WHEN_CLAUSE_LIST
133281			HWHEN
133282			HIDENTIFIER
133283			HDO    {}
133284			BLOCK
133285		;
133286MBEE_OTWI_CLAUS :       /*EMPT*/
133287		|       HOTHERWISE {}
133288
133289			BLOCK
133290		;
133291ACTIVATOR	:	HACTIVATE
133292		|	HREACTIVATE
133293		;
133294SCHEDULE	:	/*EMPT*/
133295		|	ATDELAY EXPRESSION	{}
133296			PRIOR
133297		|	BEFOREAFTER		{}
133298			EXPRESSION
133299		;
133300ATDELAY		:	HAT
133301		|	HDELAY
133302		;
133303BEFOREAFTER	:	HBEFORE
133304		|	HAFTER
133305		;
133306PRIOR		:	/*EMPT*/
133307		|	HPRIOR
133308		;
133309/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
133310MODULSTATEMENT  :       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		;
133375IMPORT_SPEC_MODULE:
133376		;
133377DECLSTATEMENT	:	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		;
133395BLOCK           :       DECLSTATEMENT
133396		|       HBEGIN MBEE_DECLSTMS HEND
133397		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
133398		|	HBEGIN error HEND
133399		;
133400MBEE_DECLSTMS   :       MBEE_DECLSTMSU
133401		;
133402MBEE_DECLSTMSU  :       DECLSTATEMENT
133403		|       MBEE_DECLSTMSU
133404			HSTATEMENTSEPARATOR
133405			DECLSTATEMENT
133406		;
133407MODULS		:	MODULSTATEMENT
133408		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
133409		;
133410/* GRAMATIKK FOR DEL AV DEKLARASJONER */
133411ARR_SEGMENT_LIST:       ARR_SEGMENT
133412		|       ARR_SEGMENT_LIST
133413			HPAREXPSEPARATOR
133414			ARR_SEGMENT
133415		;
133416ARR_SEGMENT	:       ARRAY_SEGMENT
133417			HBEGPAR
133418			BAUND_PAIR_LIST HENDPAR
133419		;
133420ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
133421
133422		|       ARRAY_SEGMENT_EL
133423			HPAREXPSEPARATOR
133424			ARRAY_SEGMENT
133425		;
133426ARRAY_SEGMENT_EL:       HIDENTIFIER
133427		;
133428BAUND_PAIR_LIST :       BAUND_PAIR
133429		|       BAUND_PAIR
133430			HPAREXPSEPARATOR
133431			BAUND_PAIR_LIST
133432		;
133433BAUND_PAIR      :       EXPRESSION
133434			HLABELSEPARATOR
133435			EXPRESSION
133436		;
133437SWITCH_LIST     :       EXPRESSION
133438		|       EXPRESSION
133439			HPAREXPSEPARATOR
133440			SWITCH_LIST
133441		;
133442HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
133443			MBEE_MODE_PART  {}
133444			MBEE_SPEC_PART  {}
133445			MBEE_PROT_PART  {}
133446			MBEE_VIRT_PART
133447		;
133448MBEE_FMAL_PAR_P :       /*EMPT*/
133449		|       FMAL_PAR_PART
133450		;
133451FMAL_PAR_PART   :       HBEGPAR NO_TYPE
133452			MBEE_LISTV HENDPAR
133453		;
133454MBEE_LISTV      :       /*EMPT*/
133455		|       LISTV
133456		;
133457LISTV           :       HIDENTIFIER
133458		|	FPP_CATEG HDOTDOTDOT
133459		|       HIDENTIFIER     {}
133460			HPAREXPSEPARATOR LISTV
133461		|       FPP_SPEC
133462		|       FPP_SPEC
133463			HPAREXPSEPARATOR LISTV
133464		;
133465FPP_HEADING     :       HBEGPAR NO_TYPE
133466			FPP_MBEE_LISTV HENDPAR
133467		;
133468FPP_MBEE_LISTV  :       /*EMPT*/
133469		|       FPP_LISTV
133470		;
133471FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
133472		|       FPP_SPEC
133473		|       FPP_SPEC
133474			HPAREXPSEPARATOR LISTV
133475		;
133476FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
133477		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
133478		;
133479FPP_CATEG       :       HNAME HLABELSEPARATOR
133480		|       HVALUE HLABELSEPARATOR
133481		|       HVAR HLABELSEPARATOR
133482		|       /*EMPT*/
133483		;
133484FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
133485			HIDENTIFIER
133486					{}
133487			FPP_HEADING {} { /* Yes, two "final" actions. */ }
133488		;
133489IDENTIFIER_LISTV:       HIDENTIFIER
133490		|	HDOTDOTDOT
133491		|       HIDENTIFIER     {}
133492			HPAREXPSEPARATOR IDENTIFIER_LISTV
133493		;
133494MBEE_MODE_PART  :       /*EMPT*/
133495		|       MODE_PART
133496		;
133497MODE_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		;
133513NAME_PART       :       HNAME           {}
133514			IDENTIFIER_LISTV
133515			HSTATEMENTSEPARATOR
133516		;
133517VAR_PART        :       HVAR            {}
133518			IDENTIFIER_LISTV
133519			HSTATEMENTSEPARATOR
133520		;
133521VALUE_PART      :       HVALUE          {}
133522			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
133523		;
133524MBEE_SPEC_PART  :       /*EMPT*/
133525		|       SPEC_PART
133526		;
133527SPEC_PART       :       ONE_SPEC
133528		|       SPEC_PART ONE_SPEC
133529		;
133530ONE_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		;
133539SPECIFIER       :       TYPE
133540		|       MBEE_TYPE
133541			HARRAY
133542		|       HLABEL
133543		|       HSWITCH
133544		;
133545PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
133546			HIDENTIFIER
133547					{}
133548			HEADING
133549					{}
133550			MBEE_BEGIN_END
133551		;
133552MBEE_BEGIN_END	:	/* EMPTY */
133553		|	HBEGIN HEND
133554		;
133555MBEE_PROT_PART  :       /*EMPT*/
133556		|       PROTECTION_PART
133557		;
133558PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
133559			HSTATEMENTSEPARATOR
133560		|       PROTECTION_PART  PROT_SPECIFIER
133561			IDENTIFIER_LIST HSTATEMENTSEPARATOR
133562		;
133563PROT_SPECIFIER  :       HHIDDEN
133564		|       HPROTECTED
133565		|       HHIDDEN
133566			HPROTECTED
133567		|       HPROTECTED
133568			HHIDDEN
133569		;
133570MBEE_VIRT_PART  :       /*EMPT*/
133571		|       VIRTUAL_PART
133572		;
133573VIRTUAL_PART    :       HVIRTUAL
133574			HLABELSEPARATOR
133575			MBEE_SPEC_PART
133576		;
133577IDENTIFIER_LIST :       HIDENTIFIER
133578		|       IDENTIFIER_LIST HPAREXPSEPARATOR
133579			HIDENTIFIER
133580		;
133581IDENTIFIER_LISTC:       HIDENTIFIER
133582			MBEE_CONSTANT
133583		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
133584			HIDENTIFIER
133585			MBEE_CONSTANT
133586		;
133587MBEE_CONSTANT	:	/* EMPTY */
133588		|	HVALRELOPERATOR
133589				{}
133590			EXPRESSION
133591		;
133592
133593/* GRAMATIKK FOR UTTRYKK */
133594EXPRESSION      :       EXPRESSION_SIMP
133595		|       HIF
133596			EXPRESSION
133597			HTHEN
133598			EXPRESSION
133599			HELSE
133600			EXPRESSION
133601		;
133602EXPRESSION_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		;
133668ARG_R_PT        :       /*EMPTY*/
133669		|       HBEGPAR
133670			ARGUMENT_LIST HENDPAR
133671		;
133672MBEE_ARG_R_PT   :       /*EMPTY*/
133673		|       HBEGPAR
133674			ARGUMENT_LIST HENDPAR
133675		;
133676ARGUMENT_LIST   :       EXPRESSION
133677		|       EXPRESSION
133678			HPAREXPSEPARATOR
133679			ARGUMENT_LIST
133680		;
133681
133682
133683%%
133684#include <stdio.h>
133685/* A C error reporting function.  */
133686static
133687void yyerror ( const char *msg)
133688{
133689  fprintf (stderr, "%s\n", msg);
133690}
133691static int
133692yylex (void)
133693{
133694  static int const input[] = {
133695    0
133696  };
133697  static int const *inputp = input;
133698  return *inputp++;
133699}
133700
133701int
133702main (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
133716if 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"
133724at_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>&-
133728at_status=$? at_failed=false
133729$at_check_filter
133730echo stderr:; cat "$at_stderr"
133731echo stdout:; cat "$at_stdout"
133732at_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"
133738at_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>&-
133741at_status=$? at_failed=false
133742$at_check_filter
133743echo stderr:; cat "$at_stderr"
133744echo stdout:; cat "$at_stdout"
133745at_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"
133754at_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>&-
133759at_status=$? at_failed=false
133760$at_check_filter
133761at_fn_diff_devnull "$at_stderr" || at_failed=:
133762$at_diff expout "$at_stdout" || at_failed=:
133763at_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"
133772at_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>&-
133777at_status=$? at_failed=false
133778$at_check_filter
133779at_fn_diff_devnull "$at_stderr" || at_failed=:
133780$at_diff expout "$at_stdout" || at_failed=:
133781at_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
133787fi
133788{ set +x
133789$as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y"
133790at_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>&-
133793at_status=$? at_failed=false
133794$at_check_filter
133795echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
133796" | \
133797  $at_diff - "$at_stderr" || at_failed=:
133798at_fn_diff_devnull "$at_stdout" || at_failed=:
133799at_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"
133807at_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>&-
133810at_status=$? at_failed=false
133811$at_check_filter
133812at_fn_diff_devnull "$at_stderr" || at_failed=:
133813echo >>"$at_stdout"; $as_echo "442
133814" | \
133815  $at_diff - "$at_stdout" || at_failed=:
133816at_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"
133823at_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>&-
133826at_status=$? at_failed=false
133827$at_check_filter
133828at_fn_diff_devnull "$at_stderr" || at_failed=:
133829echo stdout:; cat "$at_stdout"
133830at_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"
133837at_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>&-
133840at_status=$? at_failed=false
133841$at_check_filter
133842at_fn_diff_devnull "$at_stderr" || at_failed=:
133843at_fn_diff_devnull "$at_stdout" || at_failed=:
133844at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
133845$at_failed && at_fn_log_failure
133846$at_traceon; }
133847
133848if 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"
133856at_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>&-
133860at_status=$? at_failed=false
133861$at_check_filter
133862echo stderr:; cat "$at_stderr"
133863echo stdout:; cat "$at_stdout"
133864at_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"
133870at_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>&-
133873at_status=$? at_failed=false
133874$at_check_filter
133875echo stderr:; cat "$at_stderr"
133876echo stdout:; cat "$at_stdout"
133877at_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"
133886at_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>&-
133891at_status=$? at_failed=false
133892$at_check_filter
133893at_fn_diff_devnull "$at_stderr" || at_failed=:
133894$at_diff expout "$at_stdout" || at_failed=:
133895at_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"
133904at_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>&-
133909at_status=$? at_failed=false
133910$at_check_filter
133911at_fn_diff_devnull "$at_stderr" || at_failed=:
133912$at_diff expout "$at_stdout" || at_failed=:
133913at_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
133919fi
133920{ set +x
133921$as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y"
133922at_fn_check_prepare_trace "existing.at:783"
133923( $at_check_trace; bison --report=all input-lalr.y
133924) >>"$at_stdout" 2>>"$at_stderr" 5>&-
133925at_status=$? at_failed=false
133926$at_check_filter
133927echo stderr:; cat "$at_stderr"
133928echo stdout:; cat "$at_stdout"
133929at_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/^ \$//'"
133937at_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>&-
133941at_status=$? at_failed=false
133942$at_check_filter
133943at_fn_diff_devnull "$at_stderr" || at_failed=:
133944at_fn_diff_devnull "$at_stdout" || at_failed=:
133945at_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"
133950at_fn_check_prepare_trace "existing.at:783"
133951( $at_check_trace; grep '^State.*conflicts:' input.output
133952) >>"$at_stdout" 2>>"$at_stderr" 5>&-
133953at_status=$? at_failed=false
133954$at_check_filter
133955at_fn_diff_devnull "$at_stderr" || at_failed=:
133956echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce
133957State 164 conflicts: 1 shift/reduce
133958State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
133959State 206 conflicts: 1 shift/reduce
133960State 240 conflicts: 1 shift/reduce
133961State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
133962State 356 conflicts: 1 shift/reduce
133963State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
133964State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
133965" | \
133966  $at_diff - "$at_stdout" || at_failed=:
133967at_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"
133981at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
133982( $at_check_trace; $BISON_C_WORKS
133983) >>"$at_stdout" 2>>"$at_stderr" 5>&-
133984at_status=$? at_failed=false
133985$at_check_filter
133986echo stderr:; cat "$at_stderr"
133987echo stdout:; cat "$at_stdout"
133988at_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"
133994at_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>&-
133997at_status=$? at_failed=false
133998$at_check_filter
133999echo stderr:; cat "$at_stderr"
134000echo stdout:; cat "$at_stdout"
134001at_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"
134008at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
134009( $at_check_trace;  $PREPARSER ./input
134010) >>"$at_stdout" 2>>"$at_stderr" 5>&-
134011at_status=$? at_failed=false
134012$at_check_filter
134013echo stderr:; tee stderr <"$at_stderr"
134014at_fn_diff_devnull "$at_stdout" || at_failed=:
134015at_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"
134021at_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>&-
134024at_status=$? at_failed=false
134025$at_check_filter
134026at_fn_diff_devnull "$at_stderr" || at_failed=:
134027at_fn_diff_devnull "$at_stdout" || at_failed=:
134028at_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
134038read at_status <"$at_status_file"
134039#AT_STOP_262
134040#AT_START_263
134041at_fn_group_banner 263 'existing.at:783' \
134042  "GNU Cim Grammar: IELR(1)" "                       " 16
134043at_xfail=no
134044(
134045  $as_echo "263. $at_setup_line: testing $at_desc ..."
134046  $at_traceon
134047
134048
134049cat >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 */
134131MAIN_MODULE     :       {}
134132			MODULS
134133		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
134134		;
134135EXT_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		;
134153EXTERNAL_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		;
134166MBEE_REST_EXT_LIST:	/* EMPTY
134167		|	HPAREXPSEPARATOR EXT_KIND_LIST
134168		;
134169EXT_KIND_LIST	:	EXT_KIND_ITEM
134170		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
134171		;
134172EXT_KIND_ITEM	:	HIDENTIFIER
134173			EXT_IDENT
134174				{}*/
134175		;
134176EMPTY_BLOCK	:	/*EMPT*/
134177		|	HBEGIN HEND
134178		;
134179EXT_LIST	:	EXT_ITEM
134180		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
134181		;
134182EXT_ITEM	:	HIDENTIFIER
134183			EXT_IDENT
134184		;
134185EXT_IDENT	:	/* EMPTY */
134186		|	HVALRELOPERATOR {}
134187			HTEXTKONST
134188		;
134189/* GRAMATIKK FOR TYPER */
134190NO_TYPE         :       /*EMPT*/
134191		;
134192MBEE_TYPE       :       NO_TYPE
134193		|       TYPE
134194		;
134195TYPE            :       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 */
134209MBEE_ELSE_PART  :       /*EMPT*/
134210/*		|	HELSE
134211			HIF
134212			EXPRESSION
134213			HTHEN   {}
134214			BLOCK   {}
134215			MBEE_ELSE_PART          {}*/
134216		|       HELSE   {}
134217			BLOCK
134218		;
134219FOR_LIST        :       FOR_LIST_ELEMENT
134220		|       FOR_LIST_ELEMENT
134221			HPAREXPSEPARATOR
134222			FOR_LIST
134223		;
134224FOR_LIST_ELEMENT:       EXPRESSION
134225			MBEE_F_L_EL_R_PT
134226		;
134227MBEE_F_L_EL_R_PT:       /*EMPT*/
134228		|       HWHILE
134229			EXPRESSION
134230		|       HSTEP
134231			EXPRESSION
134232			HUNTIL
134233			EXPRESSION
134234		;
134235GOTO            :       HGO
134236			HTO
134237		|       HGOTO
134238		;
134239CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
134240		|       HDO   {}
134241			BLOCK
134242		;
134243WHEN_CLAUSE_LIST:       HWHEN
134244			HIDENTIFIER
134245			HDO    {}
134246			BLOCK
134247		|       WHEN_CLAUSE_LIST
134248			HWHEN
134249			HIDENTIFIER
134250			HDO    {}
134251			BLOCK
134252		;
134253MBEE_OTWI_CLAUS :       /*EMPT*/
134254		|       HOTHERWISE {}
134255
134256			BLOCK
134257		;
134258ACTIVATOR	:	HACTIVATE
134259		|	HREACTIVATE
134260		;
134261SCHEDULE	:	/*EMPT*/
134262		|	ATDELAY EXPRESSION	{}
134263			PRIOR
134264		|	BEFOREAFTER		{}
134265			EXPRESSION
134266		;
134267ATDELAY		:	HAT
134268		|	HDELAY
134269		;
134270BEFOREAFTER	:	HBEFORE
134271		|	HAFTER
134272		;
134273PRIOR		:	/*EMPT*/
134274		|	HPRIOR
134275		;
134276/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
134277MODULSTATEMENT  :       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		;
134342IMPORT_SPEC_MODULE:
134343		;
134344DECLSTATEMENT	:	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		;
134362BLOCK           :       DECLSTATEMENT
134363		|       HBEGIN MBEE_DECLSTMS HEND
134364		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
134365		|	HBEGIN error HEND
134366		;
134367MBEE_DECLSTMS   :       MBEE_DECLSTMSU
134368		;
134369MBEE_DECLSTMSU  :       DECLSTATEMENT
134370		|       MBEE_DECLSTMSU
134371			HSTATEMENTSEPARATOR
134372			DECLSTATEMENT
134373		;
134374MODULS		:	MODULSTATEMENT
134375		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
134376		;
134377/* GRAMATIKK FOR DEL AV DEKLARASJONER */
134378ARR_SEGMENT_LIST:       ARR_SEGMENT
134379		|       ARR_SEGMENT_LIST
134380			HPAREXPSEPARATOR
134381			ARR_SEGMENT
134382		;
134383ARR_SEGMENT	:       ARRAY_SEGMENT
134384			HBEGPAR
134385			BAUND_PAIR_LIST HENDPAR
134386		;
134387ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
134388
134389		|       ARRAY_SEGMENT_EL
134390			HPAREXPSEPARATOR
134391			ARRAY_SEGMENT
134392		;
134393ARRAY_SEGMENT_EL:       HIDENTIFIER
134394		;
134395BAUND_PAIR_LIST :       BAUND_PAIR
134396		|       BAUND_PAIR
134397			HPAREXPSEPARATOR
134398			BAUND_PAIR_LIST
134399		;
134400BAUND_PAIR      :       EXPRESSION
134401			HLABELSEPARATOR
134402			EXPRESSION
134403		;
134404SWITCH_LIST     :       EXPRESSION
134405		|       EXPRESSION
134406			HPAREXPSEPARATOR
134407			SWITCH_LIST
134408		;
134409HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
134410			MBEE_MODE_PART  {}
134411			MBEE_SPEC_PART  {}
134412			MBEE_PROT_PART  {}
134413			MBEE_VIRT_PART
134414		;
134415MBEE_FMAL_PAR_P :       /*EMPT*/
134416		|       FMAL_PAR_PART
134417		;
134418FMAL_PAR_PART   :       HBEGPAR NO_TYPE
134419			MBEE_LISTV HENDPAR
134420		;
134421MBEE_LISTV      :       /*EMPT*/
134422		|       LISTV
134423		;
134424LISTV           :       HIDENTIFIER
134425		|	FPP_CATEG HDOTDOTDOT
134426		|       HIDENTIFIER     {}
134427			HPAREXPSEPARATOR LISTV
134428		|       FPP_SPEC
134429		|       FPP_SPEC
134430			HPAREXPSEPARATOR LISTV
134431		;
134432FPP_HEADING     :       HBEGPAR NO_TYPE
134433			FPP_MBEE_LISTV HENDPAR
134434		;
134435FPP_MBEE_LISTV  :       /*EMPT*/
134436		|       FPP_LISTV
134437		;
134438FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
134439		|       FPP_SPEC
134440		|       FPP_SPEC
134441			HPAREXPSEPARATOR LISTV
134442		;
134443FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
134444		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
134445		;
134446FPP_CATEG       :       HNAME HLABELSEPARATOR
134447		|       HVALUE HLABELSEPARATOR
134448		|       HVAR HLABELSEPARATOR
134449		|       /*EMPT*/
134450		;
134451FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
134452			HIDENTIFIER
134453					{}
134454			FPP_HEADING {} { /* Yes, two "final" actions. */ }
134455		;
134456IDENTIFIER_LISTV:       HIDENTIFIER
134457		|	HDOTDOTDOT
134458		|       HIDENTIFIER     {}
134459			HPAREXPSEPARATOR IDENTIFIER_LISTV
134460		;
134461MBEE_MODE_PART  :       /*EMPT*/
134462		|       MODE_PART
134463		;
134464MODE_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		;
134480NAME_PART       :       HNAME           {}
134481			IDENTIFIER_LISTV
134482			HSTATEMENTSEPARATOR
134483		;
134484VAR_PART        :       HVAR            {}
134485			IDENTIFIER_LISTV
134486			HSTATEMENTSEPARATOR
134487		;
134488VALUE_PART      :       HVALUE          {}
134489			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
134490		;
134491MBEE_SPEC_PART  :       /*EMPT*/
134492		|       SPEC_PART
134493		;
134494SPEC_PART       :       ONE_SPEC
134495		|       SPEC_PART ONE_SPEC
134496		;
134497ONE_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		;
134506SPECIFIER       :       TYPE
134507		|       MBEE_TYPE
134508			HARRAY
134509		|       HLABEL
134510		|       HSWITCH
134511		;
134512PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
134513			HIDENTIFIER
134514					{}
134515			HEADING
134516					{}
134517			MBEE_BEGIN_END
134518		;
134519MBEE_BEGIN_END	:	/* EMPTY */
134520		|	HBEGIN HEND
134521		;
134522MBEE_PROT_PART  :       /*EMPT*/
134523		|       PROTECTION_PART
134524		;
134525PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
134526			HSTATEMENTSEPARATOR
134527		|       PROTECTION_PART  PROT_SPECIFIER
134528			IDENTIFIER_LIST HSTATEMENTSEPARATOR
134529		;
134530PROT_SPECIFIER  :       HHIDDEN
134531		|       HPROTECTED
134532		|       HHIDDEN
134533			HPROTECTED
134534		|       HPROTECTED
134535			HHIDDEN
134536		;
134537MBEE_VIRT_PART  :       /*EMPT*/
134538		|       VIRTUAL_PART
134539		;
134540VIRTUAL_PART    :       HVIRTUAL
134541			HLABELSEPARATOR
134542			MBEE_SPEC_PART
134543		;
134544IDENTIFIER_LIST :       HIDENTIFIER
134545		|       IDENTIFIER_LIST HPAREXPSEPARATOR
134546			HIDENTIFIER
134547		;
134548IDENTIFIER_LISTC:       HIDENTIFIER
134549			MBEE_CONSTANT
134550		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
134551			HIDENTIFIER
134552			MBEE_CONSTANT
134553		;
134554MBEE_CONSTANT	:	/* EMPTY */
134555		|	HVALRELOPERATOR
134556				{}
134557			EXPRESSION
134558		;
134559
134560/* GRAMATIKK FOR UTTRYKK */
134561EXPRESSION      :       EXPRESSION_SIMP
134562		|       HIF
134563			EXPRESSION
134564			HTHEN
134565			EXPRESSION
134566			HELSE
134567			EXPRESSION
134568		;
134569EXPRESSION_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		;
134635ARG_R_PT        :       /*EMPTY*/
134636		|       HBEGPAR
134637			ARGUMENT_LIST HENDPAR
134638		;
134639MBEE_ARG_R_PT   :       /*EMPTY*/
134640		|       HBEGPAR
134641			ARGUMENT_LIST HENDPAR
134642		;
134643ARGUMENT_LIST   :       EXPRESSION
134644		|       EXPRESSION
134645			HPAREXPSEPARATOR
134646			ARGUMENT_LIST
134647		;
134648
134649
134650%%
134651#include <stdio.h>
134652/* A C error reporting function.  */
134653static
134654void yyerror ( const char *msg)
134655{
134656  fprintf (stderr, "%s\n", msg);
134657}
134658static int
134659yylex (void)
134660{
134661  static int const input[] = {
134662    0
134663  };
134664  static int const *inputp = input;
134665  return *inputp++;
134666}
134667
134668int
134669main (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
134683if 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"
134691at_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>&-
134695at_status=$? at_failed=false
134696$at_check_filter
134697echo stderr:; cat "$at_stderr"
134698echo stdout:; cat "$at_stdout"
134699at_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"
134705at_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>&-
134708at_status=$? at_failed=false
134709$at_check_filter
134710echo stderr:; cat "$at_stderr"
134711echo stdout:; cat "$at_stdout"
134712at_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"
134721at_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>&-
134726at_status=$? at_failed=false
134727$at_check_filter
134728at_fn_diff_devnull "$at_stderr" || at_failed=:
134729$at_diff expout "$at_stdout" || at_failed=:
134730at_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"
134739at_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>&-
134744at_status=$? at_failed=false
134745$at_check_filter
134746at_fn_diff_devnull "$at_stderr" || at_failed=:
134747$at_diff expout "$at_stdout" || at_failed=:
134748at_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
134754fi
134755{ set +x
134756$as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y"
134757at_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>&-
134760at_status=$? at_failed=false
134761$at_check_filter
134762echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
134763" | \
134764  $at_diff - "$at_stderr" || at_failed=:
134765at_fn_diff_devnull "$at_stdout" || at_failed=:
134766at_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"
134774at_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>&-
134777at_status=$? at_failed=false
134778$at_check_filter
134779at_fn_diff_devnull "$at_stderr" || at_failed=:
134780echo >>"$at_stdout"; $as_echo "442
134781" | \
134782  $at_diff - "$at_stdout" || at_failed=:
134783at_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"
134790at_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>&-
134793at_status=$? at_failed=false
134794$at_check_filter
134795at_fn_diff_devnull "$at_stderr" || at_failed=:
134796echo stdout:; cat "$at_stdout"
134797at_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"
134804at_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>&-
134807at_status=$? at_failed=false
134808$at_check_filter
134809at_fn_diff_devnull "$at_stderr" || at_failed=:
134810at_fn_diff_devnull "$at_stdout" || at_failed=:
134811at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
134812$at_failed && at_fn_log_failure
134813$at_traceon; }
134814
134815if 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"
134823at_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>&-
134827at_status=$? at_failed=false
134828$at_check_filter
134829echo stderr:; cat "$at_stderr"
134830echo stdout:; cat "$at_stdout"
134831at_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"
134837at_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>&-
134840at_status=$? at_failed=false
134841$at_check_filter
134842echo stderr:; cat "$at_stderr"
134843echo stdout:; cat "$at_stdout"
134844at_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"
134853at_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>&-
134858at_status=$? at_failed=false
134859$at_check_filter
134860at_fn_diff_devnull "$at_stderr" || at_failed=:
134861$at_diff expout "$at_stdout" || at_failed=:
134862at_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"
134871at_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>&-
134876at_status=$? at_failed=false
134877$at_check_filter
134878at_fn_diff_devnull "$at_stderr" || at_failed=:
134879$at_diff expout "$at_stdout" || at_failed=:
134880at_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
134886fi
134887{ set +x
134888$as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y"
134889at_fn_check_prepare_trace "existing.at:783"
134890( $at_check_trace; bison --report=all input-lalr.y
134891) >>"$at_stdout" 2>>"$at_stderr" 5>&-
134892at_status=$? at_failed=false
134893$at_check_filter
134894echo stderr:; cat "$at_stderr"
134895echo stdout:; cat "$at_stdout"
134896at_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/^ \$//'"
134904at_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>&-
134908at_status=$? at_failed=false
134909$at_check_filter
134910at_fn_diff_devnull "$at_stderr" || at_failed=:
134911at_fn_diff_devnull "$at_stdout" || at_failed=:
134912at_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"
134917at_fn_check_prepare_trace "existing.at:783"
134918( $at_check_trace; grep '^State.*conflicts:' input.output
134919) >>"$at_stdout" 2>>"$at_stderr" 5>&-
134920at_status=$? at_failed=false
134921$at_check_filter
134922at_fn_diff_devnull "$at_stderr" || at_failed=:
134923echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce
134924State 164 conflicts: 1 shift/reduce
134925State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
134926State 206 conflicts: 1 shift/reduce
134927State 240 conflicts: 1 shift/reduce
134928State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
134929State 356 conflicts: 1 shift/reduce
134930State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
134931State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
134932" | \
134933  $at_diff - "$at_stdout" || at_failed=:
134934at_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"
134948at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
134949( $at_check_trace; $BISON_C_WORKS
134950) >>"$at_stdout" 2>>"$at_stderr" 5>&-
134951at_status=$? at_failed=false
134952$at_check_filter
134953echo stderr:; cat "$at_stderr"
134954echo stdout:; cat "$at_stdout"
134955at_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"
134961at_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>&-
134964at_status=$? at_failed=false
134965$at_check_filter
134966echo stderr:; cat "$at_stderr"
134967echo stdout:; cat "$at_stdout"
134968at_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"
134975at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
134976( $at_check_trace;  $PREPARSER ./input
134977) >>"$at_stdout" 2>>"$at_stderr" 5>&-
134978at_status=$? at_failed=false
134979$at_check_filter
134980echo stderr:; tee stderr <"$at_stderr"
134981at_fn_diff_devnull "$at_stdout" || at_failed=:
134982at_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"
134988at_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>&-
134991at_status=$? at_failed=false
134992$at_check_filter
134993at_fn_diff_devnull "$at_stderr" || at_failed=:
134994at_fn_diff_devnull "$at_stdout" || at_failed=:
134995at_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
135005read at_status <"$at_status_file"
135006#AT_STOP_263
135007#AT_START_264
135008at_fn_group_banner 264 'existing.at:783' \
135009  "GNU Cim Grammar: Canonical LR(1)" "               " 16
135010at_xfail=no
135011(
135012  $as_echo "264. $at_setup_line: testing $at_desc ..."
135013  $at_traceon
135014
135015
135016cat >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 */
135098MAIN_MODULE     :       {}
135099			MODULS
135100		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
135101		;
135102EXT_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		;
135120EXTERNAL_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		;
135133MBEE_REST_EXT_LIST:	/* EMPTY
135134		|	HPAREXPSEPARATOR EXT_KIND_LIST
135135		;
135136EXT_KIND_LIST	:	EXT_KIND_ITEM
135137		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
135138		;
135139EXT_KIND_ITEM	:	HIDENTIFIER
135140			EXT_IDENT
135141				{}*/
135142		;
135143EMPTY_BLOCK	:	/*EMPT*/
135144		|	HBEGIN HEND
135145		;
135146EXT_LIST	:	EXT_ITEM
135147		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
135148		;
135149EXT_ITEM	:	HIDENTIFIER
135150			EXT_IDENT
135151		;
135152EXT_IDENT	:	/* EMPTY */
135153		|	HVALRELOPERATOR {}
135154			HTEXTKONST
135155		;
135156/* GRAMATIKK FOR TYPER */
135157NO_TYPE         :       /*EMPT*/
135158		;
135159MBEE_TYPE       :       NO_TYPE
135160		|       TYPE
135161		;
135162TYPE            :       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 */
135176MBEE_ELSE_PART  :       /*EMPT*/
135177/*		|	HELSE
135178			HIF
135179			EXPRESSION
135180			HTHEN   {}
135181			BLOCK   {}
135182			MBEE_ELSE_PART          {}*/
135183		|       HELSE   {}
135184			BLOCK
135185		;
135186FOR_LIST        :       FOR_LIST_ELEMENT
135187		|       FOR_LIST_ELEMENT
135188			HPAREXPSEPARATOR
135189			FOR_LIST
135190		;
135191FOR_LIST_ELEMENT:       EXPRESSION
135192			MBEE_F_L_EL_R_PT
135193		;
135194MBEE_F_L_EL_R_PT:       /*EMPT*/
135195		|       HWHILE
135196			EXPRESSION
135197		|       HSTEP
135198			EXPRESSION
135199			HUNTIL
135200			EXPRESSION
135201		;
135202GOTO            :       HGO
135203			HTO
135204		|       HGOTO
135205		;
135206CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
135207		|       HDO   {}
135208			BLOCK
135209		;
135210WHEN_CLAUSE_LIST:       HWHEN
135211			HIDENTIFIER
135212			HDO    {}
135213			BLOCK
135214		|       WHEN_CLAUSE_LIST
135215			HWHEN
135216			HIDENTIFIER
135217			HDO    {}
135218			BLOCK
135219		;
135220MBEE_OTWI_CLAUS :       /*EMPT*/
135221		|       HOTHERWISE {}
135222
135223			BLOCK
135224		;
135225ACTIVATOR	:	HACTIVATE
135226		|	HREACTIVATE
135227		;
135228SCHEDULE	:	/*EMPT*/
135229		|	ATDELAY EXPRESSION	{}
135230			PRIOR
135231		|	BEFOREAFTER		{}
135232			EXPRESSION
135233		;
135234ATDELAY		:	HAT
135235		|	HDELAY
135236		;
135237BEFOREAFTER	:	HBEFORE
135238		|	HAFTER
135239		;
135240PRIOR		:	/*EMPT*/
135241		|	HPRIOR
135242		;
135243/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
135244MODULSTATEMENT  :       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		;
135309IMPORT_SPEC_MODULE:
135310		;
135311DECLSTATEMENT	:	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		;
135329BLOCK           :       DECLSTATEMENT
135330		|       HBEGIN MBEE_DECLSTMS HEND
135331		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
135332		|	HBEGIN error HEND
135333		;
135334MBEE_DECLSTMS   :       MBEE_DECLSTMSU
135335		;
135336MBEE_DECLSTMSU  :       DECLSTATEMENT
135337		|       MBEE_DECLSTMSU
135338			HSTATEMENTSEPARATOR
135339			DECLSTATEMENT
135340		;
135341MODULS		:	MODULSTATEMENT
135342		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
135343		;
135344/* GRAMATIKK FOR DEL AV DEKLARASJONER */
135345ARR_SEGMENT_LIST:       ARR_SEGMENT
135346		|       ARR_SEGMENT_LIST
135347			HPAREXPSEPARATOR
135348			ARR_SEGMENT
135349		;
135350ARR_SEGMENT	:       ARRAY_SEGMENT
135351			HBEGPAR
135352			BAUND_PAIR_LIST HENDPAR
135353		;
135354ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
135355
135356		|       ARRAY_SEGMENT_EL
135357			HPAREXPSEPARATOR
135358			ARRAY_SEGMENT
135359		;
135360ARRAY_SEGMENT_EL:       HIDENTIFIER
135361		;
135362BAUND_PAIR_LIST :       BAUND_PAIR
135363		|       BAUND_PAIR
135364			HPAREXPSEPARATOR
135365			BAUND_PAIR_LIST
135366		;
135367BAUND_PAIR      :       EXPRESSION
135368			HLABELSEPARATOR
135369			EXPRESSION
135370		;
135371SWITCH_LIST     :       EXPRESSION
135372		|       EXPRESSION
135373			HPAREXPSEPARATOR
135374			SWITCH_LIST
135375		;
135376HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
135377			MBEE_MODE_PART  {}
135378			MBEE_SPEC_PART  {}
135379			MBEE_PROT_PART  {}
135380			MBEE_VIRT_PART
135381		;
135382MBEE_FMAL_PAR_P :       /*EMPT*/
135383		|       FMAL_PAR_PART
135384		;
135385FMAL_PAR_PART   :       HBEGPAR NO_TYPE
135386			MBEE_LISTV HENDPAR
135387		;
135388MBEE_LISTV      :       /*EMPT*/
135389		|       LISTV
135390		;
135391LISTV           :       HIDENTIFIER
135392		|	FPP_CATEG HDOTDOTDOT
135393		|       HIDENTIFIER     {}
135394			HPAREXPSEPARATOR LISTV
135395		|       FPP_SPEC
135396		|       FPP_SPEC
135397			HPAREXPSEPARATOR LISTV
135398		;
135399FPP_HEADING     :       HBEGPAR NO_TYPE
135400			FPP_MBEE_LISTV HENDPAR
135401		;
135402FPP_MBEE_LISTV  :       /*EMPT*/
135403		|       FPP_LISTV
135404		;
135405FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
135406		|       FPP_SPEC
135407		|       FPP_SPEC
135408			HPAREXPSEPARATOR LISTV
135409		;
135410FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
135411		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
135412		;
135413FPP_CATEG       :       HNAME HLABELSEPARATOR
135414		|       HVALUE HLABELSEPARATOR
135415		|       HVAR HLABELSEPARATOR
135416		|       /*EMPT*/
135417		;
135418FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
135419			HIDENTIFIER
135420					{}
135421			FPP_HEADING {} { /* Yes, two "final" actions. */ }
135422		;
135423IDENTIFIER_LISTV:       HIDENTIFIER
135424		|	HDOTDOTDOT
135425		|       HIDENTIFIER     {}
135426			HPAREXPSEPARATOR IDENTIFIER_LISTV
135427		;
135428MBEE_MODE_PART  :       /*EMPT*/
135429		|       MODE_PART
135430		;
135431MODE_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		;
135447NAME_PART       :       HNAME           {}
135448			IDENTIFIER_LISTV
135449			HSTATEMENTSEPARATOR
135450		;
135451VAR_PART        :       HVAR            {}
135452			IDENTIFIER_LISTV
135453			HSTATEMENTSEPARATOR
135454		;
135455VALUE_PART      :       HVALUE          {}
135456			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
135457		;
135458MBEE_SPEC_PART  :       /*EMPT*/
135459		|       SPEC_PART
135460		;
135461SPEC_PART       :       ONE_SPEC
135462		|       SPEC_PART ONE_SPEC
135463		;
135464ONE_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		;
135473SPECIFIER       :       TYPE
135474		|       MBEE_TYPE
135475			HARRAY
135476		|       HLABEL
135477		|       HSWITCH
135478		;
135479PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
135480			HIDENTIFIER
135481					{}
135482			HEADING
135483					{}
135484			MBEE_BEGIN_END
135485		;
135486MBEE_BEGIN_END	:	/* EMPTY */
135487		|	HBEGIN HEND
135488		;
135489MBEE_PROT_PART  :       /*EMPT*/
135490		|       PROTECTION_PART
135491		;
135492PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
135493			HSTATEMENTSEPARATOR
135494		|       PROTECTION_PART  PROT_SPECIFIER
135495			IDENTIFIER_LIST HSTATEMENTSEPARATOR
135496		;
135497PROT_SPECIFIER  :       HHIDDEN
135498		|       HPROTECTED
135499		|       HHIDDEN
135500			HPROTECTED
135501		|       HPROTECTED
135502			HHIDDEN
135503		;
135504MBEE_VIRT_PART  :       /*EMPT*/
135505		|       VIRTUAL_PART
135506		;
135507VIRTUAL_PART    :       HVIRTUAL
135508			HLABELSEPARATOR
135509			MBEE_SPEC_PART
135510		;
135511IDENTIFIER_LIST :       HIDENTIFIER
135512		|       IDENTIFIER_LIST HPAREXPSEPARATOR
135513			HIDENTIFIER
135514		;
135515IDENTIFIER_LISTC:       HIDENTIFIER
135516			MBEE_CONSTANT
135517		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
135518			HIDENTIFIER
135519			MBEE_CONSTANT
135520		;
135521MBEE_CONSTANT	:	/* EMPTY */
135522		|	HVALRELOPERATOR
135523				{}
135524			EXPRESSION
135525		;
135526
135527/* GRAMATIKK FOR UTTRYKK */
135528EXPRESSION      :       EXPRESSION_SIMP
135529		|       HIF
135530			EXPRESSION
135531			HTHEN
135532			EXPRESSION
135533			HELSE
135534			EXPRESSION
135535		;
135536EXPRESSION_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		;
135602ARG_R_PT        :       /*EMPTY*/
135603		|       HBEGPAR
135604			ARGUMENT_LIST HENDPAR
135605		;
135606MBEE_ARG_R_PT   :       /*EMPTY*/
135607		|       HBEGPAR
135608			ARGUMENT_LIST HENDPAR
135609		;
135610ARGUMENT_LIST   :       EXPRESSION
135611		|       EXPRESSION
135612			HPAREXPSEPARATOR
135613			ARGUMENT_LIST
135614		;
135615
135616
135617%%
135618#include <stdio.h>
135619/* A C error reporting function.  */
135620static
135621void yyerror ( const char *msg)
135622{
135623  fprintf (stderr, "%s\n", msg);
135624}
135625static int
135626yylex (void)
135627{
135628  static int const input[] = {
135629    0
135630  };
135631  static int const *inputp = input;
135632  return *inputp++;
135633}
135634
135635int
135636main (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"
135652at_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>&-
135655at_status=$? at_failed=false
135656$at_check_filter
135657echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce
135658" | \
135659  $at_diff - "$at_stderr" || at_failed=:
135660at_fn_diff_devnull "$at_stdout" || at_failed=:
135661at_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"
135669at_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>&-
135672at_status=$? at_failed=false
135673$at_check_filter
135674at_fn_diff_devnull "$at_stderr" || at_failed=:
135675echo >>"$at_stdout"; $as_echo "10425
135676" | \
135677  $at_diff - "$at_stdout" || at_failed=:
135678at_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.
135691if test 32767 -lt `wc -l < input.c`; then
135692  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
135693  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
135694fi
135695{ set +x
135696$as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS"
135697at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
135698( $at_check_trace; $BISON_C_WORKS
135699) >>"$at_stdout" 2>>"$at_stderr" 5>&-
135700at_status=$? at_failed=false
135701$at_check_filter
135702echo stderr:; cat "$at_stderr"
135703echo stdout:; cat "$at_stdout"
135704at_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"
135710at_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>&-
135713at_status=$? at_failed=false
135714$at_check_filter
135715echo stderr:; cat "$at_stderr"
135716echo stdout:; cat "$at_stdout"
135717at_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"
135724at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
135725( $at_check_trace;  $PREPARSER ./input
135726) >>"$at_stdout" 2>>"$at_stderr" 5>&-
135727at_status=$? at_failed=false
135728$at_check_filter
135729echo stderr:; tee stderr <"$at_stderr"
135730at_fn_diff_devnull "$at_stdout" || at_failed=:
135731at_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"
135737at_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>&-
135740at_status=$? at_failed=false
135741$at_check_filter
135742at_fn_diff_devnull "$at_stderr" || at_failed=:
135743at_fn_diff_devnull "$at_stdout" || at_failed=:
135744at_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
135754read at_status <"$at_status_file"
135755#AT_STOP_264
135756#AT_START_265
135757at_fn_group_banner 265 'existing.at:1403' \
135758  "GNU pic (Groff 1.18.1) Grammar: LALR(1)" "        " 16
135759at_xfail=no
135760(
135761  $as_echo "265. $at_setup_line: testing $at_desc ..."
135762  $at_traceon
135763
135764
135765cat >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
135908box "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
135915precedence than left and right, so that eg `line chop left'
135916parses 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'
135929works */
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
135952top:
135953	optional_separator
135954	| element_list
135955	;
135956
135957element_list:
135958	optional_separator middle_element_list optional_separator
135959	;
135960
135961middle_element_list:
135962	element
135963	| middle_element_list separator element
135964	;
135965
135966optional_separator:
135967	/* empty */
135968	| separator
135969	;
135970
135971separator:
135972	';'
135973	| separator ';'
135974	;
135975
135976placeless_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
136011reset_variables:
136012	RESET VARIABLE
136013	| reset_variables VARIABLE
136014	| reset_variables ',' VARIABLE
136015	;
136016
136017print_args:
136018	print_arg
136019	| print_args print_arg
136020	;
136021
136022print_arg:
136023	expr							%prec ','
136024	| text
136025	| position						%prec ','
136026	;
136027
136028simple_if:
136029	IF any_expr THEN
136030		{}
136031	DELIMITED
136032	;
136033
136034until:
136035	/* empty */
136036	| UNTIL TEXT
136037	;
136038
136039any_expr:
136040	expr
136041	| text_expr
136042	;
136043
136044text_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
136056optional_by:
136057	/* empty */
136058	| BY expr
136059	| BY '*' expr
136060	;
136061
136062element:
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
136073optional_element:
136074	/* empty */
136075	| element
136076	;
136077
136078object_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
136141text:
136142	TEXT
136143	| SPRINTF '(' TEXT sprintf_args ')'
136144	;
136145
136146sprintf_args:
136147	/* empty */
136148	| sprintf_args ',' expr
136149	;
136150
136151position:
136152	position_not_place
136153	| place
136154	;
136155
136156position_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
136165between:
136166	BETWEEN
136167	| OF THE WAY BETWEEN
136168	;
136169
136170expr_pair:
136171	expr ',' expr
136172	| '(' expr_pair ')'
136173	;
136174
136175place:
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
136184label:
136185	LABEL
136186	| nth_primitive
136187	| label '.' LABEL
136188	;
136189
136190ordinal:
136191	ORDINAL
136192	| '`' any_expr TH
136193	;
136194
136195optional_ordinal_last:
136196	LAST
136197	| ordinal LAST
136198	;
136199
136200nth_primitive:
136201	ordinal object_type
136202	| optional_ordinal_last object_type
136203	;
136204
136205object_type:
136206	BOX
136207	| CIRCLE
136208	| ELLIPSE
136209	| ARC
136210	| LINE
136211	| ARROW
136212	| SPLINE
136213	| '[' ']'
136214	| TEXT
136215	;
136216
136217label_path:
136218	'.' LABEL
136219	| label_path '.' LABEL
136220	;
136221
136222relative_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
136230path:
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
136241corner:
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
136276expr:
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.  */
136319static
136320void yyerror ( const char *msg)
136321{
136322  fprintf (stderr, "%s\n", msg);
136323}
136324static int
136325yylex (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
136334int
136335main (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
136349if 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"
136357at_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>&-
136361at_status=$? at_failed=false
136362$at_check_filter
136363echo stderr:; cat "$at_stderr"
136364echo stdout:; cat "$at_stdout"
136365at_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"
136371at_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>&-
136374at_status=$? at_failed=false
136375$at_check_filter
136376echo stderr:; cat "$at_stderr"
136377echo stdout:; cat "$at_stdout"
136378at_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"
136387at_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>&-
136392at_status=$? at_failed=false
136393$at_check_filter
136394at_fn_diff_devnull "$at_stderr" || at_failed=:
136395$at_diff expout "$at_stdout" || at_failed=:
136396at_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"
136405at_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>&-
136410at_status=$? at_failed=false
136411$at_check_filter
136412at_fn_diff_devnull "$at_stderr" || at_failed=:
136413$at_diff expout "$at_stdout" || at_failed=:
136414at_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
136420fi
136421{ set +x
136422$as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y"
136423at_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>&-
136426at_status=$? at_failed=false
136427$at_check_filter
136428echo >>"$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=:
136431at_fn_diff_devnull "$at_stdout" || at_failed=:
136432at_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.
136439if 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"
136448at_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>&-
136451at_status=$? at_failed=false
136452$at_check_filter
136453echo stderr:; tee stderr <"$at_stderr"
136454$at_diff expout "$at_stdout" || at_failed=:
136455at_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'
136463input.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"
136493at_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>&-
136497at_status=$? at_failed=false
136498$at_check_filter
136499$at_diff experr "$at_stderr" || at_failed=:
136500at_fn_diff_devnull "$at_stdout" || at_failed=:
136501at_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"
136510at_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>&-
136513at_status=$? at_failed=false
136514$at_check_filter
136515$at_diff experr "$at_stderr" || at_failed=:
136516$at_diff expout "$at_stdout" || at_failed=:
136517at_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"
136527at_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>&-
136530at_status=$? at_failed=false
136531$at_check_filter
136532at_fn_diff_devnull "$at_stderr" || at_failed=:
136533$at_diff expout "$at_stdout" || at_failed=:
136534at_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"
136540at_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>&-
136543at_status=$? at_failed=false
136544$at_check_filter
136545at_fn_diff_devnull "$at_stderr" || at_failed=:
136546$at_diff expout "$at_stdout" || at_failed=:
136547at_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
136553fi
136554
136555{ set +x
136556$as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
136557at_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>&-
136560at_status=$? at_failed=false
136561$at_check_filter
136562at_fn_diff_devnull "$at_stderr" || at_failed=:
136563echo >>"$at_stdout"; $as_echo "422
136564" | \
136565  $at_diff - "$at_stdout" || at_failed=:
136566at_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"
136573at_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>&-
136576at_status=$? at_failed=false
136577$at_check_filter
136578at_fn_diff_devnull "$at_stderr" || at_failed=:
136579echo stdout:; cat "$at_stdout"
136580at_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"
136587at_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>&-
136590at_status=$? at_failed=false
136591$at_check_filter
136592at_fn_diff_devnull "$at_stderr" || at_failed=:
136593at_fn_diff_devnull "$at_stdout" || at_failed=:
136594at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
136595$at_failed && at_fn_log_failure
136596$at_traceon; }
136597
136598if 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"
136606at_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>&-
136610at_status=$? at_failed=false
136611$at_check_filter
136612echo stderr:; cat "$at_stderr"
136613echo stdout:; cat "$at_stdout"
136614at_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"
136620at_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>&-
136623at_status=$? at_failed=false
136624$at_check_filter
136625echo stderr:; cat "$at_stderr"
136626echo stdout:; cat "$at_stdout"
136627at_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"
136636at_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>&-
136641at_status=$? at_failed=false
136642$at_check_filter
136643at_fn_diff_devnull "$at_stderr" || at_failed=:
136644$at_diff expout "$at_stdout" || at_failed=:
136645at_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"
136654at_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>&-
136659at_status=$? at_failed=false
136660$at_check_filter
136661at_fn_diff_devnull "$at_stderr" || at_failed=:
136662$at_diff expout "$at_stdout" || at_failed=:
136663at_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
136669fi
136670{ set +x
136671$as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y"
136672at_fn_check_prepare_trace "existing.at:1403"
136673( $at_check_trace; bison --report=all input-lalr.y
136674) >>"$at_stdout" 2>>"$at_stderr" 5>&-
136675at_status=$? at_failed=false
136676$at_check_filter
136677echo stderr:; cat "$at_stderr"
136678echo stdout:; cat "$at_stdout"
136679at_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/^ \$//'"
136687at_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>&-
136691at_status=$? at_failed=false
136692$at_check_filter
136693at_fn_diff_devnull "$at_stderr" || at_failed=:
136694at_fn_diff_devnull "$at_stdout" || at_failed=:
136695at_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"
136709at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
136710( $at_check_trace; $BISON_C_WORKS
136711) >>"$at_stdout" 2>>"$at_stderr" 5>&-
136712at_status=$? at_failed=false
136713$at_check_filter
136714echo stderr:; cat "$at_stderr"
136715echo stdout:; cat "$at_stdout"
136716at_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"
136722at_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>&-
136725at_status=$? at_failed=false
136726$at_check_filter
136727echo stderr:; cat "$at_stderr"
136728echo stdout:; cat "$at_stdout"
136729at_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"
136736at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
136737( $at_check_trace;  $PREPARSER ./input
136738) >>"$at_stdout" 2>>"$at_stderr" 5>&-
136739at_status=$? at_failed=false
136740$at_check_filter
136741echo stderr:; tee stderr <"$at_stderr"
136742at_fn_diff_devnull "$at_stdout" || at_failed=:
136743at_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"
136749at_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>&-
136752at_status=$? at_failed=false
136753$at_check_filter
136754echo >>"$at_stderr"; $as_echo "syntax error, unexpected LEFT
136755" | \
136756  $at_diff - "$at_stderr" || at_failed=:
136757at_fn_diff_devnull "$at_stdout" || at_failed=:
136758at_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
136768read at_status <"$at_status_file"
136769#AT_STOP_265
136770#AT_START_266
136771at_fn_group_banner 266 'existing.at:1403' \
136772  "GNU pic (Groff 1.18.1) Grammar: IELR(1)" "        " 16
136773at_xfail=no
136774(
136775  $as_echo "266. $at_setup_line: testing $at_desc ..."
136776  $at_traceon
136777
136778
136779cat >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
136922box "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
136929precedence than left and right, so that eg `line chop left'
136930parses 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'
136943works */
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
136966top:
136967	optional_separator
136968	| element_list
136969	;
136970
136971element_list:
136972	optional_separator middle_element_list optional_separator
136973	;
136974
136975middle_element_list:
136976	element
136977	| middle_element_list separator element
136978	;
136979
136980optional_separator:
136981	/* empty */
136982	| separator
136983	;
136984
136985separator:
136986	';'
136987	| separator ';'
136988	;
136989
136990placeless_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
137025reset_variables:
137026	RESET VARIABLE
137027	| reset_variables VARIABLE
137028	| reset_variables ',' VARIABLE
137029	;
137030
137031print_args:
137032	print_arg
137033	| print_args print_arg
137034	;
137035
137036print_arg:
137037	expr							%prec ','
137038	| text
137039	| position						%prec ','
137040	;
137041
137042simple_if:
137043	IF any_expr THEN
137044		{}
137045	DELIMITED
137046	;
137047
137048until:
137049	/* empty */
137050	| UNTIL TEXT
137051	;
137052
137053any_expr:
137054	expr
137055	| text_expr
137056	;
137057
137058text_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
137070optional_by:
137071	/* empty */
137072	| BY expr
137073	| BY '*' expr
137074	;
137075
137076element:
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
137087optional_element:
137088	/* empty */
137089	| element
137090	;
137091
137092object_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
137155text:
137156	TEXT
137157	| SPRINTF '(' TEXT sprintf_args ')'
137158	;
137159
137160sprintf_args:
137161	/* empty */
137162	| sprintf_args ',' expr
137163	;
137164
137165position:
137166	position_not_place
137167	| place
137168	;
137169
137170position_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
137179between:
137180	BETWEEN
137181	| OF THE WAY BETWEEN
137182	;
137183
137184expr_pair:
137185	expr ',' expr
137186	| '(' expr_pair ')'
137187	;
137188
137189place:
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
137198label:
137199	LABEL
137200	| nth_primitive
137201	| label '.' LABEL
137202	;
137203
137204ordinal:
137205	ORDINAL
137206	| '`' any_expr TH
137207	;
137208
137209optional_ordinal_last:
137210	LAST
137211	| ordinal LAST
137212	;
137213
137214nth_primitive:
137215	ordinal object_type
137216	| optional_ordinal_last object_type
137217	;
137218
137219object_type:
137220	BOX
137221	| CIRCLE
137222	| ELLIPSE
137223	| ARC
137224	| LINE
137225	| ARROW
137226	| SPLINE
137227	| '[' ']'
137228	| TEXT
137229	;
137230
137231label_path:
137232	'.' LABEL
137233	| label_path '.' LABEL
137234	;
137235
137236relative_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
137244path:
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
137255corner:
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
137290expr:
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.  */
137333static
137334void yyerror ( const char *msg)
137335{
137336  fprintf (stderr, "%s\n", msg);
137337}
137338static int
137339yylex (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
137348int
137349main (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
137363if 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"
137371at_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>&-
137375at_status=$? at_failed=false
137376$at_check_filter
137377echo stderr:; cat "$at_stderr"
137378echo stdout:; cat "$at_stdout"
137379at_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"
137385at_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>&-
137388at_status=$? at_failed=false
137389$at_check_filter
137390echo stderr:; cat "$at_stderr"
137391echo stdout:; cat "$at_stdout"
137392at_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"
137401at_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>&-
137406at_status=$? at_failed=false
137407$at_check_filter
137408at_fn_diff_devnull "$at_stderr" || at_failed=:
137409$at_diff expout "$at_stdout" || at_failed=:
137410at_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"
137419at_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>&-
137424at_status=$? at_failed=false
137425$at_check_filter
137426at_fn_diff_devnull "$at_stderr" || at_failed=:
137427$at_diff expout "$at_stdout" || at_failed=:
137428at_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
137434fi
137435{ set +x
137436$as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y"
137437at_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>&-
137440at_status=$? at_failed=false
137441$at_check_filter
137442echo >>"$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=:
137445at_fn_diff_devnull "$at_stdout" || at_failed=:
137446at_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.
137453if 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"
137462at_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>&-
137465at_status=$? at_failed=false
137466$at_check_filter
137467echo stderr:; tee stderr <"$at_stderr"
137468$at_diff expout "$at_stdout" || at_failed=:
137469at_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'
137477input.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"
137507at_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>&-
137511at_status=$? at_failed=false
137512$at_check_filter
137513$at_diff experr "$at_stderr" || at_failed=:
137514at_fn_diff_devnull "$at_stdout" || at_failed=:
137515at_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"
137524at_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>&-
137527at_status=$? at_failed=false
137528$at_check_filter
137529$at_diff experr "$at_stderr" || at_failed=:
137530$at_diff expout "$at_stdout" || at_failed=:
137531at_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"
137541at_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>&-
137544at_status=$? at_failed=false
137545$at_check_filter
137546at_fn_diff_devnull "$at_stderr" || at_failed=:
137547$at_diff expout "$at_stdout" || at_failed=:
137548at_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"
137554at_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>&-
137557at_status=$? at_failed=false
137558$at_check_filter
137559at_fn_diff_devnull "$at_stderr" || at_failed=:
137560$at_diff expout "$at_stdout" || at_failed=:
137561at_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
137567fi
137568
137569{ set +x
137570$as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
137571at_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>&-
137574at_status=$? at_failed=false
137575$at_check_filter
137576at_fn_diff_devnull "$at_stderr" || at_failed=:
137577echo >>"$at_stdout"; $as_echo "427
137578" | \
137579  $at_diff - "$at_stdout" || at_failed=:
137580at_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"
137587at_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>&-
137590at_status=$? at_failed=false
137591$at_check_filter
137592at_fn_diff_devnull "$at_stderr" || at_failed=:
137593echo stdout:; cat "$at_stdout"
137594at_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"
137601at_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>&-
137604at_status=$? at_failed=false
137605$at_check_filter
137606at_fn_diff_devnull "$at_stderr" || at_failed=:
137607at_fn_diff_devnull "$at_stdout" || at_failed=:
137608at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
137609$at_failed && at_fn_log_failure
137610$at_traceon; }
137611
137612if 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"
137620at_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>&-
137624at_status=$? at_failed=false
137625$at_check_filter
137626echo stderr:; cat "$at_stderr"
137627echo stdout:; cat "$at_stdout"
137628at_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"
137634at_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>&-
137637at_status=$? at_failed=false
137638$at_check_filter
137639echo stderr:; cat "$at_stderr"
137640echo stdout:; cat "$at_stdout"
137641at_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"
137650at_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>&-
137655at_status=$? at_failed=false
137656$at_check_filter
137657at_fn_diff_devnull "$at_stderr" || at_failed=:
137658$at_diff expout "$at_stdout" || at_failed=:
137659at_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"
137668at_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>&-
137673at_status=$? at_failed=false
137674$at_check_filter
137675at_fn_diff_devnull "$at_stderr" || at_failed=:
137676$at_diff expout "$at_stdout" || at_failed=:
137677at_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
137683fi
137684{ set +x
137685$as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y"
137686at_fn_check_prepare_trace "existing.at:1403"
137687( $at_check_trace; bison --report=all input-lalr.y
137688) >>"$at_stdout" 2>>"$at_stderr" 5>&-
137689at_status=$? at_failed=false
137690$at_check_filter
137691echo stderr:; cat "$at_stderr"
137692echo stdout:; cat "$at_stdout"
137693at_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/^ \$//'"
137701at_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>&-
137705at_status=$? at_failed=false
137706$at_check_filter
137707at_fn_diff_devnull "$at_stderr" || at_failed=:
137708echo >>"$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=:
138850at_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"
138864at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
138865( $at_check_trace; $BISON_C_WORKS
138866) >>"$at_stdout" 2>>"$at_stderr" 5>&-
138867at_status=$? at_failed=false
138868$at_check_filter
138869echo stderr:; cat "$at_stderr"
138870echo stdout:; cat "$at_stdout"
138871at_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"
138877at_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>&-
138880at_status=$? at_failed=false
138881$at_check_filter
138882echo stderr:; cat "$at_stderr"
138883echo stdout:; cat "$at_stdout"
138884at_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"
138891at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
138892( $at_check_trace;  $PREPARSER ./input
138893) >>"$at_stdout" 2>>"$at_stderr" 5>&-
138894at_status=$? at_failed=false
138895$at_check_filter
138896echo stderr:; tee stderr <"$at_stderr"
138897at_fn_diff_devnull "$at_stdout" || at_failed=:
138898at_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"
138904at_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>&-
138907at_status=$? at_failed=false
138908$at_check_filter
138909at_fn_diff_devnull "$at_stderr" || at_failed=:
138910at_fn_diff_devnull "$at_stdout" || at_failed=:
138911at_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
138921read at_status <"$at_status_file"
138922#AT_STOP_266
138923#AT_START_267
138924at_fn_group_banner 267 'existing.at:1403' \
138925  "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 16
138926at_xfail=no
138927(
138928  $as_echo "267. $at_setup_line: testing $at_desc ..."
138929  $at_traceon
138930
138931
138932cat >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
139075box "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
139082precedence than left and right, so that eg `line chop left'
139083parses 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'
139096works */
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
139119top:
139120	optional_separator
139121	| element_list
139122	;
139123
139124element_list:
139125	optional_separator middle_element_list optional_separator
139126	;
139127
139128middle_element_list:
139129	element
139130	| middle_element_list separator element
139131	;
139132
139133optional_separator:
139134	/* empty */
139135	| separator
139136	;
139137
139138separator:
139139	';'
139140	| separator ';'
139141	;
139142
139143placeless_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
139178reset_variables:
139179	RESET VARIABLE
139180	| reset_variables VARIABLE
139181	| reset_variables ',' VARIABLE
139182	;
139183
139184print_args:
139185	print_arg
139186	| print_args print_arg
139187	;
139188
139189print_arg:
139190	expr							%prec ','
139191	| text
139192	| position						%prec ','
139193	;
139194
139195simple_if:
139196	IF any_expr THEN
139197		{}
139198	DELIMITED
139199	;
139200
139201until:
139202	/* empty */
139203	| UNTIL TEXT
139204	;
139205
139206any_expr:
139207	expr
139208	| text_expr
139209	;
139210
139211text_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
139223optional_by:
139224	/* empty */
139225	| BY expr
139226	| BY '*' expr
139227	;
139228
139229element:
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
139240optional_element:
139241	/* empty */
139242	| element
139243	;
139244
139245object_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
139308text:
139309	TEXT
139310	| SPRINTF '(' TEXT sprintf_args ')'
139311	;
139312
139313sprintf_args:
139314	/* empty */
139315	| sprintf_args ',' expr
139316	;
139317
139318position:
139319	position_not_place
139320	| place
139321	;
139322
139323position_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
139332between:
139333	BETWEEN
139334	| OF THE WAY BETWEEN
139335	;
139336
139337expr_pair:
139338	expr ',' expr
139339	| '(' expr_pair ')'
139340	;
139341
139342place:
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
139351label:
139352	LABEL
139353	| nth_primitive
139354	| label '.' LABEL
139355	;
139356
139357ordinal:
139358	ORDINAL
139359	| '`' any_expr TH
139360	;
139361
139362optional_ordinal_last:
139363	LAST
139364	| ordinal LAST
139365	;
139366
139367nth_primitive:
139368	ordinal object_type
139369	| optional_ordinal_last object_type
139370	;
139371
139372object_type:
139373	BOX
139374	| CIRCLE
139375	| ELLIPSE
139376	| ARC
139377	| LINE
139378	| ARROW
139379	| SPLINE
139380	| '[' ']'
139381	| TEXT
139382	;
139383
139384label_path:
139385	'.' LABEL
139386	| label_path '.' LABEL
139387	;
139388
139389relative_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
139397path:
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
139408corner:
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
139443expr:
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.  */
139486static
139487void yyerror ( const char *msg)
139488{
139489  fprintf (stderr, "%s\n", msg);
139490}
139491static int
139492yylex (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
139501int
139502main (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"
139518at_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>&-
139521at_status=$? at_failed=false
139522$at_check_filter
139523echo >>"$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=:
139526at_fn_diff_devnull "$at_stdout" || at_failed=:
139527at_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.
139534if 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"
139543at_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>&-
139546at_status=$? at_failed=false
139547$at_check_filter
139548echo stderr:; tee stderr <"$at_stderr"
139549$at_diff expout "$at_stdout" || at_failed=:
139550at_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'
139558input.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"
139588at_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>&-
139592at_status=$? at_failed=false
139593$at_check_filter
139594$at_diff experr "$at_stderr" || at_failed=:
139595at_fn_diff_devnull "$at_stdout" || at_failed=:
139596at_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"
139605at_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>&-
139608at_status=$? at_failed=false
139609$at_check_filter
139610$at_diff experr "$at_stderr" || at_failed=:
139611$at_diff expout "$at_stdout" || at_failed=:
139612at_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"
139622at_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>&-
139625at_status=$? at_failed=false
139626$at_check_filter
139627at_fn_diff_devnull "$at_stderr" || at_failed=:
139628$at_diff expout "$at_stdout" || at_failed=:
139629at_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"
139635at_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>&-
139638at_status=$? at_failed=false
139639$at_check_filter
139640at_fn_diff_devnull "$at_stderr" || at_failed=:
139641$at_diff expout "$at_stdout" || at_failed=:
139642at_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
139648fi
139649
139650{ set +x
139651$as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
139652at_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>&-
139655at_status=$? at_failed=false
139656$at_check_filter
139657at_fn_diff_devnull "$at_stderr" || at_failed=:
139658echo >>"$at_stdout"; $as_echo "4833
139659" | \
139660  $at_diff - "$at_stdout" || at_failed=:
139661at_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.
139674if test 32767 -lt `wc -l < input.c`; then
139675  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
139676  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
139677fi
139678{ set +x
139679$as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS"
139680at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
139681( $at_check_trace; $BISON_C_WORKS
139682) >>"$at_stdout" 2>>"$at_stderr" 5>&-
139683at_status=$? at_failed=false
139684$at_check_filter
139685echo stderr:; cat "$at_stderr"
139686echo stdout:; cat "$at_stdout"
139687at_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"
139693at_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>&-
139696at_status=$? at_failed=false
139697$at_check_filter
139698echo stderr:; cat "$at_stderr"
139699echo stdout:; cat "$at_stdout"
139700at_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"
139707at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
139708( $at_check_trace;  $PREPARSER ./input
139709) >>"$at_stdout" 2>>"$at_stderr" 5>&-
139710at_status=$? at_failed=false
139711$at_check_filter
139712echo stderr:; tee stderr <"$at_stderr"
139713at_fn_diff_devnull "$at_stdout" || at_failed=:
139714at_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"
139720at_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>&-
139723at_status=$? at_failed=false
139724$at_check_filter
139725at_fn_diff_devnull "$at_stderr" || at_failed=:
139726at_fn_diff_devnull "$at_stdout" || at_failed=:
139727at_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
139737read at_status <"$at_status_file"
139738#AT_STOP_267
139739#AT_START_268
139740at_fn_group_banner 268 'regression.at:25' \
139741  "Trivial grammars" "                               " 17
139742at_xfail=no
139743(
139744  $as_echo "268. $at_setup_line: testing $at_desc ..."
139745  $at_traceon
139746
139747
139748
139749cat >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%{
139759void yyerror ( const char *msg);
139760int yylex (void);
139761#define YYSTYPE int *
139762%}
139763
139764%error-verbose
139765
139766%%
139767
139768program: 'x';
139769_ATEOF
139770
139771
139772
139773
139774if 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"
139782at_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>&-
139786at_status=$? at_failed=false
139787$at_check_filter
139788echo stderr:; cat "$at_stderr"
139789echo stdout:; cat "$at_stdout"
139790at_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"
139796at_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>&-
139799at_status=$? at_failed=false
139800$at_check_filter
139801echo stderr:; cat "$at_stderr"
139802echo stdout:; cat "$at_stdout"
139803at_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"
139812at_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>&-
139817at_status=$? at_failed=false
139818$at_check_filter
139819at_fn_diff_devnull "$at_stderr" || at_failed=:
139820$at_diff expout "$at_stdout" || at_failed=:
139821at_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"
139830at_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>&-
139835at_status=$? at_failed=false
139836$at_check_filter
139837at_fn_diff_devnull "$at_stderr" || at_failed=:
139838$at_diff expout "$at_stdout" || at_failed=:
139839at_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
139845fi
139846{ set +x
139847$as_echo "$at_srcdir/regression.at:43: bison -o input.c input.y"
139848at_fn_check_prepare_trace "regression.at:43"
139849( $at_check_trace; bison -o input.c input.y
139850) >>"$at_stdout" 2>>"$at_stderr" 5>&-
139851at_status=$? at_failed=false
139852$at_check_filter
139853at_fn_diff_devnull "$at_stderr" || at_failed=:
139854at_fn_diff_devnull "$at_stdout" || at_failed=:
139855at_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"
139862at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44"
139863( $at_check_trace; $BISON_C_WORKS
139864) >>"$at_stdout" 2>>"$at_stderr" 5>&-
139865at_status=$? at_failed=false
139866$at_check_filter
139867echo stderr:; cat "$at_stderr"
139868echo stdout:; cat "$at_stdout"
139869at_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 "
139875at_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>&-
139878at_status=$? at_failed=false
139879$at_check_filter
139880echo stderr:; cat "$at_stderr"
139881echo stdout:; cat "$at_stdout"
139882at_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"
139888at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45"
139889( $at_check_trace; $BISON_C_WORKS
139890) >>"$at_stdout" 2>>"$at_stderr" 5>&-
139891at_status=$? at_failed=false
139892$at_check_filter
139893echo stderr:; cat "$at_stderr"
139894echo stdout:; cat "$at_stdout"
139895at_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 "
139901at_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>&-
139904at_status=$? at_failed=false
139905$at_check_filter
139906echo stderr:; cat "$at_stderr"
139907echo stdout:; cat "$at_stdout"
139908at_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
139916read at_status <"$at_status_file"
139917#AT_STOP_268
139918#AT_START_269
139919at_fn_group_banner 269 'regression.at:55' \
139920  "YYSTYPE typedef" "                                " 17
139921at_xfail=no
139922(
139923  $as_echo "269. $at_setup_line: testing $at_desc ..."
139924  $at_traceon
139925
139926
139927
139928cat >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%{
139938void yyerror ( const char *msg);
139939int yylex (void);
139940typedef union { char const *val; } YYSTYPE;
139941%}
139942
139943%type <val> program
139944
139945%%
139946
139947program: { $$ = ""; };
139948_ATEOF
139949
139950
139951
139952
139953if 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"
139961at_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>&-
139965at_status=$? at_failed=false
139966$at_check_filter
139967echo stderr:; cat "$at_stderr"
139968echo stdout:; cat "$at_stdout"
139969at_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"
139975at_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>&-
139978at_status=$? at_failed=false
139979$at_check_filter
139980echo stderr:; cat "$at_stderr"
139981echo stdout:; cat "$at_stdout"
139982at_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"
139991at_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>&-
139996at_status=$? at_failed=false
139997$at_check_filter
139998at_fn_diff_devnull "$at_stderr" || at_failed=:
139999$at_diff expout "$at_stdout" || at_failed=:
140000at_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"
140009at_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>&-
140014at_status=$? at_failed=false
140015$at_check_filter
140016at_fn_diff_devnull "$at_stderr" || at_failed=:
140017$at_diff expout "$at_stdout" || at_failed=:
140018at_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
140024fi
140025{ set +x
140026$as_echo "$at_srcdir/regression.at:73: bison -o input.c input.y"
140027at_fn_check_prepare_trace "regression.at:73"
140028( $at_check_trace; bison -o input.c input.y
140029) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140030at_status=$? at_failed=false
140031$at_check_filter
140032at_fn_diff_devnull "$at_stderr" || at_failed=:
140033at_fn_diff_devnull "$at_stdout" || at_failed=:
140034at_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"
140041at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74"
140042( $at_check_trace; $BISON_C_WORKS
140043) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140044at_status=$? at_failed=false
140045$at_check_filter
140046echo stderr:; cat "$at_stderr"
140047echo stdout:; cat "$at_stdout"
140048at_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 "
140054at_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>&-
140057at_status=$? at_failed=false
140058$at_check_filter
140059echo stderr:; cat "$at_stderr"
140060echo stdout:; cat "$at_stdout"
140061at_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
140069read at_status <"$at_status_file"
140070#AT_STOP_269
140071#AT_START_270
140072at_fn_group_banner 270 'regression.at:85' \
140073  "Early token definitions with --yacc" "            " 17
140074at_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
140084cat >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%{
140094void yyerror ( const char *msg);
140095int 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%%
140109exp: MY_TOKEN;
140110%%
140111_ATEOF
140112
140113
140114
140115
140116if 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"
140124at_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>&-
140128at_status=$? at_failed=false
140129$at_check_filter
140130echo stderr:; cat "$at_stderr"
140131echo stdout:; cat "$at_stdout"
140132at_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"
140138at_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>&-
140141at_status=$? at_failed=false
140142$at_check_filter
140143echo stderr:; cat "$at_stderr"
140144echo stdout:; cat "$at_stdout"
140145at_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"
140154at_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>&-
140159at_status=$? at_failed=false
140160$at_check_filter
140161at_fn_diff_devnull "$at_stderr" || at_failed=:
140162$at_diff expout "$at_stdout" || at_failed=:
140163at_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"
140172at_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>&-
140177at_status=$? at_failed=false
140178$at_check_filter
140179at_fn_diff_devnull "$at_stderr" || at_failed=:
140180$at_diff expout "$at_stdout" || at_failed=:
140181at_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
140187fi
140188{ set +x
140189$as_echo "$at_srcdir/regression.at:113: bison -y -o input.c input.y"
140190at_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>&-
140193at_status=$? at_failed=false
140194$at_check_filter
140195at_fn_diff_devnull "$at_stderr" || at_failed=:
140196at_fn_diff_devnull "$at_stdout" || at_failed=:
140197at_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"
140204at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114"
140205( $at_check_trace; $BISON_C_WORKS
140206) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140207at_status=$? at_failed=false
140208$at_check_filter
140209echo stderr:; cat "$at_stderr"
140210echo stdout:; cat "$at_stdout"
140211at_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 "
140217at_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>&-
140220at_status=$? at_failed=false
140221$at_check_filter
140222echo stderr:; cat "$at_stderr"
140223echo stdout:; cat "$at_stdout"
140224at_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
140232read at_status <"$at_status_file"
140233#AT_STOP_270
140234#AT_START_271
140235at_fn_group_banner 271 'regression.at:125' \
140236  "Early token definitions without --yacc" "         " 17
140237at_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
140247cat >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>
140258void yyerror ( const char *msg);
140259int yylex (void);
140260void print_my_token (void);
140261%}
140262
140263%union
140264{
140265  int val;
140266};
140267%{
140268void
140269print_my_token (void)
140270{
140271  enum yytokentype my_token = MY_TOKEN;
140272  printf ("%d\n", my_token);
140273}
140274%}
140275%token MY_TOKEN
140276%%
140277exp: MY_TOKEN;
140278%%
140279_ATEOF
140280
140281
140282
140283
140284if 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"
140292at_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>&-
140296at_status=$? at_failed=false
140297$at_check_filter
140298echo stderr:; cat "$at_stderr"
140299echo stdout:; cat "$at_stdout"
140300at_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"
140306at_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>&-
140309at_status=$? at_failed=false
140310$at_check_filter
140311echo stderr:; cat "$at_stderr"
140312echo stdout:; cat "$at_stdout"
140313at_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"
140322at_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>&-
140327at_status=$? at_failed=false
140328$at_check_filter
140329at_fn_diff_devnull "$at_stderr" || at_failed=:
140330$at_diff expout "$at_stdout" || at_failed=:
140331at_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"
140340at_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>&-
140345at_status=$? at_failed=false
140346$at_check_filter
140347at_fn_diff_devnull "$at_stderr" || at_failed=:
140348$at_diff expout "$at_stdout" || at_failed=:
140349at_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
140355fi
140356{ set +x
140357$as_echo "$at_srcdir/regression.at:158: bison -o input.c input.y"
140358at_fn_check_prepare_trace "regression.at:158"
140359( $at_check_trace; bison -o input.c input.y
140360) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140361at_status=$? at_failed=false
140362$at_check_filter
140363at_fn_diff_devnull "$at_stderr" || at_failed=:
140364at_fn_diff_devnull "$at_stdout" || at_failed=:
140365at_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"
140372at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159"
140373( $at_check_trace; $BISON_C_WORKS
140374) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140375at_status=$? at_failed=false
140376$at_check_filter
140377echo stderr:; cat "$at_stderr"
140378echo stdout:; cat "$at_stdout"
140379at_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 "
140385at_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>&-
140388at_status=$? at_failed=false
140389$at_check_filter
140390echo stderr:; cat "$at_stderr"
140391echo stdout:; cat "$at_stdout"
140392at_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
140400read at_status <"$at_status_file"
140401#AT_STOP_271
140402#AT_START_272
140403at_fn_group_banner 272 'regression.at:170' \
140404  "Braces parsing" "                                 " 17
140405at_xfail=no
140406(
140407  $as_echo "272. $at_setup_line: testing $at_desc ..."
140408  $at_traceon
140409
140410
140411
140412cat >input.y <<'_ATEOF'
140413/* Bison used to swallow the character after '}'. */
140414
140415%%
140416exp: { tests = {{{{{{{{{{}}}}}}}}}}; };
140417%%
140418_ATEOF
140419
140420
140421
140422if 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"
140430at_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>&-
140434at_status=$? at_failed=false
140435$at_check_filter
140436echo stderr:; cat "$at_stderr"
140437echo stdout:; cat "$at_stdout"
140438at_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"
140444at_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>&-
140447at_status=$? at_failed=false
140448$at_check_filter
140449echo stderr:; cat "$at_stderr"
140450echo stdout:; cat "$at_stdout"
140451at_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"
140460at_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>&-
140465at_status=$? at_failed=false
140466$at_check_filter
140467at_fn_diff_devnull "$at_stderr" || at_failed=:
140468$at_diff expout "$at_stdout" || at_failed=:
140469at_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"
140478at_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>&-
140483at_status=$? at_failed=false
140484$at_check_filter
140485at_fn_diff_devnull "$at_stderr" || at_failed=:
140486$at_diff expout "$at_stdout" || at_failed=:
140487at_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
140493fi
140494{ set +x
140495$as_echo "$at_srcdir/regression.at:182: bison -v -o input.c input.y"
140496at_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>&-
140499at_status=$? at_failed=false
140500$at_check_filter
140501at_fn_diff_devnull "$at_stderr" || at_failed=:
140502at_fn_diff_devnull "$at_stdout" || at_failed=:
140503at_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"
140511at_fn_check_prepare_trace "regression.at:184"
140512( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c
140513) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140514at_status=$? at_failed=false
140515$at_check_filter
140516at_fn_diff_devnull "$at_stderr" || at_failed=:
140517echo stdout:; cat "$at_stdout"
140518at_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
140526read at_status <"$at_status_file"
140527#AT_STOP_272
140528#AT_START_273
140529at_fn_group_banner 273 'regression.at:194' \
140530  "Duplicate string" "                               " 17
140531at_xfail=no
140532(
140533  $as_echo "273. $at_setup_line: testing $at_desc ..."
140534  $at_traceon
140535
140536
140537
140538cat >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%%
140547exp: '(' exp ')' | NUM ;
140548%%
140549_ATEOF
140550
140551
140552
140553if 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"
140561at_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>&-
140565at_status=$? at_failed=false
140566$at_check_filter
140567echo stderr:; cat "$at_stderr"
140568echo stdout:; cat "$at_stdout"
140569at_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"
140575at_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>&-
140578at_status=$? at_failed=false
140579$at_check_filter
140580echo stderr:; cat "$at_stderr"
140581echo stdout:; cat "$at_stdout"
140582at_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"
140591at_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>&-
140596at_status=$? at_failed=false
140597$at_check_filter
140598at_fn_diff_devnull "$at_stderr" || at_failed=:
140599$at_diff expout "$at_stdout" || at_failed=:
140600at_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"
140609at_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>&-
140614at_status=$? at_failed=false
140615$at_check_filter
140616at_fn_diff_devnull "$at_stderr" || at_failed=:
140617$at_diff expout "$at_stdout" || at_failed=:
140618at_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
140624fi
140625{ set +x
140626$as_echo "$at_srcdir/regression.at:211: bison -v -o input.c input.y"
140627at_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>&-
140630at_status=$? at_failed=false
140631$at_check_filter
140632echo >>"$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=:
140635at_fn_diff_devnull "$at_stdout" || at_failed=:
140636at_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.
140643if 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"
140652at_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>&-
140655at_status=$? at_failed=false
140656$at_check_filter
140657echo stderr:; tee stderr <"$at_stderr"
140658$at_diff expout "$at_stdout" || at_failed=:
140659at_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'
140667input.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"
140697at_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>&-
140701at_status=$? at_failed=false
140702$at_check_filter
140703$at_diff experr "$at_stderr" || at_failed=:
140704at_fn_diff_devnull "$at_stdout" || at_failed=:
140705at_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"
140714at_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>&-
140717at_status=$? at_failed=false
140718$at_check_filter
140719$at_diff experr "$at_stderr" || at_failed=:
140720$at_diff expout "$at_stdout" || at_failed=:
140721at_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"
140731at_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>&-
140734at_status=$? at_failed=false
140735$at_check_filter
140736at_fn_diff_devnull "$at_stderr" || at_failed=:
140737$at_diff expout "$at_stdout" || at_failed=:
140738at_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"
140744at_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>&-
140747at_status=$? at_failed=false
140748$at_check_filter
140749at_fn_diff_devnull "$at_stderr" || at_failed=:
140750$at_diff expout "$at_stdout" || at_failed=:
140751at_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
140757fi
140758
140759  set +x
140760  $at_times_p && times >"$at_times_file"
140761) 5>&1 2>&1 7>&- | eval $at_tee_pipe
140762read at_status <"$at_status_file"
140763#AT_STOP_273
140764#AT_START_274
140765at_fn_group_banner 274 'regression.at:222' \
140766  "Rule Line Numbers" "                              " 17
140767at_xfail=no
140768(
140769  $as_echo "274. $at_setup_line: testing $at_desc ..."
140770  $at_traceon
140771
140772
140773
140774
140775
140776cat >input.y <<'_ATEOF'
140777%%
140778expr:
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
140808if 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"
140816at_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>&-
140820at_status=$? at_failed=false
140821$at_check_filter
140822echo stderr:; cat "$at_stderr"
140823echo stdout:; cat "$at_stdout"
140824at_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"
140830at_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>&-
140833at_status=$? at_failed=false
140834$at_check_filter
140835echo stderr:; cat "$at_stderr"
140836echo stdout:; cat "$at_stdout"
140837at_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"
140846at_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>&-
140851at_status=$? at_failed=false
140852$at_check_filter
140853at_fn_diff_devnull "$at_stderr" || at_failed=:
140854$at_diff expout "$at_stdout" || at_failed=:
140855at_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"
140864at_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>&-
140869at_status=$? at_failed=false
140870$at_check_filter
140871at_fn_diff_devnull "$at_stderr" || at_failed=:
140872$at_diff expout "$at_stdout" || at_failed=:
140873at_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
140879fi
140880{ set +x
140881$as_echo "$at_srcdir/regression.at:258: bison -o input.c -v input.y"
140882at_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>&-
140885at_status=$? at_failed=false
140886$at_check_filter
140887at_fn_diff_devnull "$at_stderr" || at_failed=:
140888at_fn_diff_devnull "$at_stdout" || at_failed=:
140889at_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"
140898at_fn_check_prepare_trace "regression.at:261"
140899( $at_check_trace; cat input.output
140900) >>"$at_stdout" 2>>"$at_stderr" 5>&-
140901at_status=$? at_failed=false
140902$at_check_filter
140903at_fn_diff_devnull "$at_stderr" || at_failed=:
140904echo >>"$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
140917Terminals, with rules where they appear
140918
140919\$end (0) 0
140920'a' (97) 2
140921'b' (98) 2
140922'c' (99) 4
140923error (256)
140924
140925
140926Nonterminals, with rules where they appear
140927
140928\$accept (6)
140929    on left: 0
140930expr (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
140938State 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
140950State 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
140959State 2
140960
140961    0 \$accept: expr . \$end
140962
140963    \$end  shift, and go to state 5
140964
140965
140966State 3
140967
140968    4 expr: \$@2 . 'c'
140969
140970    'c'  shift, and go to state 6
140971
140972
140973State 4
140974
140975    2 expr: 'a' \$@1 . 'b'
140976
140977    'b'  shift, and go to state 7
140978
140979
140980State 5
140981
140982    0 \$accept: expr \$end .
140983
140984    \$default  accept
140985
140986
140987State 6
140988
140989    4 expr: \$@2 'c' .
140990
140991    \$default  reduce using rule 4 (expr)
140992
140993
140994State 7
140995
140996    2 expr: 'a' \$@1 'b' .
140997
140998    \$default  reduce using rule 2 (expr)
140999" | \
141000  $at_diff - "$at_stdout" || at_failed=:
141001at_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
141009read at_status <"$at_status_file"
141010#AT_STOP_274
141011#AT_START_275
141012at_fn_group_banner 275 'regression.at:368' \
141013  "Mixing %token styles" "                           " 17
141014at_xfail=no
141015(
141016  $as_echo "275. $at_setup_line: testing $at_desc ..."
141017  $at_traceon
141018
141019
141020# Taken from the documentation.
141021cat >input.y <<'_ATEOF'
141022%token  <operator>  OR      "||"
141023%token  <operator>  LE 134  "<="
141024%left  OR  "<="
141025%%
141026exp: ;
141027%%
141028_ATEOF
141029
141030
141031if 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"
141039at_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>&-
141043at_status=$? at_failed=false
141044$at_check_filter
141045echo stderr:; cat "$at_stderr"
141046echo stdout:; cat "$at_stdout"
141047at_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"
141053at_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>&-
141056at_status=$? at_failed=false
141057$at_check_filter
141058echo stderr:; cat "$at_stderr"
141059echo stdout:; cat "$at_stdout"
141060at_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"
141069at_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>&-
141074at_status=$? at_failed=false
141075$at_check_filter
141076at_fn_diff_devnull "$at_stderr" || at_failed=:
141077$at_diff expout "$at_stdout" || at_failed=:
141078at_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"
141087at_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>&-
141092at_status=$? at_failed=false
141093$at_check_filter
141094at_fn_diff_devnull "$at_stderr" || at_failed=:
141095$at_diff expout "$at_stdout" || at_failed=:
141096at_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
141102fi
141103{ set +x
141104$as_echo "$at_srcdir/regression.at:380: bison -v -o input.c input.y"
141105at_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>&-
141108at_status=$? at_failed=false
141109$at_check_filter
141110at_fn_diff_devnull "$at_stderr" || at_failed=:
141111at_fn_diff_devnull "$at_stdout" || at_failed=:
141112at_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
141121read at_status <"$at_status_file"
141122#AT_STOP_275
141123#AT_START_276
141124at_fn_group_banner 276 'regression.at:391' \
141125  "Invalid inputs" "                                 " 17
141126at_xfail=no
141127(
141128  $as_echo "276. $at_setup_line: testing $at_desc ..."
141129  $at_traceon
141130
141131
141132cat >input.y <<'_ATEOF'
141133%%
141134?
141135default: '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"
141146at_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>&-
141149at_status=$? at_failed=false
141150$at_check_filter
141151echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?'
141152input.y:3.14: error: invalid character: '}'
141153input.y:4.1: error: invalid character: '%'
141154input.y:4.2: error: invalid character: '&'
141155input.y:5.1-17: error: invalid directive: '%a-does-not-exist'
141156input.y:6.1: error: invalid character: '%'
141157input.y:6.2: error: invalid character: '-'
141158input.y:7.1-8.0: error: missing '%}' at end of file
141159input.y:7.1-8.0: error: syntax error, unexpected %{...%}
141160" | \
141161  $at_diff - "$at_stderr" || at_failed=:
141162at_fn_diff_devnull "$at_stdout" || at_failed=:
141163at_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
141172read at_status <"$at_status_file"
141173#AT_STOP_276
141174#AT_START_277
141175at_fn_group_banner 277 'regression.at:418' \
141176  "Invalid inputs with {}" "                         " 17
141177at_xfail=no
141178(
141179  $as_echo "277. $at_setup_line: testing $at_desc ..."
141180  $at_traceon
141181
141182
141183cat >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"
141197at_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>&-
141200at_status=$? at_failed=false
141201$at_check_filter
141202echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
141203" | \
141204  $at_diff - "$at_stderr" || at_failed=:
141205at_fn_diff_devnull "$at_stdout" || at_failed=:
141206at_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
141215read at_status <"$at_status_file"
141216#AT_STOP_277
141217#AT_START_278
141218at_fn_group_banner 278 'regression.at:443' \
141219  "Token definitions" "                              " 17
141220at_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'!
141228cat >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>
141240static void yyerror ( const char *msg);
141241static 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%%
141252exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
141253%%
141254#include <stdio.h>
141255/* A C error reporting function.  */
141256static
141257void yyerror ( const char *msg)
141258{
141259  fprintf (stderr, "%s\n", msg);
141260}
141261#include <assert.h>
141262static
141263int 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
141275int
141276main (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.
141289if 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"
141297at_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>&-
141301at_status=$? at_failed=false
141302$at_check_filter
141303echo stderr:; cat "$at_stderr"
141304echo stdout:; cat "$at_stdout"
141305at_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"
141311at_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>&-
141314at_status=$? at_failed=false
141315$at_check_filter
141316echo stderr:; cat "$at_stderr"
141317echo stdout:; cat "$at_stdout"
141318at_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"
141327at_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>&-
141332at_status=$? at_failed=false
141333$at_check_filter
141334at_fn_diff_devnull "$at_stderr" || at_failed=:
141335$at_diff expout "$at_stdout" || at_failed=:
141336at_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"
141345at_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>&-
141350at_status=$? at_failed=false
141351$at_check_filter
141352at_fn_diff_devnull "$at_stderr" || at_failed=:
141353$at_diff expout "$at_stdout" || at_failed=:
141354at_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
141360fi
141361{ set +x
141362$as_echo "$at_srcdir/regression.at:480: bison -o input.c input.y"
141363at_fn_check_prepare_trace "regression.at:480"
141364( $at_check_trace; bison -o input.c input.y
141365) >>"$at_stdout" 2>>"$at_stderr" 5>&-
141366at_status=$? at_failed=false
141367$at_check_filter
141368echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared
141369input.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=:
141372at_fn_diff_devnull "$at_stdout" || at_failed=:
141373at_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.
141380if 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"
141389at_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>&-
141392at_status=$? at_failed=false
141393$at_check_filter
141394echo stderr:; tee stderr <"$at_stderr"
141395$at_diff expout "$at_stdout" || at_failed=:
141396at_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'
141404input.y:22.8-14: warning: symbol SPECIAL redeclared
141405input.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"
141435at_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>&-
141439at_status=$? at_failed=false
141440$at_check_filter
141441$at_diff experr "$at_stderr" || at_failed=:
141442at_fn_diff_devnull "$at_stdout" || at_failed=:
141443at_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"
141452at_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>&-
141455at_status=$? at_failed=false
141456$at_check_filter
141457$at_diff experr "$at_stderr" || at_failed=:
141458$at_diff expout "$at_stdout" || at_failed=:
141459at_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"
141469at_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>&-
141472at_status=$? at_failed=false
141473$at_check_filter
141474at_fn_diff_devnull "$at_stderr" || at_failed=:
141475$at_diff expout "$at_stdout" || at_failed=:
141476at_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"
141482at_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>&-
141485at_status=$? at_failed=false
141486$at_check_filter
141487at_fn_diff_devnull "$at_stderr" || at_failed=:
141488$at_diff expout "$at_stdout" || at_failed=:
141489at_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
141495fi
141496if 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"
141504at_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>&-
141508at_status=$? at_failed=false
141509$at_check_filter
141510echo stderr:; cat "$at_stderr"
141511echo stdout:; cat "$at_stdout"
141512at_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"
141518at_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>&-
141521at_status=$? at_failed=false
141522$at_check_filter
141523echo stderr:; cat "$at_stderr"
141524echo stdout:; cat "$at_stdout"
141525at_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"
141534at_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>&-
141539at_status=$? at_failed=false
141540$at_check_filter
141541at_fn_diff_devnull "$at_stderr" || at_failed=:
141542$at_diff expout "$at_stdout" || at_failed=:
141543at_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"
141552at_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>&-
141557at_status=$? at_failed=false
141558$at_check_filter
141559at_fn_diff_devnull "$at_stderr" || at_failed=:
141560$at_diff expout "$at_stdout" || at_failed=:
141561at_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
141567fi
141568{ set +x
141569$as_echo "$at_srcdir/regression.at:484: bison -fcaret -o input.c input.y"
141570at_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>&-
141573at_status=$? at_failed=false
141574$at_check_filter
141575echo >>"$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        ^^^^^^^
141578input.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=:
141583at_fn_diff_devnull "$at_stdout" || at_failed=:
141584at_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.
141591if 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"
141600at_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>&-
141603at_status=$? at_failed=false
141604$at_check_filter
141605echo stderr:; tee stderr <"$at_stderr"
141606$at_diff expout "$at_stdout" || at_failed=:
141607at_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'
141615input.y:22.8-14: warning: symbol SPECIAL redeclared
141616 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
141617        ^^^^^^^
141618input.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"
141650at_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>&-
141654at_status=$? at_failed=false
141655$at_check_filter
141656$at_diff experr "$at_stderr" || at_failed=:
141657at_fn_diff_devnull "$at_stdout" || at_failed=:
141658at_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"
141667at_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>&-
141670at_status=$? at_failed=false
141671$at_check_filter
141672$at_diff experr "$at_stderr" || at_failed=:
141673$at_diff expout "$at_stdout" || at_failed=:
141674at_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"
141684at_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>&-
141687at_status=$? at_failed=false
141688$at_check_filter
141689at_fn_diff_devnull "$at_stderr" || at_failed=:
141690$at_diff expout "$at_stdout" || at_failed=:
141691at_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"
141697at_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>&-
141700at_status=$? at_failed=false
141701$at_check_filter
141702at_fn_diff_devnull "$at_stderr" || at_failed=:
141703$at_diff expout "$at_stdout" || at_failed=:
141704at_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
141710fi
141711{ set +x
141712$as_echo "$at_srcdir/regression.at:492: \$BISON_C_WORKS"
141713at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:492"
141714( $at_check_trace; $BISON_C_WORKS
141715) >>"$at_stdout" 2>>"$at_stderr" 5>&-
141716at_status=$? at_failed=false
141717$at_check_filter
141718echo stderr:; cat "$at_stderr"
141719echo stdout:; cat "$at_stdout"
141720at_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"
141726at_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>&-
141729at_status=$? at_failed=false
141730$at_check_filter
141731echo stderr:; cat "$at_stderr"
141732echo stdout:; cat "$at_stdout"
141733at_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.
141742cat >experr <<'_ATEOF'
141743syntax 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"
141748at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:501"
141749( $at_check_trace;  $PREPARSER ./input
141750) >>"$at_stdout" 2>>"$at_stderr" 5>&-
141751at_status=$? at_failed=false
141752$at_check_filter
141753echo stderr:; tee stderr <"$at_stderr"
141754at_fn_diff_devnull "$at_stdout" || at_failed=:
141755at_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"
141761at_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>&-
141764at_status=$? at_failed=false
141765$at_check_filter
141766$at_diff experr "$at_stderr" || at_failed=:
141767at_fn_diff_devnull "$at_stdout" || at_failed=:
141768at_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
141776read at_status <"$at_status_file"
141777#AT_STOP_278
141778#AT_START_279
141779at_fn_group_banner 279 'regression.at:511' \
141780  "Characters Escapes" "                             " 17
141781at_xfail=no
141782(
141783  $as_echo "279. $at_setup_line: testing $at_desc ..."
141784  $at_traceon
141785
141786
141787
141788cat >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%{
141798void yyerror ( const char *msg);
141799int yylex (void);
141800%}
141801%%
141802exp:
141803  '\'' "\'"
141804| '\"' "\""
141805| '"'  "'" /* Pacify font-lock-mode: ". */
141806;
141807_ATEOF
141808
141809
141810
141811
141812
141813if 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"
141821at_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>&-
141825at_status=$? at_failed=false
141826$at_check_filter
141827echo stderr:; cat "$at_stderr"
141828echo stdout:; cat "$at_stdout"
141829at_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"
141835at_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>&-
141838at_status=$? at_failed=false
141839$at_check_filter
141840echo stderr:; cat "$at_stderr"
141841echo stdout:; cat "$at_stdout"
141842at_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"
141851at_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>&-
141856at_status=$? at_failed=false
141857$at_check_filter
141858at_fn_diff_devnull "$at_stderr" || at_failed=:
141859$at_diff expout "$at_stdout" || at_failed=:
141860at_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"
141869at_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>&-
141874at_status=$? at_failed=false
141875$at_check_filter
141876at_fn_diff_devnull "$at_stderr" || at_failed=:
141877$at_diff expout "$at_stdout" || at_failed=:
141878at_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
141884fi
141885{ set +x
141886$as_echo "$at_srcdir/regression.at:529: bison -o input.c input.y"
141887at_fn_check_prepare_trace "regression.at:529"
141888( $at_check_trace; bison -o input.c input.y
141889) >>"$at_stdout" 2>>"$at_stderr" 5>&-
141890at_status=$? at_failed=false
141891$at_check_filter
141892at_fn_diff_devnull "$at_stderr" || at_failed=:
141893at_fn_diff_devnull "$at_stdout" || at_failed=:
141894at_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"
141901at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:530"
141902( $at_check_trace; $BISON_C_WORKS
141903) >>"$at_stdout" 2>>"$at_stderr" 5>&-
141904at_status=$? at_failed=false
141905$at_check_filter
141906echo stderr:; cat "$at_stderr"
141907echo stdout:; cat "$at_stdout"
141908at_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 "
141914at_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>&-
141917at_status=$? at_failed=false
141918$at_check_filter
141919echo stderr:; cat "$at_stderr"
141920echo stdout:; cat "$at_stdout"
141921at_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
141928read at_status <"$at_status_file"
141929#AT_STOP_279
141930#AT_START_280
141931at_fn_group_banner 280 'regression.at:544' \
141932  "Web2c Report" "                                   " 17
141933at_xfail=no
141934(
141935  $as_echo "280. $at_setup_line: testing $at_desc ..."
141936  $at_traceon
141937
141938
141939
141940
141941cat >input.y <<'_ATEOF'
141942%token	undef_id_tok const_id_tok
141943
141944%start CONST_DEC_PART
141945
141946%%
141947CONST_DEC_PART:
141948         CONST_DEC_LIST
141949        ;
141950
141951CONST_DEC_LIST:
141952	  CONST_DEC
141953        | CONST_DEC_LIST CONST_DEC
141954        ;
141955
141956CONST_DEC:
141957	  { } undef_id_tok '=' const_id_tok ';'
141958        ;
141959%%
141960_ATEOF
141961
141962
141963if 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"
141971at_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>&-
141975at_status=$? at_failed=false
141976$at_check_filter
141977echo stderr:; cat "$at_stderr"
141978echo stdout:; cat "$at_stdout"
141979at_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"
141985at_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>&-
141988at_status=$? at_failed=false
141989$at_check_filter
141990echo stderr:; cat "$at_stderr"
141991echo stdout:; cat "$at_stdout"
141992at_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"
142001at_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>&-
142006at_status=$? at_failed=false
142007$at_check_filter
142008at_fn_diff_devnull "$at_stderr" || at_failed=:
142009$at_diff expout "$at_stdout" || at_failed=:
142010at_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"
142019at_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>&-
142024at_status=$? at_failed=false
142025$at_check_filter
142026at_fn_diff_devnull "$at_stderr" || at_failed=:
142027$at_diff expout "$at_stdout" || at_failed=:
142028at_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
142034fi
142035{ set +x
142036$as_echo "$at_srcdir/regression.at:569: bison -v input.y"
142037at_fn_check_prepare_trace "regression.at:569"
142038( $at_check_trace; bison -v input.y
142039) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142040at_status=$? at_failed=false
142041$at_check_filter
142042at_fn_diff_devnull "$at_stderr" || at_failed=:
142043at_fn_diff_devnull "$at_stdout" || at_failed=:
142044at_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"
142051at_fn_check_prepare_trace "regression.at:570"
142052( $at_check_trace; cat input.output
142053) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142054at_status=$? at_failed=false
142055$at_check_filter
142056at_fn_diff_devnull "$at_stderr" || at_failed=:
142057echo >>"$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
142071Terminals, with rules where they appear
142072
142073\$end (0) 0
142074';' (59) 5
142075'=' (61) 5
142076error (256)
142077undef_id_tok (258) 5
142078const_id_tok (259) 5
142079
142080
142081Nonterminals, with rules where they appear
142082
142083\$accept (7)
142084    on left: 0
142085CONST_DEC_PART (8)
142086    on left: 1, on right: 0
142087CONST_DEC_LIST (9)
142088    on left: 2 3, on right: 1 3
142089CONST_DEC (10)
142090    on left: 5, on right: 2 3
142091\$@1 (11)
142092    on left: 4, on right: 5
142093
142094
142095State 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
142107State 1
142108
142109    0 \$accept: CONST_DEC_PART . \$end
142110
142111    \$end  shift, and go to state 5
142112
142113
142114State 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
142126State 3
142127
142128    2 CONST_DEC_LIST: CONST_DEC .
142129
142130    \$default  reduce using rule 2 (CONST_DEC_LIST)
142131
142132
142133State 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
142140State 5
142141
142142    0 \$accept: CONST_DEC_PART \$end .
142143
142144    \$default  accept
142145
142146
142147State 6
142148
142149    3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC .
142150
142151    \$default  reduce using rule 3 (CONST_DEC_LIST)
142152
142153
142154State 7
142155
142156    5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';'
142157
142158    '='  shift, and go to state 8
142159
142160
142161State 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
142168State 9
142169
142170    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';'
142171
142172    ';'  shift, and go to state 10
142173
142174
142175State 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=:
142182at_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
142190read at_status <"$at_status_file"
142191#AT_STOP_280
142192#AT_START_281
142193at_fn_group_banner 281 'regression.at:721' \
142194  "Web2c Actions" "                                  " 17
142195at_xfail=no
142196(
142197  $as_echo "281. $at_setup_line: testing $at_desc ..."
142198  $at_traceon
142199
142200
142201
142202
142203cat >input.y <<'_ATEOF'
142204%%
142205statement:  struct_stat;
142206struct_stat:  /* empty. */ | if else;
142207if: "if" "const" "then" statement;
142208else: "else" statement;
142209%%
142210_ATEOF
142211
142212
142213if 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"
142221at_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>&-
142225at_status=$? at_failed=false
142226$at_check_filter
142227echo stderr:; cat "$at_stderr"
142228echo stdout:; cat "$at_stdout"
142229at_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"
142235at_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>&-
142238at_status=$? at_failed=false
142239$at_check_filter
142240echo stderr:; cat "$at_stderr"
142241echo stdout:; cat "$at_stdout"
142242at_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"
142251at_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>&-
142256at_status=$? at_failed=false
142257$at_check_filter
142258at_fn_diff_devnull "$at_stderr" || at_failed=:
142259$at_diff expout "$at_stdout" || at_failed=:
142260at_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"
142269at_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>&-
142274at_status=$? at_failed=false
142275$at_check_filter
142276at_fn_diff_devnull "$at_stderr" || at_failed=:
142277$at_diff expout "$at_stdout" || at_failed=:
142278at_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
142284fi
142285{ set +x
142286$as_echo "$at_srcdir/regression.at:734: bison -v -o input.c input.y"
142287at_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>&-
142290at_status=$? at_failed=false
142291$at_check_filter
142292at_fn_diff_devnull "$at_stderr" || at_failed=:
142293at_fn_diff_devnull "$at_stdout" || at_failed=:
142294at_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.
142301sed -n 's/  *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c
142302
142303{ set +x
142304$as_echo "$at_srcdir/regression.at:739: cat tables.c"
142305at_fn_check_prepare_trace "regression.at:739"
142306( $at_check_trace; cat tables.c
142307) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142308at_status=$? at_failed=false
142309$at_check_filter
142310at_fn_diff_devnull "$at_stderr" || at_failed=:
142311echo >>"$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};
142341static const yytype_uint8 yyprhs[] =
142342{
142343       0,     0,     3,     5,     6,     9,    14
142344};
142345static 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};
142350static const yytype_uint8 yyrline[] =
142351{
142352       0,     2,     2,     3,     3,     4,     5
142353};
142354static const char *const yytname[] =
142355{
142356  \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\",
142357  \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", YY_NULL
142358};
142359static const yytype_uint16 yytoknum[] =
142360{
142361       0,   256,   257,   258,   259,   260,   261
142362};
142363static const yytype_uint8 yyr1[] =
142364{
142365       0,     7,     8,     9,     9,    10,    11
142366};
142367static const yytype_uint8 yyr2[] =
142368{
142369       0,     2,     1,     0,     2,     4,     2
142370};
142371static const yytype_uint8 yydefact[] =
142372{
142373       3,     0,     0,     2,     0,     0,     1,     3,     4,     3,
142374       6,     5
142375};
142376static const yytype_int8 yydefgoto[] =
142377{
142378      -1,     2,     3,     4,     8
142379};
142380static const yytype_int8 yypact[] =
142381{
142382      -2,    -1,     4,    -8,     0,     2,    -8,    -2,    -8,    -2,
142383      -8,    -8
142384};
142385static const yytype_int8 yypgoto[] =
142386{
142387      -8,    -7,    -8,    -8,    -8
142388};
142389static const yytype_uint8 yytable[] =
142390{
142391      10,     1,    11,     5,     6,     0,     7,     9
142392};
142393static const yytype_int8 yycheck[] =
142394{
142395       7,     3,     9,     4,     0,    -1,     6,     5
142396};
142397static 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=:
142404at_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
142412read at_status <"$at_status_file"
142413#AT_STOP_281
142414#AT_START_282
142415at_fn_group_banner 282 'regression.at:936' \
142416  "Dancer " "                                        " 17
142417at_xfail=no
142418(
142419  $as_echo "282. $at_setup_line: testing $at_desc ..."
142420  $at_traceon
142421
142422
142423cat >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%%
142444line: header body
142445   ;
142446
142447header: '<' from ARROW to '>' type ':'
142448   | '<' ARROW to '>' type ':'
142449   | ARROW to type ':'
142450   | type ':'
142451   | '<' '>'
142452   ;
142453
142454from: DATA
142455   | STRING
142456   | INVALID
142457   ;
142458
142459to: DATA
142460   | STRING
142461   | INVALID
142462   ;
142463
142464type: DATA
142465   | STRING
142466   | INVALID
142467   ;
142468
142469body: /* empty */
142470   | body member
142471   ;
142472
142473member: STRING
142474   | DATA
142475   | '+' NUMBER
142476   | '-' NUMBER
142477   | NUMBER
142478   | INVALID
142479   ;
142480%%
142481#include <stdio.h>
142482/* A C error reporting function.  */
142483static
142484void yyerror ( const char *msg)
142485{
142486  fprintf (stderr, "%s\n", msg);
142487}
142488#include <assert.h>
142489static
142490int 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
142503int
142504main (void)
142505{
142506  return yyparse ();
142507}
142508_ATEOF
142509
142510
142511
142512if 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"
142520at_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>&-
142524at_status=$? at_failed=false
142525$at_check_filter
142526echo stderr:; cat "$at_stderr"
142527echo stdout:; cat "$at_stdout"
142528at_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"
142534at_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>&-
142537at_status=$? at_failed=false
142538$at_check_filter
142539echo stderr:; cat "$at_stderr"
142540echo stdout:; cat "$at_stdout"
142541at_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"
142550at_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>&-
142555at_status=$? at_failed=false
142556$at_check_filter
142557at_fn_diff_devnull "$at_stderr" || at_failed=:
142558$at_diff expout "$at_stdout" || at_failed=:
142559at_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"
142568at_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>&-
142573at_status=$? at_failed=false
142574$at_check_filter
142575at_fn_diff_devnull "$at_stderr" || at_failed=:
142576$at_diff expout "$at_stdout" || at_failed=:
142577at_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
142583fi
142584{ set +x
142585$as_echo "$at_srcdir/regression.at:936: bison -o dancer.c dancer.y"
142586at_fn_check_prepare_trace "regression.at:936"
142587( $at_check_trace; bison -o dancer.c dancer.y
142588) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142589at_status=$? at_failed=false
142590$at_check_filter
142591at_fn_diff_devnull "$at_stderr" || at_failed=:
142592at_fn_diff_devnull "$at_stdout" || at_failed=:
142593at_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"
142600at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:936"
142601( $at_check_trace; $BISON_C_WORKS
142602) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142603at_status=$? at_failed=false
142604$at_check_filter
142605echo stderr:; cat "$at_stderr"
142606echo stdout:; cat "$at_stdout"
142607at_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"
142613at_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>&-
142616at_status=$? at_failed=false
142617$at_check_filter
142618echo stderr:; cat "$at_stderr"
142619echo stdout:; cat "$at_stdout"
142620at_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"
142627at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:936"
142628( $at_check_trace;  $PREPARSER ./dancer
142629) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142630at_status=$? at_failed=false
142631$at_check_filter
142632echo stderr:; tee stderr <"$at_stderr"
142633at_fn_diff_devnull "$at_stdout" || at_failed=:
142634at_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"
142640at_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>&-
142643at_status=$? at_failed=false
142644$at_check_filter
142645echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
142646" | \
142647  $at_diff - "$at_stderr" || at_failed=:
142648at_fn_diff_devnull "$at_stdout" || at_failed=:
142649at_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
142658read at_status <"$at_status_file"
142659#AT_STOP_282
142660#AT_START_283
142661at_fn_group_banner 283 'regression.at:937' \
142662  "Dancer %glr-parser" "                             " 17
142663at_xfail=no
142664(
142665  $as_echo "283. $at_setup_line: testing $at_desc ..."
142666  $at_traceon
142667
142668
142669cat >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%%
142690line: header body
142691   ;
142692
142693header: '<' from ARROW to '>' type ':'
142694   | '<' ARROW to '>' type ':'
142695   | ARROW to type ':'
142696   | type ':'
142697   | '<' '>'
142698   ;
142699
142700from: DATA
142701   | STRING
142702   | INVALID
142703   ;
142704
142705to: DATA
142706   | STRING
142707   | INVALID
142708   ;
142709
142710type: DATA
142711   | STRING
142712   | INVALID
142713   ;
142714
142715body: /* empty */
142716   | body member
142717   ;
142718
142719member: STRING
142720   | DATA
142721   | '+' NUMBER
142722   | '-' NUMBER
142723   | NUMBER
142724   | INVALID
142725   ;
142726%%
142727#include <stdio.h>
142728/* A C error reporting function.  */
142729static
142730void yyerror ( const char *msg)
142731{
142732  fprintf (stderr, "%s\n", msg);
142733}
142734#include <assert.h>
142735static
142736int 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
142749int
142750main (void)
142751{
142752  return yyparse ();
142753}
142754_ATEOF
142755
142756
142757
142758if 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"
142766at_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>&-
142770at_status=$? at_failed=false
142771$at_check_filter
142772echo stderr:; cat "$at_stderr"
142773echo stdout:; cat "$at_stdout"
142774at_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"
142780at_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>&-
142783at_status=$? at_failed=false
142784$at_check_filter
142785echo stderr:; cat "$at_stderr"
142786echo stdout:; cat "$at_stdout"
142787at_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"
142796at_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>&-
142801at_status=$? at_failed=false
142802$at_check_filter
142803at_fn_diff_devnull "$at_stderr" || at_failed=:
142804$at_diff expout "$at_stdout" || at_failed=:
142805at_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"
142814at_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>&-
142819at_status=$? at_failed=false
142820$at_check_filter
142821at_fn_diff_devnull "$at_stderr" || at_failed=:
142822$at_diff expout "$at_stdout" || at_failed=:
142823at_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
142829fi
142830{ set +x
142831$as_echo "$at_srcdir/regression.at:937: bison -o dancer.c dancer.y"
142832at_fn_check_prepare_trace "regression.at:937"
142833( $at_check_trace; bison -o dancer.c dancer.y
142834) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142835at_status=$? at_failed=false
142836$at_check_filter
142837at_fn_diff_devnull "$at_stderr" || at_failed=:
142838at_fn_diff_devnull "$at_stdout" || at_failed=:
142839at_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"
142846at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:937"
142847( $at_check_trace; $BISON_C_WORKS
142848) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142849at_status=$? at_failed=false
142850$at_check_filter
142851echo stderr:; cat "$at_stderr"
142852echo stdout:; cat "$at_stdout"
142853at_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"
142859at_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>&-
142862at_status=$? at_failed=false
142863$at_check_filter
142864echo stderr:; cat "$at_stderr"
142865echo stdout:; cat "$at_stdout"
142866at_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"
142873at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:937"
142874( $at_check_trace;  $PREPARSER ./dancer
142875) >>"$at_stdout" 2>>"$at_stderr" 5>&-
142876at_status=$? at_failed=false
142877$at_check_filter
142878echo stderr:; tee stderr <"$at_stderr"
142879at_fn_diff_devnull "$at_stdout" || at_failed=:
142880at_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"
142886at_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>&-
142889at_status=$? at_failed=false
142890$at_check_filter
142891echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
142892" | \
142893  $at_diff - "$at_stderr" || at_failed=:
142894at_fn_diff_devnull "$at_stdout" || at_failed=:
142895at_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
142904read at_status <"$at_status_file"
142905#AT_STOP_283
142906#AT_START_284
142907at_fn_group_banner 284 'regression.at:938' \
142908  "Dancer %skeleton \"lalr1.cc\"" "                    " 17
142909at_xfail=no
142910(
142911  $as_echo "284. $at_setup_line: testing $at_desc ..."
142912  $at_traceon
142913
142914
142915cat >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%%
142936line: header body
142937   ;
142938
142939header: '<' from ARROW to '>' type ':'
142940   | '<' ARROW to '>' type ':'
142941   | ARROW to type ':'
142942   | type ':'
142943   | '<' '>'
142944   ;
142945
142946from: DATA
142947   | STRING
142948   | INVALID
142949   ;
142950
142951to: DATA
142952   | STRING
142953   | INVALID
142954   ;
142955
142956type: DATA
142957   | STRING
142958   | INVALID
142959   ;
142960
142961body: /* empty */
142962   | body member
142963   ;
142964
142965member: STRING
142966   | DATA
142967   | '+' NUMBER
142968   | '-' NUMBER
142969   | NUMBER
142970   | INVALID
142971   ;
142972%%
142973/* A C++ error reporting function.  */
142974void
142975yy::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>
142981static
142982int 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}
142993int
142994yyparse ()
142995{
142996  yy::parser parser;
142997#if YYDEBUG
142998  parser.set_debug_level (YYDEBUG);
142999#endif
143000  return parser.parse ();
143001}
143002
143003
143004int
143005main (void)
143006{
143007  return yyparse ();
143008}
143009_ATEOF
143010
143011
143012
143013if 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"
143021at_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>&-
143025at_status=$? at_failed=false
143026$at_check_filter
143027echo stderr:; cat "$at_stderr"
143028echo stdout:; cat "$at_stdout"
143029at_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"
143035at_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>&-
143038at_status=$? at_failed=false
143039$at_check_filter
143040echo stderr:; cat "$at_stderr"
143041echo stdout:; cat "$at_stdout"
143042at_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"
143051at_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>&-
143056at_status=$? at_failed=false
143057$at_check_filter
143058at_fn_diff_devnull "$at_stderr" || at_failed=:
143059$at_diff expout "$at_stdout" || at_failed=:
143060at_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"
143069at_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>&-
143074at_status=$? at_failed=false
143075$at_check_filter
143076at_fn_diff_devnull "$at_stderr" || at_failed=:
143077$at_diff expout "$at_stdout" || at_failed=:
143078at_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
143084fi
143085{ set +x
143086$as_echo "$at_srcdir/regression.at:938: bison -o dancer.cc dancer.y"
143087at_fn_check_prepare_trace "regression.at:938"
143088( $at_check_trace; bison -o dancer.cc dancer.y
143089) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143090at_status=$? at_failed=false
143091$at_check_filter
143092at_fn_diff_devnull "$at_stderr" || at_failed=:
143093at_fn_diff_devnull "$at_stdout" || at_failed=:
143094at_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"
143102at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:938"
143103( $at_check_trace; $BISON_CXX_WORKS
143104) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143105at_status=$? at_failed=false
143106$at_check_filter
143107echo stderr:; cat "$at_stderr"
143108echo stdout:; cat "$at_stdout"
143109at_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"
143115at_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>&-
143118at_status=$? at_failed=false
143119$at_check_filter
143120echo stderr:; cat "$at_stderr"
143121echo stdout:; cat "$at_stdout"
143122at_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"
143129at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:938"
143130( $at_check_trace;  $PREPARSER ./dancer
143131) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143132at_status=$? at_failed=false
143133$at_check_filter
143134echo stderr:; tee stderr <"$at_stderr"
143135at_fn_diff_devnull "$at_stdout" || at_failed=:
143136at_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"
143142at_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>&-
143145at_status=$? at_failed=false
143146$at_check_filter
143147echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
143148" | \
143149  $at_diff - "$at_stderr" || at_failed=:
143150at_fn_diff_devnull "$at_stdout" || at_failed=:
143151at_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
143160read at_status <"$at_status_file"
143161#AT_STOP_284
143162#AT_START_285
143163at_fn_group_banner 285 'regression.at:1020' \
143164  "Expecting two tokens " "                          " 17
143165at_xfail=no
143166(
143167  $as_echo "285. $at_setup_line: testing $at_desc ..."
143168  $at_traceon
143169
143170
143171cat >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%{
143181static int yylex (void);
143182#include <stdio.h>
143183#include <stdlib.h>
143184static void yyerror ( const char *msg);
143185%}
143186
143187%defines
143188%error-verbose
143189%token A 1000
143190%token B
143191
143192%%
143193program: /* empty */
143194 | program e ';'
143195 | program error ';';
143196
143197e: e '+' t | t;
143198t: A | B;
143199
143200%%
143201#include <stdio.h>
143202/* A C error reporting function.  */
143203static
143204void yyerror ( const char *msg)
143205{
143206  fprintf (stderr, "%s\n", msg);
143207}
143208
143209
143210#include <assert.h>
143211static int
143212yylex (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
143224int
143225main (void)
143226{
143227  return yyparse ();
143228}
143229_ATEOF
143230
143231
143232
143233if 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"
143241at_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>&-
143245at_status=$? at_failed=false
143246$at_check_filter
143247echo stderr:; cat "$at_stderr"
143248echo stdout:; cat "$at_stdout"
143249at_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"
143255at_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>&-
143258at_status=$? at_failed=false
143259$at_check_filter
143260echo stderr:; cat "$at_stderr"
143261echo stdout:; cat "$at_stdout"
143262at_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"
143271at_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>&-
143276at_status=$? at_failed=false
143277$at_check_filter
143278at_fn_diff_devnull "$at_stderr" || at_failed=:
143279$at_diff expout "$at_stdout" || at_failed=:
143280at_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"
143289at_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>&-
143294at_status=$? at_failed=false
143295$at_check_filter
143296at_fn_diff_devnull "$at_stderr" || at_failed=:
143297$at_diff expout "$at_stdout" || at_failed=:
143298at_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
143304fi
143305{ set +x
143306$as_echo "$at_srcdir/regression.at:1020: bison -o expect2.c expect2.y"
143307at_fn_check_prepare_trace "regression.at:1020"
143308( $at_check_trace; bison -o expect2.c expect2.y
143309) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143310at_status=$? at_failed=false
143311$at_check_filter
143312at_fn_diff_devnull "$at_stderr" || at_failed=:
143313at_fn_diff_devnull "$at_stdout" || at_failed=:
143314at_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"
143321at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1020"
143322( $at_check_trace; $BISON_C_WORKS
143323) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143324at_status=$? at_failed=false
143325$at_check_filter
143326echo stderr:; cat "$at_stderr"
143327echo stdout:; cat "$at_stdout"
143328at_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"
143334at_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>&-
143337at_status=$? at_failed=false
143338$at_check_filter
143339echo stderr:; cat "$at_stderr"
143340echo stdout:; cat "$at_stdout"
143341at_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"
143348at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1020"
143349( $at_check_trace;  $PREPARSER ./expect2
143350) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143351at_status=$? at_failed=false
143352$at_check_filter
143353echo stderr:; tee stderr <"$at_stderr"
143354at_fn_diff_devnull "$at_stdout" || at_failed=:
143355at_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"
143361at_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>&-
143364at_status=$? at_failed=false
143365$at_check_filter
143366echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
143367" | \
143368  $at_diff - "$at_stderr" || at_failed=:
143369at_fn_diff_devnull "$at_stdout" || at_failed=:
143370at_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
143379read at_status <"$at_status_file"
143380#AT_STOP_285
143381#AT_START_286
143382at_fn_group_banner 286 'regression.at:1021' \
143383  "Expecting two tokens %glr-parser" "               " 17
143384at_xfail=no
143385(
143386  $as_echo "286. $at_setup_line: testing $at_desc ..."
143387  $at_traceon
143388
143389
143390cat >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%{
143400static int yylex (void);
143401#include <stdio.h>
143402#include <stdlib.h>
143403static void yyerror ( const char *msg);
143404%}
143405%glr-parser
143406%defines
143407%error-verbose
143408%token A 1000
143409%token B
143410
143411%%
143412program: /* empty */
143413 | program e ';'
143414 | program error ';';
143415
143416e: e '+' t | t;
143417t: A | B;
143418
143419%%
143420#include <stdio.h>
143421/* A C error reporting function.  */
143422static
143423void yyerror ( const char *msg)
143424{
143425  fprintf (stderr, "%s\n", msg);
143426}
143427
143428
143429#include <assert.h>
143430static int
143431yylex (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
143443int
143444main (void)
143445{
143446  return yyparse ();
143447}
143448_ATEOF
143449
143450
143451
143452if 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"
143460at_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>&-
143464at_status=$? at_failed=false
143465$at_check_filter
143466echo stderr:; cat "$at_stderr"
143467echo stdout:; cat "$at_stdout"
143468at_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"
143474at_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>&-
143477at_status=$? at_failed=false
143478$at_check_filter
143479echo stderr:; cat "$at_stderr"
143480echo stdout:; cat "$at_stdout"
143481at_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"
143490at_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>&-
143495at_status=$? at_failed=false
143496$at_check_filter
143497at_fn_diff_devnull "$at_stderr" || at_failed=:
143498$at_diff expout "$at_stdout" || at_failed=:
143499at_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"
143508at_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>&-
143513at_status=$? at_failed=false
143514$at_check_filter
143515at_fn_diff_devnull "$at_stderr" || at_failed=:
143516$at_diff expout "$at_stdout" || at_failed=:
143517at_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
143523fi
143524{ set +x
143525$as_echo "$at_srcdir/regression.at:1021: bison -o expect2.c expect2.y"
143526at_fn_check_prepare_trace "regression.at:1021"
143527( $at_check_trace; bison -o expect2.c expect2.y
143528) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143529at_status=$? at_failed=false
143530$at_check_filter
143531at_fn_diff_devnull "$at_stderr" || at_failed=:
143532at_fn_diff_devnull "$at_stdout" || at_failed=:
143533at_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"
143540at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1021"
143541( $at_check_trace; $BISON_C_WORKS
143542) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143543at_status=$? at_failed=false
143544$at_check_filter
143545echo stderr:; cat "$at_stderr"
143546echo stdout:; cat "$at_stdout"
143547at_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"
143553at_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>&-
143556at_status=$? at_failed=false
143557$at_check_filter
143558echo stderr:; cat "$at_stderr"
143559echo stdout:; cat "$at_stdout"
143560at_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"
143567at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1021"
143568( $at_check_trace;  $PREPARSER ./expect2
143569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143570at_status=$? at_failed=false
143571$at_check_filter
143572echo stderr:; tee stderr <"$at_stderr"
143573at_fn_diff_devnull "$at_stdout" || at_failed=:
143574at_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"
143580at_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>&-
143583at_status=$? at_failed=false
143584$at_check_filter
143585echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
143586" | \
143587  $at_diff - "$at_stderr" || at_failed=:
143588at_fn_diff_devnull "$at_stdout" || at_failed=:
143589at_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
143598read at_status <"$at_status_file"
143599#AT_STOP_286
143600#AT_START_287
143601at_fn_group_banner 287 'regression.at:1022' \
143602  "Expecting two tokens %skeleton \"lalr1.cc\"" "      " 17
143603at_xfail=no
143604(
143605  $as_echo "287. $at_setup_line: testing $at_desc ..."
143606  $at_traceon
143607
143608
143609cat >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%{
143619static int yylex (int *);
143620
143621%}
143622%skeleton "lalr1.cc"
143623%defines
143624%error-verbose
143625%token A 1000
143626%token B
143627
143628%%
143629program: /* empty */
143630 | program e ';'
143631 | program error ';';
143632
143633e: e '+' t | t;
143634t: A | B;
143635
143636%%
143637/* A C++ error reporting function.  */
143638void
143639yy::parser::error (const location_type& l, const std::string& m)
143640{
143641  (void) l;
143642  std::cerr << m << std::endl;
143643}
143644int
143645yyparse ()
143646{
143647  yy::parser parser;
143648  return parser.parse ();
143649}
143650
143651
143652#include <assert.h>
143653static int
143654yylex (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
143666int
143667main (void)
143668{
143669  return yyparse ();
143670}
143671_ATEOF
143672
143673
143674
143675if 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"
143683at_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>&-
143687at_status=$? at_failed=false
143688$at_check_filter
143689echo stderr:; cat "$at_stderr"
143690echo stdout:; cat "$at_stdout"
143691at_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"
143697at_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>&-
143700at_status=$? at_failed=false
143701$at_check_filter
143702echo stderr:; cat "$at_stderr"
143703echo stdout:; cat "$at_stdout"
143704at_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"
143713at_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>&-
143718at_status=$? at_failed=false
143719$at_check_filter
143720at_fn_diff_devnull "$at_stderr" || at_failed=:
143721$at_diff expout "$at_stdout" || at_failed=:
143722at_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"
143731at_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>&-
143736at_status=$? at_failed=false
143737$at_check_filter
143738at_fn_diff_devnull "$at_stderr" || at_failed=:
143739$at_diff expout "$at_stdout" || at_failed=:
143740at_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
143746fi
143747{ set +x
143748$as_echo "$at_srcdir/regression.at:1022: bison -o expect2.cc expect2.y"
143749at_fn_check_prepare_trace "regression.at:1022"
143750( $at_check_trace; bison -o expect2.cc expect2.y
143751) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143752at_status=$? at_failed=false
143753$at_check_filter
143754at_fn_diff_devnull "$at_stderr" || at_failed=:
143755at_fn_diff_devnull "$at_stdout" || at_failed=:
143756at_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"
143764at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1022"
143765( $at_check_trace; $BISON_CXX_WORKS
143766) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143767at_status=$? at_failed=false
143768$at_check_filter
143769echo stderr:; cat "$at_stderr"
143770echo stdout:; cat "$at_stdout"
143771at_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"
143777at_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>&-
143780at_status=$? at_failed=false
143781$at_check_filter
143782echo stderr:; cat "$at_stderr"
143783echo stdout:; cat "$at_stdout"
143784at_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"
143791at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1022"
143792( $at_check_trace;  $PREPARSER ./expect2
143793) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143794at_status=$? at_failed=false
143795$at_check_filter
143796echo stderr:; tee stderr <"$at_stderr"
143797at_fn_diff_devnull "$at_stdout" || at_failed=:
143798at_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"
143804at_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>&-
143807at_status=$? at_failed=false
143808$at_check_filter
143809echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
143810" | \
143811  $at_diff - "$at_stderr" || at_failed=:
143812at_fn_diff_devnull "$at_stdout" || at_failed=:
143813at_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
143822read at_status <"$at_status_file"
143823#AT_STOP_287
143824#AT_START_288
143825at_fn_group_banner 288 'regression.at:1030' \
143826  "Braced code in declaration in rules section" "    " 17
143827at_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
143836cat >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>
143847static void yyerror ( const char *msg);
143848static int yylex (void);
143849%}
143850
143851%error-verbose
143852
143853%%
143854
143855start:
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.  */
143868static
143869void yyerror ( const char *msg)
143870{
143871  fprintf (stderr, "%s\n", msg);
143872}
143873#include <assert.h>
143874static
143875int 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
143887int
143888main (void)
143889{
143890  yydebug = 1;
143891  return !yyparse ();
143892}
143893_ATEOF
143894
143895
143896
143897
143898if 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"
143906at_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>&-
143910at_status=$? at_failed=false
143911$at_check_filter
143912echo stderr:; cat "$at_stderr"
143913echo stdout:; cat "$at_stdout"
143914at_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"
143920at_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>&-
143923at_status=$? at_failed=false
143924$at_check_filter
143925echo stderr:; cat "$at_stderr"
143926echo stdout:; cat "$at_stdout"
143927at_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"
143936at_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>&-
143941at_status=$? at_failed=false
143942$at_check_filter
143943at_fn_diff_devnull "$at_stderr" || at_failed=:
143944$at_diff expout "$at_stdout" || at_failed=:
143945at_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"
143954at_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>&-
143959at_status=$? at_failed=false
143960$at_check_filter
143961at_fn_diff_devnull "$at_stderr" || at_failed=:
143962$at_diff expout "$at_stdout" || at_failed=:
143963at_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
143969fi
143970{ set +x
143971$as_echo "$at_srcdir/regression.at:1069: bison -t -o input.c input.y"
143972at_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>&-
143975at_status=$? at_failed=false
143976$at_check_filter
143977at_fn_diff_devnull "$at_stderr" || at_failed=:
143978at_fn_diff_devnull "$at_stdout" || at_failed=:
143979at_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"
143986at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1070"
143987( $at_check_trace; $BISON_C_WORKS
143988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
143989at_status=$? at_failed=false
143990$at_check_filter
143991echo stderr:; cat "$at_stderr"
143992echo stdout:; cat "$at_stdout"
143993at_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"
143999at_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>&-
144002at_status=$? at_failed=false
144003$at_check_filter
144004echo stderr:; cat "$at_stderr"
144005echo stdout:; cat "$at_stdout"
144006at_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"
144012at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1071"
144013( $at_check_trace;  $PREPARSER ./input
144014) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144015at_status=$? at_failed=false
144016$at_check_filter
144017echo stderr:; tee stderr <"$at_stderr"
144018echo >>"$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=:
144021at_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"
144027at_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>&-
144030at_status=$? at_failed=false
144031$at_check_filter
144032echo >>"$at_stderr"; $as_echo "Starting parse
144033Entering state 0
144034Reducing stack by rule 1 (line 20):
144035-> \$\$ = nterm start ()
144036Stack now 0
144037Entering state 1
144038Reading a token: Next token is token 'a' (PRINTER)
144039syntax error, unexpected 'a', expecting \$end
144040Error: popping nterm start ()
144041Stack now 0
144042Cleanup: discarding lookahead token 'a' (PRINTER)
144043DESTRUCTOR
144044Stack now 0
144045" | \
144046  $at_diff - "$at_stderr" || at_failed=:
144047at_fn_diff_devnull "$at_stdout" || at_failed=:
144048at_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
144057read at_status <"$at_status_file"
144058#AT_STOP_288
144059#AT_START_289
144060at_fn_group_banner 289 'regression.at:1097' \
144061  "String alias declared after use" "                " 17
144062at_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
144073cat >input.y <<'_ATEOF'
144074%%
144075start: 'a' "A" 'b';
144076%token 'a' "A";
144077_ATEOF
144078
144079
144080if 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"
144088at_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>&-
144092at_status=$? at_failed=false
144093$at_check_filter
144094echo stderr:; cat "$at_stderr"
144095echo stdout:; cat "$at_stdout"
144096at_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"
144102at_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>&-
144105at_status=$? at_failed=false
144106$at_check_filter
144107echo stderr:; cat "$at_stderr"
144108echo stdout:; cat "$at_stdout"
144109at_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"
144118at_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>&-
144123at_status=$? at_failed=false
144124$at_check_filter
144125at_fn_diff_devnull "$at_stderr" || at_failed=:
144126$at_diff expout "$at_stdout" || at_failed=:
144127at_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"
144136at_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>&-
144141at_status=$? at_failed=false
144142$at_check_filter
144143at_fn_diff_devnull "$at_stderr" || at_failed=:
144144$at_diff expout "$at_stdout" || at_failed=:
144145at_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
144151fi
144152{ set +x
144153$as_echo "$at_srcdir/regression.at:1110: bison -t -o input.c input.y"
144154at_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>&-
144157at_status=$? at_failed=false
144158$at_check_filter
144159at_fn_diff_devnull "$at_stderr" || at_failed=:
144160at_fn_diff_devnull "$at_stdout" || at_failed=:
144161at_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
144170read at_status <"$at_status_file"
144171#AT_STOP_289
144172#AT_START_290
144173at_fn_group_banner 290 'regression.at:1120' \
144174  "Extra lookahead sets in report" "                 " 17
144175at_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
144188cat >input.y <<'_ATEOF'
144189%%
144190start: a | 'a' a 'a' ;
144191a: 'a' ;
144192_ATEOF
144193
144194
144195if 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"
144203at_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>&-
144207at_status=$? at_failed=false
144208$at_check_filter
144209echo stderr:; cat "$at_stderr"
144210echo stdout:; cat "$at_stdout"
144211at_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"
144217at_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>&-
144220at_status=$? at_failed=false
144221$at_check_filter
144222echo stderr:; cat "$at_stderr"
144223echo stdout:; cat "$at_stdout"
144224at_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"
144233at_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>&-
144238at_status=$? at_failed=false
144239$at_check_filter
144240at_fn_diff_devnull "$at_stderr" || at_failed=:
144241$at_diff expout "$at_stdout" || at_failed=:
144242at_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"
144251at_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>&-
144256at_status=$? at_failed=false
144257$at_check_filter
144258at_fn_diff_devnull "$at_stderr" || at_failed=:
144259$at_diff expout "$at_stdout" || at_failed=:
144260at_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
144266fi
144267{ set +x
144268$as_echo "$at_srcdir/regression.at:1135: bison --report=all input.y"
144269at_fn_check_prepare_trace "regression.at:1135"
144270( $at_check_trace; bison --report=all input.y
144271) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144272at_status=$? at_failed=false
144273$at_check_filter
144274at_fn_diff_devnull "$at_stderr" || at_failed=:
144275at_fn_diff_devnull "$at_stdout" || at_failed=:
144276at_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"
144283at_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>&-
144286at_status=$? at_failed=false
144287$at_check_filter
144288at_fn_diff_devnull "$at_stderr" || at_failed=:
144289echo >>"$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
144302State 2
144303" | \
144304  $at_diff - "$at_stdout" || at_failed=:
144305at_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
144313read at_status <"$at_status_file"
144314#AT_STOP_290
144315#AT_START_291
144316at_fn_group_banner 291 'regression.at:1161' \
144317  "Token number in precedence declaration" "         " 17
144318at_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
144327cat >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
144348start:
144349    TK1 sr_conflict "tok alias"
144350  | start %prec END
144351  ;
144352sr_conflict:
144353  TK2
144354  | TK2 "tok alias"
144355  ;
144356
144357%%
144358
144359#include <stdio.h>
144360/* A C error reporting function.  */
144361static
144362void yyerror ( const char *msg)
144363{
144364  fprintf (stderr, "%s\n", msg);
144365}
144366#include <assert.h>
144367static
144368int 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
144380int
144381main (void)
144382{
144383  return yyparse ();
144384}
144385_ATEOF
144386
144387
144388
144389
144390if 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"
144398at_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>&-
144402at_status=$? at_failed=false
144403$at_check_filter
144404echo stderr:; cat "$at_stderr"
144405echo stdout:; cat "$at_stdout"
144406at_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"
144412at_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>&-
144415at_status=$? at_failed=false
144416$at_check_filter
144417echo stderr:; cat "$at_stderr"
144418echo stdout:; cat "$at_stdout"
144419at_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"
144428at_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>&-
144433at_status=$? at_failed=false
144434$at_check_filter
144435at_fn_diff_devnull "$at_stderr" || at_failed=:
144436$at_diff expout "$at_stdout" || at_failed=:
144437at_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"
144446at_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>&-
144451at_status=$? at_failed=false
144452$at_check_filter
144453at_fn_diff_devnull "$at_stderr" || at_failed=:
144454$at_diff expout "$at_stdout" || at_failed=:
144455at_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
144461fi
144462{ set +x
144463$as_echo "$at_srcdir/regression.at:1201: bison -o input.c input.y"
144464at_fn_check_prepare_trace "regression.at:1201"
144465( $at_check_trace; bison -o input.c input.y
144466) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144467at_status=$? at_failed=false
144468$at_check_filter
144469echo >>"$at_stderr"; $as_echo "input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start
144470input.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=:
144473at_fn_diff_devnull "$at_stdout" || at_failed=:
144474at_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.
144481if 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"
144490at_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>&-
144493at_status=$? at_failed=false
144494$at_check_filter
144495echo stderr:; tee stderr <"$at_stderr"
144496$at_diff expout "$at_stdout" || at_failed=:
144497at_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'
144505input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start
144506input.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"
144536at_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>&-
144540at_status=$? at_failed=false
144541$at_check_filter
144542$at_diff experr "$at_stderr" || at_failed=:
144543at_fn_diff_devnull "$at_stdout" || at_failed=:
144544at_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"
144553at_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>&-
144556at_status=$? at_failed=false
144557$at_check_filter
144558$at_diff experr "$at_stderr" || at_failed=:
144559$at_diff expout "$at_stdout" || at_failed=:
144560at_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"
144570at_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>&-
144573at_status=$? at_failed=false
144574$at_check_filter
144575at_fn_diff_devnull "$at_stderr" || at_failed=:
144576$at_diff expout "$at_stdout" || at_failed=:
144577at_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"
144583at_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>&-
144586at_status=$? at_failed=false
144587$at_check_filter
144588at_fn_diff_devnull "$at_stderr" || at_failed=:
144589$at_diff expout "$at_stdout" || at_failed=:
144590at_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
144596fi
144597{ set +x
144598$as_echo "$at_srcdir/regression.at:1205: \$BISON_C_WORKS"
144599at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1205"
144600( $at_check_trace; $BISON_C_WORKS
144601) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144602at_status=$? at_failed=false
144603$at_check_filter
144604echo stderr:; cat "$at_stderr"
144605echo stdout:; cat "$at_stdout"
144606at_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"
144612at_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>&-
144615at_status=$? at_failed=false
144616$at_check_filter
144617echo stderr:; cat "$at_stderr"
144618echo stdout:; cat "$at_stdout"
144619at_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"
144625at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1206"
144626( $at_check_trace;  $PREPARSER ./input
144627) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144628at_status=$? at_failed=false
144629$at_check_filter
144630echo stderr:; tee stderr <"$at_stderr"
144631at_fn_diff_devnull "$at_stdout" || at_failed=:
144632at_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"
144638at_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>&-
144641at_status=$? at_failed=false
144642$at_check_filter
144643at_fn_diff_devnull "$at_stderr" || at_failed=:
144644at_fn_diff_devnull "$at_stdout" || at_failed=:
144645at_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
144654read at_status <"$at_status_file"
144655#AT_STOP_291
144656#AT_START_292
144657at_fn_group_banner 292 'regression.at:1219' \
144658  "parse-gram.y: LALR = IELR" "                      " 17
144659at_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.
144667cp $abs_top_srcdir/src/parse-gram.y input.y
144668if 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"
144676at_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>&-
144680at_status=$? at_failed=false
144681$at_check_filter
144682echo stderr:; cat "$at_stderr"
144683echo stdout:; cat "$at_stdout"
144684at_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"
144690at_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>&-
144693at_status=$? at_failed=false
144694$at_check_filter
144695echo stderr:; cat "$at_stderr"
144696echo stdout:; cat "$at_stdout"
144697at_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"
144706at_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>&-
144711at_status=$? at_failed=false
144712$at_check_filter
144713at_fn_diff_devnull "$at_stderr" || at_failed=:
144714$at_diff expout "$at_stdout" || at_failed=:
144715at_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"
144724at_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>&-
144729at_status=$? at_failed=false
144730$at_check_filter
144731at_fn_diff_devnull "$at_stderr" || at_failed=:
144732$at_diff expout "$at_stdout" || at_failed=:
144733at_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
144739fi
144740{ set +x
144741$as_echo "$at_srcdir/regression.at:1224: bison -o input.c -Dlr.type=lalr input.y"
144742at_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>&-
144745at_status=$? at_failed=false
144746$at_check_filter
144747at_fn_diff_devnull "$at_stderr" || at_failed=:
144748at_fn_diff_devnull "$at_stdout" || at_failed=:
144749at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
144750$at_failed && at_fn_log_failure
144751$at_traceon; }
144752
144753
144754mv input.c lalr.c
144755
144756if 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"
144764at_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>&-
144768at_status=$? at_failed=false
144769$at_check_filter
144770echo stderr:; cat "$at_stderr"
144771echo stdout:; cat "$at_stdout"
144772at_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"
144779at_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>&-
144782at_status=$? at_failed=false
144783$at_check_filter
144784echo stderr:; cat "$at_stderr"
144785echo stdout:; cat "$at_stdout"
144786at_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"
144796at_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>&-
144801at_status=$? at_failed=false
144802$at_check_filter
144803at_fn_diff_devnull "$at_stderr" || at_failed=:
144804$at_diff expout "$at_stdout" || at_failed=:
144805at_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"
144815at_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>&-
144820at_status=$? at_failed=false
144821$at_check_filter
144822at_fn_diff_devnull "$at_stderr" || at_failed=:
144823$at_diff expout "$at_stdout" || at_failed=:
144824at_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
144831fi
144832{ set +x
144833$as_echo "$at_srcdir/regression.at:1227: bison -o input.c -Dlr.type=ielr input.y"
144834at_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>&-
144837at_status=$? at_failed=false
144838$at_check_filter
144839at_fn_diff_devnull "$at_stderr" || at_failed=:
144840at_fn_diff_devnull "$at_stdout" || at_failed=:
144841at_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
144847mv input.c ielr.c
144848
144849{ set +x
144850$as_echo "$at_srcdir/regression.at:1230: diff lalr.c ielr.c"
144851at_fn_check_prepare_trace "regression.at:1230"
144852( $at_check_trace; diff lalr.c ielr.c
144853) >>"$at_stdout" 2>>"$at_stderr" 5>&-
144854at_status=$? at_failed=false
144855$at_check_filter
144856at_fn_diff_devnull "$at_stderr" || at_failed=:
144857at_fn_diff_devnull "$at_stdout" || at_failed=:
144858at_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
144868read at_status <"$at_status_file"
144869#AT_STOP_292
144870#AT_START_293
144871at_fn_group_banner 293 'regression.at:1240' \
144872  "%error-verbose and YYSTACK_USE_ALLOCA" "          " 17
144873at_xfail=no
144874(
144875  $as_echo "293. $at_setup_line: testing $at_desc ..."
144876  $at_traceon
144877
144878
144879
144880cat >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
144900start: check syntax_error syntax_error ;
144901
144902check:
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.
144920syntax_error:
144921  "123456789112345678921234567893123456789412345678951234567896123A"
144922| "123456789112345678921234567893123456789412345678951234567896123B"
144923| error 'a' 'b' 'c'
144924;
144925
144926%%
144927
144928#include <stdio.h>
144929/* A C error reporting function.  */
144930static
144931void 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>
144939static
144940int 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}
144951int
144952main (void)
144953{
144954  return yyparse ();
144955}
144956_ATEOF
144957
144958
144959
144960
144961if 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"
144969at_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>&-
144973at_status=$? at_failed=false
144974$at_check_filter
144975echo stderr:; cat "$at_stderr"
144976echo stdout:; cat "$at_stdout"
144977at_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"
144983at_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>&-
144986at_status=$? at_failed=false
144987$at_check_filter
144988echo stderr:; cat "$at_stderr"
144989echo stdout:; cat "$at_stdout"
144990at_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"
144999at_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>&-
145004at_status=$? at_failed=false
145005$at_check_filter
145006at_fn_diff_devnull "$at_stderr" || at_failed=:
145007$at_diff expout "$at_stdout" || at_failed=:
145008at_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"
145017at_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>&-
145022at_status=$? at_failed=false
145023$at_check_filter
145024at_fn_diff_devnull "$at_stderr" || at_failed=:
145025$at_diff expout "$at_stdout" || at_failed=:
145026at_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
145032fi
145033{ set +x
145034$as_echo "$at_srcdir/regression.at:1296: bison -o input.c input.y"
145035at_fn_check_prepare_trace "regression.at:1296"
145036( $at_check_trace; bison -o input.c input.y
145037) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145038at_status=$? at_failed=false
145039$at_check_filter
145040at_fn_diff_devnull "$at_stderr" || at_failed=:
145041at_fn_diff_devnull "$at_stdout" || at_failed=:
145042at_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"
145049at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1297"
145050( $at_check_trace; $BISON_C_WORKS
145051) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145052at_status=$? at_failed=false
145053$at_check_filter
145054echo stderr:; cat "$at_stderr"
145055echo stdout:; cat "$at_stdout"
145056at_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"
145062at_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>&-
145065at_status=$? at_failed=false
145066$at_check_filter
145067echo stderr:; cat "$at_stderr"
145068echo stdout:; cat "$at_stdout"
145069at_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"
145075at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1298"
145076( $at_check_trace;  $PREPARSER ./input
145077) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145078at_status=$? at_failed=false
145079$at_check_filter
145080echo stderr:; tee stderr <"$at_stderr"
145081at_fn_diff_devnull "$at_stdout" || at_failed=:
145082at_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"
145088at_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>&-
145091at_status=$? at_failed=false
145092$at_check_filter
145093echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
145094syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
145095" | \
145096  $at_diff - "$at_stderr" || at_failed=:
145097at_fn_diff_devnull "$at_stdout" || at_failed=:
145098at_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
145107read at_status <"$at_status_file"
145108#AT_STOP_293
145109#AT_START_294
145110at_fn_group_banner 294 'regression.at:1319' \
145111  "%error-verbose overflow" "                        " 17
145112at_xfail=no
145113(
145114  $as_echo "294. $at_setup_line: testing $at_desc ..."
145115  $at_traceon
145116
145117
145118cat >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
145153start: 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.
145158syntax_error1:
145159  "123456789112345678921234567893123456789412345678951234567896123A"
145160| "123456789112345678921234567893123456789412345678951234567896123B"
145161| "123456789112345678921234567893123456789412345678951234567896123C"
145162| error 'a' 'b' 'c'
145163;
145164
145165check:
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.
145186syntax_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.  */
145198static
145199void 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>
145206static
145207int 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}
145218int
145219main (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
145231if 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"
145239at_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>&-
145243at_status=$? at_failed=false
145244$at_check_filter
145245echo stderr:; cat "$at_stderr"
145246echo stdout:; cat "$at_stdout"
145247at_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"
145253at_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>&-
145256at_status=$? at_failed=false
145257$at_check_filter
145258echo stderr:; cat "$at_stderr"
145259echo stdout:; cat "$at_stdout"
145260at_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"
145269at_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>&-
145274at_status=$? at_failed=false
145275$at_check_filter
145276at_fn_diff_devnull "$at_stderr" || at_failed=:
145277$at_diff expout "$at_stdout" || at_failed=:
145278at_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"
145287at_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>&-
145292at_status=$? at_failed=false
145293$at_check_filter
145294at_fn_diff_devnull "$at_stderr" || at_failed=:
145295$at_diff expout "$at_stdout" || at_failed=:
145296at_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
145302fi
145303{ set +x
145304$as_echo "$at_srcdir/regression.at:1406: bison -o input.c input.y"
145305at_fn_check_prepare_trace "regression.at:1406"
145306( $at_check_trace; bison -o input.c input.y
145307) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145308at_status=$? at_failed=false
145309$at_check_filter
145310at_fn_diff_devnull "$at_stderr" || at_failed=:
145311at_fn_diff_devnull "$at_stdout" || at_failed=:
145312at_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.
145322CFLAGS="$NO_WERROR_CFLAGS"
145323{ set +x
145324$as_echo "$at_srcdir/regression.at:1413: \$BISON_C_WORKS"
145325at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1413"
145326( $at_check_trace; $BISON_C_WORKS
145327) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145328at_status=$? at_failed=false
145329$at_check_filter
145330echo stderr:; cat "$at_stderr"
145331echo stdout:; cat "$at_stdout"
145332at_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"
145338at_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>&-
145341at_status=$? at_failed=false
145342$at_check_filter
145343echo stderr:; cat "$at_stderr"
145344echo stdout:; cat "$at_stdout"
145345at_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"
145352at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1415"
145353( $at_check_trace;  $PREPARSER ./input
145354) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145355at_status=$? at_failed=false
145356$at_check_filter
145357echo stderr:; tee stderr <"$at_stderr"
145358at_fn_diff_devnull "$at_stdout" || at_failed=:
145359at_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"
145365at_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>&-
145368at_status=$? at_failed=false
145369$at_check_filter
145370echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C
145371syntax error
145372memory exhausted
145373" | \
145374  $at_diff - "$at_stderr" || at_failed=:
145375at_fn_diff_devnull "$at_stdout" || at_failed=:
145376at_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
145385read at_status <"$at_status_file"
145386#AT_STOP_294
145387#AT_START_295
145388at_fn_group_banner 295 'regression.at:1429' \
145389  "LAC: Exploratory stack" "                         " 17
145390at_xfail=no
145391(
145392  $as_echo "295. $at_setup_line: testing $at_desc ..."
145393  $at_traceon
145394
145395
145396
145397
145398
145399
145400
145401
145402cat >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
145425S: 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
145429A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
145430B: 'b' ;
145431C: /*empty*/ { printf ("consistent default reduction\n"); } ;
145432
145433%%
145434#include <stdio.h>
145435/* A C error reporting function.  */
145436static
145437void yyerror ( const char *msg)
145438{
145439  fprintf (stderr, "%s\n", msg);
145440}
145441int
145442yylex (void)
145443{
145444  static char const *input = "bbbbc";
145445  return *input++;
145446}
145447
145448int
145449main (void)
145450{
145451  yydebug = 1;
145452  return yyparse ();
145453}
145454_ATEOF
145455
145456
145457
145458if 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"
145468at_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>&-
145474at_status=$? at_failed=false
145475$at_check_filter
145476echo stderr:; cat "$at_stderr"
145477echo stdout:; cat "$at_stdout"
145478at_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"
145486at_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>&-
145491at_status=$? at_failed=false
145492$at_check_filter
145493echo stderr:; cat "$at_stderr"
145494echo stdout:; cat "$at_stdout"
145495at_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"
145504at_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>&-
145509at_status=$? at_failed=false
145510$at_check_filter
145511at_fn_diff_devnull "$at_stderr" || at_failed=:
145512$at_diff expout "$at_stdout" || at_failed=:
145513at_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"
145522at_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>&-
145527at_status=$? at_failed=false
145528$at_check_filter
145529at_fn_diff_devnull "$at_stderr" || at_failed=:
145530$at_diff expout "$at_stdout" || at_failed=:
145531at_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
145537fi
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"
145542at_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>&-
145547at_status=$? at_failed=false
145548$at_check_filter
145549echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
145550" | \
145551  $at_diff - "$at_stderr" || at_failed=:
145552at_fn_diff_devnull "$at_stdout" || at_failed=:
145553at_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"
145560at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1508"
145561( $at_check_trace; $BISON_C_WORKS
145562) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145563at_status=$? at_failed=false
145564$at_check_filter
145565echo stderr:; cat "$at_stderr"
145566echo stdout:; cat "$at_stdout"
145567at_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"
145573at_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>&-
145576at_status=$? at_failed=false
145577$at_check_filter
145578echo stderr:; cat "$at_stderr"
145579echo stdout:; cat "$at_stdout"
145580at_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"
145586at_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>&-
145589at_status=$? at_failed=false
145590$at_check_filter
145591echo stderr:; tee stderr <"$at_stderr"
145592at_fn_diff_devnull "$at_stdout" || at_failed=:
145593at_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"
145599at_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>&-
145602at_status=$? at_failed=false
145603$at_check_filter
145604at_fn_diff_devnull "$at_stderr" || at_failed=:
145605at_fn_diff_devnull "$at_stdout" || at_failed=:
145606at_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"
145616at_fn_check_prepare_trace "regression.at:1508"
145617( $at_check_trace; grep 'syntax error,' stderr.txt
145618) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145619at_status=$? at_failed=false
145620$at_check_filter
145621at_fn_diff_devnull "$at_stderr" || at_failed=:
145622echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
145623" | \
145624  $at_diff - "$at_stdout" || at_failed=:
145625at_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"
145635at_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>&-
145639at_status=$? at_failed=false
145640$at_check_filter
145641at_fn_diff_devnull "$at_stderr" || at_failed=:
145642echo >>"$at_stdout"; $as_echo "14" | \
145643  $at_diff - "$at_stdout" || at_failed=:
145644at_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"
145654at_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>&-
145658at_status=$? at_failed=false
145659$at_check_filter
145660at_fn_diff_devnull "$at_stderr" || at_failed=:
145661echo >>"$at_stdout"; $as_echo "2" | \
145662  $at_diff - "$at_stdout" || at_failed=:
145663at_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"
145673at_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>&-
145677at_status=$? at_failed=false
145678$at_check_filter
145679at_fn_diff_devnull "$at_stderr" || at_failed=:
145680echo >>"$at_stdout"; $as_echo "3" | \
145681  $at_diff - "$at_stdout" || at_failed=:
145682at_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
145693cat >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
145716S: 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
145720A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
145721B: 'b' ;
145722C: /*empty*/ { printf ("consistent default reduction\n"); } ;
145723
145724%%
145725#include <stdio.h>
145726/* A C error reporting function.  */
145727static
145728void yyerror ( const char *msg)
145729{
145730  fprintf (stderr, "%s\n", msg);
145731}
145732int
145733yylex (YYSTYPE *v)
145734{
145735  static char const *input = "bbbbc";
145736  *v = 0;
145737  return *input++;
145738}
145739
145740int
145741main (void)
145742{
145743  yydebug = 1;
145744  return yyparse ();
145745}
145746_ATEOF
145747
145748
145749
145750if 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"
145760at_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>&-
145766at_status=$? at_failed=false
145767$at_check_filter
145768echo stderr:; cat "$at_stderr"
145769echo stdout:; cat "$at_stdout"
145770at_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"
145778at_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>&-
145783at_status=$? at_failed=false
145784$at_check_filter
145785echo stderr:; cat "$at_stderr"
145786echo stdout:; cat "$at_stdout"
145787at_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"
145796at_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>&-
145801at_status=$? at_failed=false
145802$at_check_filter
145803at_fn_diff_devnull "$at_stderr" || at_failed=:
145804$at_diff expout "$at_stdout" || at_failed=:
145805at_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"
145814at_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>&-
145819at_status=$? at_failed=false
145820$at_check_filter
145821at_fn_diff_devnull "$at_stderr" || at_failed=:
145822$at_diff expout "$at_stdout" || at_failed=:
145823at_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
145829fi
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"
145834at_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>&-
145839at_status=$? at_failed=false
145840$at_check_filter
145841echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
145842" | \
145843  $at_diff - "$at_stderr" || at_failed=:
145844at_fn_diff_devnull "$at_stdout" || at_failed=:
145845at_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"
145852at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1509"
145853( $at_check_trace; $BISON_C_WORKS
145854) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145855at_status=$? at_failed=false
145856$at_check_filter
145857echo stderr:; cat "$at_stderr"
145858echo stdout:; cat "$at_stdout"
145859at_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"
145865at_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>&-
145868at_status=$? at_failed=false
145869$at_check_filter
145870echo stderr:; cat "$at_stderr"
145871echo stdout:; cat "$at_stdout"
145872at_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"
145878at_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>&-
145881at_status=$? at_failed=false
145882$at_check_filter
145883echo stderr:; tee stderr <"$at_stderr"
145884at_fn_diff_devnull "$at_stdout" || at_failed=:
145885at_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"
145891at_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>&-
145894at_status=$? at_failed=false
145895$at_check_filter
145896at_fn_diff_devnull "$at_stderr" || at_failed=:
145897at_fn_diff_devnull "$at_stdout" || at_failed=:
145898at_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"
145908at_fn_check_prepare_trace "regression.at:1509"
145909( $at_check_trace; grep 'syntax error,' stderr.txt
145910) >>"$at_stdout" 2>>"$at_stderr" 5>&-
145911at_status=$? at_failed=false
145912$at_check_filter
145913at_fn_diff_devnull "$at_stderr" || at_failed=:
145914echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
145915" | \
145916  $at_diff - "$at_stdout" || at_failed=:
145917at_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"
145927at_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>&-
145931at_status=$? at_failed=false
145932$at_check_filter
145933at_fn_diff_devnull "$at_stderr" || at_failed=:
145934echo >>"$at_stdout"; $as_echo "14" | \
145935  $at_diff - "$at_stdout" || at_failed=:
145936at_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"
145946at_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>&-
145950at_status=$? at_failed=false
145951$at_check_filter
145952at_fn_diff_devnull "$at_stderr" || at_failed=:
145953echo >>"$at_stdout"; $as_echo "2" | \
145954  $at_diff - "$at_stdout" || at_failed=:
145955at_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"
145965at_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>&-
145969at_status=$? at_failed=false
145970$at_check_filter
145971at_fn_diff_devnull "$at_stderr" || at_failed=:
145972echo >>"$at_stdout"; $as_echo "3" | \
145973  $at_diff - "$at_stdout" || at_failed=:
145974at_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
145985cat >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
146008S: 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
146012A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
146013B: 'b' ;
146014C: /*empty*/ { printf ("consistent default reduction\n"); } ;
146015
146016%%
146017#include <stdio.h>
146018/* A C error reporting function.  */
146019static
146020void yyerror ( const char *msg)
146021{
146022  fprintf (stderr, "%s\n", msg);
146023}
146024int
146025yylex (void)
146026{
146027  static char const *input = "bbbbc";
146028  return *input++;
146029}
146030
146031int
146032main (void)
146033{
146034  yydebug = 1;
146035  return yyparse ();
146036}
146037_ATEOF
146038
146039
146040
146041if 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"
146051at_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>&-
146057at_status=$? at_failed=false
146058$at_check_filter
146059echo stderr:; cat "$at_stderr"
146060echo stdout:; cat "$at_stdout"
146061at_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"
146069at_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>&-
146074at_status=$? at_failed=false
146075$at_check_filter
146076echo stderr:; cat "$at_stderr"
146077echo stdout:; cat "$at_stdout"
146078at_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"
146087at_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>&-
146092at_status=$? at_failed=false
146093$at_check_filter
146094at_fn_diff_devnull "$at_stderr" || at_failed=:
146095$at_diff expout "$at_stdout" || at_failed=:
146096at_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"
146105at_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>&-
146110at_status=$? at_failed=false
146111$at_check_filter
146112at_fn_diff_devnull "$at_stderr" || at_failed=:
146113$at_diff expout "$at_stdout" || at_failed=:
146114at_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
146120fi
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"
146125at_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>&-
146130at_status=$? at_failed=false
146131$at_check_filter
146132echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
146133" | \
146134  $at_diff - "$at_stderr" || at_failed=:
146135at_fn_diff_devnull "$at_stdout" || at_failed=:
146136at_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"
146143at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510"
146144( $at_check_trace; $BISON_C_WORKS
146145) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146146at_status=$? at_failed=false
146147$at_check_filter
146148echo stderr:; cat "$at_stderr"
146149echo stdout:; cat "$at_stdout"
146150at_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"
146156at_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>&-
146159at_status=$? at_failed=false
146160$at_check_filter
146161echo stderr:; cat "$at_stderr"
146162echo stdout:; cat "$at_stdout"
146163at_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"
146169at_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>&-
146172at_status=$? at_failed=false
146173$at_check_filter
146174echo stderr:; tee stderr <"$at_stderr"
146175at_fn_diff_devnull "$at_stdout" || at_failed=:
146176at_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"
146182at_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>&-
146185at_status=$? at_failed=false
146186$at_check_filter
146187at_fn_diff_devnull "$at_stderr" || at_failed=:
146188at_fn_diff_devnull "$at_stdout" || at_failed=:
146189at_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"
146199at_fn_check_prepare_trace "regression.at:1510"
146200( $at_check_trace; grep 'syntax error,' stderr.txt
146201) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146202at_status=$? at_failed=false
146203$at_check_filter
146204at_fn_diff_devnull "$at_stderr" || at_failed=:
146205echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
146206" | \
146207  $at_diff - "$at_stdout" || at_failed=:
146208at_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"
146218at_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>&-
146222at_status=$? at_failed=false
146223$at_check_filter
146224at_fn_diff_devnull "$at_stderr" || at_failed=:
146225echo >>"$at_stdout"; $as_echo "14" | \
146226  $at_diff - "$at_stdout" || at_failed=:
146227at_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"
146237at_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>&-
146241at_status=$? at_failed=false
146242$at_check_filter
146243at_fn_diff_devnull "$at_stderr" || at_failed=:
146244echo >>"$at_stdout"; $as_echo "2" | \
146245  $at_diff - "$at_stdout" || at_failed=:
146246at_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"
146256at_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>&-
146260at_status=$? at_failed=false
146261$at_check_filter
146262at_fn_diff_devnull "$at_stderr" || at_failed=:
146263echo >>"$at_stdout"; $as_echo "3" | \
146264  $at_diff - "$at_stdout" || at_failed=:
146265at_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
146276cat >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
146299S: 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
146303A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
146304B: 'b' ;
146305C: /*empty*/ { printf ("consistent default reduction\n"); } ;
146306
146307%%
146308#include <stdio.h>
146309/* A C error reporting function.  */
146310static
146311void yyerror ( const char *msg)
146312{
146313  fprintf (stderr, "%s\n", msg);
146314}
146315int
146316yylex (YYSTYPE *v)
146317{
146318  static char const *input = "bbbbc";
146319  *v = 0;
146320  return *input++;
146321}
146322
146323int
146324main (void)
146325{
146326  yydebug = 1;
146327  return yyparse ();
146328}
146329_ATEOF
146330
146331
146332
146333if 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"
146343at_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>&-
146349at_status=$? at_failed=false
146350$at_check_filter
146351echo stderr:; cat "$at_stderr"
146352echo stdout:; cat "$at_stdout"
146353at_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"
146361at_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>&-
146366at_status=$? at_failed=false
146367$at_check_filter
146368echo stderr:; cat "$at_stderr"
146369echo stdout:; cat "$at_stdout"
146370at_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"
146379at_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>&-
146384at_status=$? at_failed=false
146385$at_check_filter
146386at_fn_diff_devnull "$at_stderr" || at_failed=:
146387$at_diff expout "$at_stdout" || at_failed=:
146388at_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"
146397at_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>&-
146402at_status=$? at_failed=false
146403$at_check_filter
146404at_fn_diff_devnull "$at_stderr" || at_failed=:
146405$at_diff expout "$at_stdout" || at_failed=:
146406at_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
146412fi
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"
146417at_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>&-
146422at_status=$? at_failed=false
146423$at_check_filter
146424echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
146425" | \
146426  $at_diff - "$at_stderr" || at_failed=:
146427at_fn_diff_devnull "$at_stdout" || at_failed=:
146428at_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"
146435at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1511"
146436( $at_check_trace; $BISON_C_WORKS
146437) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146438at_status=$? at_failed=false
146439$at_check_filter
146440echo stderr:; cat "$at_stderr"
146441echo stdout:; cat "$at_stdout"
146442at_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"
146448at_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>&-
146451at_status=$? at_failed=false
146452$at_check_filter
146453echo stderr:; cat "$at_stderr"
146454echo stdout:; cat "$at_stdout"
146455at_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"
146461at_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>&-
146464at_status=$? at_failed=false
146465$at_check_filter
146466echo stderr:; tee stderr <"$at_stderr"
146467at_fn_diff_devnull "$at_stdout" || at_failed=:
146468at_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"
146474at_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>&-
146477at_status=$? at_failed=false
146478$at_check_filter
146479at_fn_diff_devnull "$at_stderr" || at_failed=:
146480at_fn_diff_devnull "$at_stdout" || at_failed=:
146481at_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"
146491at_fn_check_prepare_trace "regression.at:1511"
146492( $at_check_trace; grep 'syntax error,' stderr.txt
146493) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146494at_status=$? at_failed=false
146495$at_check_filter
146496at_fn_diff_devnull "$at_stderr" || at_failed=:
146497echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
146498" | \
146499  $at_diff - "$at_stdout" || at_failed=:
146500at_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"
146510at_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>&-
146514at_status=$? at_failed=false
146515$at_check_filter
146516at_fn_diff_devnull "$at_stderr" || at_failed=:
146517echo >>"$at_stdout"; $as_echo "14" | \
146518  $at_diff - "$at_stdout" || at_failed=:
146519at_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"
146529at_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>&-
146533at_status=$? at_failed=false
146534$at_check_filter
146535at_fn_diff_devnull "$at_stderr" || at_failed=:
146536echo >>"$at_stdout"; $as_echo "2" | \
146537  $at_diff - "$at_stdout" || at_failed=:
146538at_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"
146548at_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>&-
146552at_status=$? at_failed=false
146553$at_check_filter
146554at_fn_diff_devnull "$at_stderr" || at_failed=:
146555echo >>"$at_stdout"; $as_echo "3" | \
146556  $at_diff - "$at_stdout" || at_failed=:
146557at_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
146570read at_status <"$at_status_file"
146571#AT_STOP_295
146572#AT_START_296
146573at_fn_group_banner 296 'regression.at:1523' \
146574  "LAC: Memory exhaustion" "                         " 17
146575at_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
146585cat >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
146605S: A A A A A A A A A ;
146606A: /*empty*/ | 'a' ;
146607
146608%%
146609#include <stdio.h>
146610/* A C error reporting function.  */
146611static
146612void yyerror ( const char *msg)
146613{
146614  fprintf (stderr, "%s\n", msg);
146615}
146616#include <assert.h>
146617static
146618int 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}
146629int
146630main (void)
146631{
146632  yydebug = 1;
146633  return yyparse ();
146634}
146635_ATEOF
146636
146637
146638
146639if 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"
146648at_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>&-
146653at_status=$? at_failed=false
146654$at_check_filter
146655echo stderr:; cat "$at_stderr"
146656echo stdout:; cat "$at_stdout"
146657at_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"
146664at_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>&-
146668at_status=$? at_failed=false
146669$at_check_filter
146670echo stderr:; cat "$at_stderr"
146671echo stdout:; cat "$at_stdout"
146672at_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"
146681at_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>&-
146686at_status=$? at_failed=false
146687$at_check_filter
146688at_fn_diff_devnull "$at_stderr" || at_failed=:
146689$at_diff expout "$at_stdout" || at_failed=:
146690at_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"
146699at_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>&-
146704at_status=$? at_failed=false
146705$at_check_filter
146706at_fn_diff_devnull "$at_stderr" || at_failed=:
146707$at_diff expout "$at_stdout" || at_failed=:
146708at_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
146714fi
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"
146718at_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>&-
146722at_status=$? at_failed=false
146723$at_check_filter
146724echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce
146725" | \
146726  $at_diff - "$at_stderr" || at_failed=:
146727at_fn_diff_devnull "$at_stdout" || at_failed=:
146728at_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"
146735at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1562"
146736( $at_check_trace; $BISON_C_WORKS
146737) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146738at_status=$? at_failed=false
146739$at_check_filter
146740echo stderr:; cat "$at_stderr"
146741echo stdout:; cat "$at_stdout"
146742at_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"
146748at_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>&-
146751at_status=$? at_failed=false
146752$at_check_filter
146753echo stderr:; cat "$at_stderr"
146754echo stdout:; cat "$at_stdout"
146755at_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"
146763at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1563"
146764( $at_check_trace;  $PREPARSER ./input
146765) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146766at_status=$? at_failed=false
146767$at_check_filter
146768echo stderr:; tee stderr <"$at_stderr"
146769at_fn_diff_devnull "$at_stdout" || at_failed=:
146770at_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"
146776at_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>&-
146779at_status=$? at_failed=false
146780$at_check_filter
146781echo >>"$at_stderr"; $as_echo "Starting parse
146782Entering state 0
146783Reading a token: Now at end of input.
146784LAC: initial context established for \$end
146785LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
146786memory exhausted
146787Cleanup: discarding lookahead token \$end ()
146788Stack now 0
146789" | \
146790  $at_diff - "$at_stderr" || at_failed=:
146791at_fn_diff_devnull "$at_stdout" || at_failed=:
146792at_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
146801cat >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
146821S: A A A A A A A A A ;
146822A: /*empty*/ | 'a' ;
146823
146824%%
146825#include <stdio.h>
146826/* A C error reporting function.  */
146827static
146828void yyerror ( const char *msg)
146829{
146830  fprintf (stderr, "%s\n", msg);
146831}
146832#include <assert.h>
146833static
146834int 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}
146845int
146846main (void)
146847{
146848  yydebug = 1;
146849  return yyparse ();
146850}
146851_ATEOF
146852
146853
146854
146855if 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"
146864at_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>&-
146869at_status=$? at_failed=false
146870$at_check_filter
146871echo stderr:; cat "$at_stderr"
146872echo stdout:; cat "$at_stdout"
146873at_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"
146880at_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>&-
146884at_status=$? at_failed=false
146885$at_check_filter
146886echo stderr:; cat "$at_stderr"
146887echo stdout:; cat "$at_stdout"
146888at_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"
146897at_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>&-
146902at_status=$? at_failed=false
146903$at_check_filter
146904at_fn_diff_devnull "$at_stderr" || at_failed=:
146905$at_diff expout "$at_stdout" || at_failed=:
146906at_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"
146915at_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>&-
146920at_status=$? at_failed=false
146921$at_check_filter
146922at_fn_diff_devnull "$at_stderr" || at_failed=:
146923$at_diff expout "$at_stdout" || at_failed=:
146924at_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
146930fi
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"
146934at_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>&-
146938at_status=$? at_failed=false
146939$at_check_filter
146940echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce
146941" | \
146942  $at_diff - "$at_stderr" || at_failed=:
146943at_fn_diff_devnull "$at_stdout" || at_failed=:
146944at_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"
146951at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1576"
146952( $at_check_trace; $BISON_C_WORKS
146953) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146954at_status=$? at_failed=false
146955$at_check_filter
146956echo stderr:; cat "$at_stderr"
146957echo stdout:; cat "$at_stdout"
146958at_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"
146964at_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>&-
146967at_status=$? at_failed=false
146968$at_check_filter
146969echo stderr:; cat "$at_stderr"
146970echo stdout:; cat "$at_stdout"
146971at_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"
146979at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1577"
146980( $at_check_trace;  $PREPARSER ./input
146981) >>"$at_stdout" 2>>"$at_stderr" 5>&-
146982at_status=$? at_failed=false
146983$at_check_filter
146984echo stderr:; tee stderr <"$at_stderr"
146985at_fn_diff_devnull "$at_stdout" || at_failed=:
146986at_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"
146992at_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>&-
146995at_status=$? at_failed=false
146996$at_check_filter
146997echo >>"$at_stderr"; $as_echo "Starting parse
146998Entering state 0
146999Reading a token: Next token is token \$undefined ()
147000LAC: initial context established for \$undefined
147001LAC: checking lookahead \$undefined: Always Err
147002Constructing syntax error message
147003LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
147004syntax error
147005memory exhausted
147006Cleanup: discarding lookahead token \$undefined ()
147007Stack now 0
147008" | \
147009  $at_diff - "$at_stderr" || at_failed=:
147010at_fn_diff_devnull "$at_stdout" || at_failed=:
147011at_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
147022read at_status <"$at_status_file"
147023#AT_STOP_296
147024#AT_START_297
147025at_fn_group_banner 297 'regression.at:1664' \
147026  "Lex and parse params: yacc.c" "                   " 17
147027at_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.
147037cat >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%%
147067exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
147068%%
147069#include <stdio.h>
147070/* A C error reporting function.  */
147071static
147072void 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>
147081static
147082int 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
147098int
147099main (void)
147100{
147101  return !!yyparse(1, 2);
147102}
147103_ATEOF
147104
147105
147106
147107if 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"
147115at_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>&-
147119at_status=$? at_failed=false
147120$at_check_filter
147121echo stderr:; cat "$at_stderr"
147122echo stdout:; cat "$at_stdout"
147123at_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"
147129at_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>&-
147132at_status=$? at_failed=false
147133$at_check_filter
147134echo stderr:; cat "$at_stderr"
147135echo stdout:; cat "$at_stdout"
147136at_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"
147145at_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>&-
147150at_status=$? at_failed=false
147151$at_check_filter
147152at_fn_diff_devnull "$at_stderr" || at_failed=:
147153$at_diff expout "$at_stdout" || at_failed=:
147154at_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"
147163at_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>&-
147168at_status=$? at_failed=false
147169$at_check_filter
147170at_fn_diff_devnull "$at_stderr" || at_failed=:
147171$at_diff expout "$at_stdout" || at_failed=:
147172at_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
147178fi
147179{ set +x
147180$as_echo "$at_srcdir/regression.at:1664: bison -o input.c input.y"
147181at_fn_check_prepare_trace "regression.at:1664"
147182( $at_check_trace; bison -o input.c input.y
147183) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147184at_status=$? at_failed=false
147185$at_check_filter
147186at_fn_diff_devnull "$at_stderr" || at_failed=:
147187at_fn_diff_devnull "$at_stdout" || at_failed=:
147188at_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"
147195at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1664"
147196( $at_check_trace; $BISON_C_WORKS
147197) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147198at_status=$? at_failed=false
147199$at_check_filter
147200echo stderr:; cat "$at_stderr"
147201echo stdout:; cat "$at_stdout"
147202at_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"
147208at_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>&-
147211at_status=$? at_failed=false
147212$at_check_filter
147213echo stderr:; cat "$at_stderr"
147214echo stdout:; cat "$at_stdout"
147215at_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"
147222at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1664"
147223( $at_check_trace;  $PREPARSER ./input
147224) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147225at_status=$? at_failed=false
147226$at_check_filter
147227echo stderr:; tee stderr <"$at_stderr"
147228echo >>"$at_stdout"; $as_echo "x: 1, y: 2
147229" | \
147230  $at_diff - "$at_stdout" || at_failed=:
147231at_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"
147237at_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>&-
147240at_status=$? at_failed=false
147241$at_check_filter
147242at_fn_diff_devnull "$at_stderr" || at_failed=:
147243at_fn_diff_devnull "$at_stdout" || at_failed=:
147244at_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
147254read at_status <"$at_status_file"
147255#AT_STOP_297
147256#AT_START_298
147257at_fn_group_banner 298 'regression.at:1665' \
147258  "Lex and parse params: glr.c" "                    " 17
147259at_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.
147269cat >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%%
147299exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
147300%%
147301#include <stdio.h>
147302/* A C error reporting function.  */
147303static
147304void 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>
147313static
147314int 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
147330int
147331main (void)
147332{
147333  return !!yyparse(1, 2);
147334}
147335_ATEOF
147336
147337
147338
147339if 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"
147347at_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>&-
147351at_status=$? at_failed=false
147352$at_check_filter
147353echo stderr:; cat "$at_stderr"
147354echo stdout:; cat "$at_stdout"
147355at_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"
147361at_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>&-
147364at_status=$? at_failed=false
147365$at_check_filter
147366echo stderr:; cat "$at_stderr"
147367echo stdout:; cat "$at_stdout"
147368at_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"
147377at_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>&-
147382at_status=$? at_failed=false
147383$at_check_filter
147384at_fn_diff_devnull "$at_stderr" || at_failed=:
147385$at_diff expout "$at_stdout" || at_failed=:
147386at_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"
147395at_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>&-
147400at_status=$? at_failed=false
147401$at_check_filter
147402at_fn_diff_devnull "$at_stderr" || at_failed=:
147403$at_diff expout "$at_stdout" || at_failed=:
147404at_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
147410fi
147411{ set +x
147412$as_echo "$at_srcdir/regression.at:1665: bison -o input.c input.y"
147413at_fn_check_prepare_trace "regression.at:1665"
147414( $at_check_trace; bison -o input.c input.y
147415) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147416at_status=$? at_failed=false
147417$at_check_filter
147418at_fn_diff_devnull "$at_stderr" || at_failed=:
147419at_fn_diff_devnull "$at_stdout" || at_failed=:
147420at_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"
147427at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1665"
147428( $at_check_trace; $BISON_C_WORKS
147429) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147430at_status=$? at_failed=false
147431$at_check_filter
147432echo stderr:; cat "$at_stderr"
147433echo stdout:; cat "$at_stdout"
147434at_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"
147440at_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>&-
147443at_status=$? at_failed=false
147444$at_check_filter
147445echo stderr:; cat "$at_stderr"
147446echo stdout:; cat "$at_stdout"
147447at_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"
147454at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1665"
147455( $at_check_trace;  $PREPARSER ./input
147456) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147457at_status=$? at_failed=false
147458$at_check_filter
147459echo stderr:; tee stderr <"$at_stderr"
147460echo >>"$at_stdout"; $as_echo "x: 1, y: 2
147461" | \
147462  $at_diff - "$at_stdout" || at_failed=:
147463at_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"
147469at_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>&-
147472at_status=$? at_failed=false
147473$at_check_filter
147474at_fn_diff_devnull "$at_stderr" || at_failed=:
147475at_fn_diff_devnull "$at_stdout" || at_failed=:
147476at_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
147486read at_status <"$at_status_file"
147487#AT_STOP_298
147488#AT_START_299
147489at_fn_group_banner 299 'regression.at:1666' \
147490  "Lex and parse params: lalr1.cc" "                 " 17
147491at_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.
147501cat >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%%
147531exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
147532%%
147533/* A C++ error reporting function.  */
147534void
147535yy::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>
147541static
147542int 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
147556int
147557yyparse (int x, int y)
147558{
147559  yy::parser parser(x, y);
147560  return parser.parse ();
147561}
147562
147563
147564int
147565main (void)
147566{
147567  return !!yyparse(1, 2);
147568}
147569_ATEOF
147570
147571
147572
147573if 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"
147581at_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>&-
147585at_status=$? at_failed=false
147586$at_check_filter
147587echo stderr:; cat "$at_stderr"
147588echo stdout:; cat "$at_stdout"
147589at_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"
147595at_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>&-
147598at_status=$? at_failed=false
147599$at_check_filter
147600echo stderr:; cat "$at_stderr"
147601echo stdout:; cat "$at_stdout"
147602at_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"
147611at_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>&-
147616at_status=$? at_failed=false
147617$at_check_filter
147618at_fn_diff_devnull "$at_stderr" || at_failed=:
147619$at_diff expout "$at_stdout" || at_failed=:
147620at_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"
147629at_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>&-
147634at_status=$? at_failed=false
147635$at_check_filter
147636at_fn_diff_devnull "$at_stderr" || at_failed=:
147637$at_diff expout "$at_stdout" || at_failed=:
147638at_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
147644fi
147645{ set +x
147646$as_echo "$at_srcdir/regression.at:1666: bison -o input.cc input.y"
147647at_fn_check_prepare_trace "regression.at:1666"
147648( $at_check_trace; bison -o input.cc input.y
147649) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147650at_status=$? at_failed=false
147651$at_check_filter
147652at_fn_diff_devnull "$at_stderr" || at_failed=:
147653at_fn_diff_devnull "$at_stdout" || at_failed=:
147654at_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"
147662at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1666"
147663( $at_check_trace; $BISON_CXX_WORKS
147664) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147665at_status=$? at_failed=false
147666$at_check_filter
147667echo stderr:; cat "$at_stderr"
147668echo stdout:; cat "$at_stdout"
147669at_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"
147675at_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>&-
147678at_status=$? at_failed=false
147679$at_check_filter
147680echo stderr:; cat "$at_stderr"
147681echo stdout:; cat "$at_stdout"
147682at_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"
147689at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1666"
147690( $at_check_trace;  $PREPARSER ./input
147691) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147692at_status=$? at_failed=false
147693$at_check_filter
147694echo stderr:; tee stderr <"$at_stderr"
147695echo >>"$at_stdout"; $as_echo "x: 1, y: 2
147696" | \
147697  $at_diff - "$at_stdout" || at_failed=:
147698at_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"
147704at_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>&-
147707at_status=$? at_failed=false
147708$at_check_filter
147709at_fn_diff_devnull "$at_stderr" || at_failed=:
147710at_fn_diff_devnull "$at_stdout" || at_failed=:
147711at_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
147721read at_status <"$at_status_file"
147722#AT_STOP_299
147723#AT_START_300
147724at_fn_group_banner 300 'regression.at:1667' \
147725  "Lex and parse params: glr.cc" "                   " 17
147726at_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.
147736cat >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%%
147766exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
147767%%
147768/* A C++ error reporting function.  */
147769void
147770yy::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>
147776static
147777int 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
147791int
147792yyparse (int x, int y)
147793{
147794  yy::parser parser(x, y);
147795  return parser.parse ();
147796}
147797
147798
147799int
147800main (void)
147801{
147802  return !!yyparse(1, 2);
147803}
147804_ATEOF
147805
147806
147807
147808if 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"
147816at_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>&-
147820at_status=$? at_failed=false
147821$at_check_filter
147822echo stderr:; cat "$at_stderr"
147823echo stdout:; cat "$at_stdout"
147824at_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"
147830at_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>&-
147833at_status=$? at_failed=false
147834$at_check_filter
147835echo stderr:; cat "$at_stderr"
147836echo stdout:; cat "$at_stdout"
147837at_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"
147846at_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>&-
147851at_status=$? at_failed=false
147852$at_check_filter
147853at_fn_diff_devnull "$at_stderr" || at_failed=:
147854$at_diff expout "$at_stdout" || at_failed=:
147855at_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"
147864at_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>&-
147869at_status=$? at_failed=false
147870$at_check_filter
147871at_fn_diff_devnull "$at_stderr" || at_failed=:
147872$at_diff expout "$at_stdout" || at_failed=:
147873at_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
147879fi
147880{ set +x
147881$as_echo "$at_srcdir/regression.at:1667: bison -o input.cc input.y"
147882at_fn_check_prepare_trace "regression.at:1667"
147883( $at_check_trace; bison -o input.cc input.y
147884) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147885at_status=$? at_failed=false
147886$at_check_filter
147887at_fn_diff_devnull "$at_stderr" || at_failed=:
147888at_fn_diff_devnull "$at_stdout" || at_failed=:
147889at_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"
147897at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1667"
147898( $at_check_trace; $BISON_CXX_WORKS
147899) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147900at_status=$? at_failed=false
147901$at_check_filter
147902echo stderr:; cat "$at_stderr"
147903echo stdout:; cat "$at_stdout"
147904at_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"
147910at_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>&-
147913at_status=$? at_failed=false
147914$at_check_filter
147915echo stderr:; cat "$at_stderr"
147916echo stdout:; cat "$at_stdout"
147917at_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"
147924at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1667"
147925( $at_check_trace;  $PREPARSER ./input
147926) >>"$at_stdout" 2>>"$at_stderr" 5>&-
147927at_status=$? at_failed=false
147928$at_check_filter
147929echo stderr:; tee stderr <"$at_stderr"
147930echo >>"$at_stdout"; $as_echo "x: 1, y: 2
147931" | \
147932  $at_diff - "$at_stdout" || at_failed=:
147933at_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"
147939at_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>&-
147942at_status=$? at_failed=false
147943$at_check_filter
147944at_fn_diff_devnull "$at_stderr" || at_failed=:
147945at_fn_diff_devnull "$at_stdout" || at_failed=:
147946at_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
147956read at_status <"$at_status_file"
147957#AT_STOP_300
147958#AT_START_301
147959at_fn_group_banner 301 'c++.at:101' \
147960  "Doxygen Public Documentation" "                   " 18
147961at_xfail=no
147962(
147963  $as_echo "301. $at_setup_line: testing $at_desc ..."
147964  $at_traceon
147965
147966
147967
147968cat >input.yy <<'_ATEOF'
147969%skeleton "lalr1.cc"
147970%locations
147971%debug
147972%defines
147973%%
147974exp:;
147975%%
147976/* A C++ error reporting function.  */
147977void
147978yy::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
147986if 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"
147994at_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>&-
147998at_status=$? at_failed=false
147999$at_check_filter
148000echo stderr:; cat "$at_stderr"
148001echo stdout:; cat "$at_stdout"
148002at_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"
148008at_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>&-
148011at_status=$? at_failed=false
148012$at_check_filter
148013echo stderr:; cat "$at_stderr"
148014echo stdout:; cat "$at_stdout"
148015at_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"
148024at_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>&-
148029at_status=$? at_failed=false
148030$at_check_filter
148031at_fn_diff_devnull "$at_stderr" || at_failed=:
148032$at_diff expout "$at_stdout" || at_failed=:
148033at_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"
148042at_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>&-
148047at_status=$? at_failed=false
148048$at_check_filter
148049at_fn_diff_devnull "$at_stderr" || at_failed=:
148050$at_diff expout "$at_stdout" || at_failed=:
148051at_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
148057fi
148058{ set +x
148059$as_echo "$at_srcdir/c++.at:101: bison -o input.cc input.yy"
148060at_fn_check_prepare_trace "c++.at:101"
148061( $at_check_trace; bison -o input.cc input.yy
148062) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148063at_status=$? at_failed=false
148064$at_check_filter
148065at_fn_diff_devnull "$at_stderr" || at_failed=:
148066at_fn_diff_devnull "$at_stdout" || at_failed=:
148067at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
148068$at_failed && at_fn_log_failure
148069$at_traceon; }
148070
148071
148072
148073cat >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.
148076PROJECT_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.
148081QUIET = 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.
148086WARNINGS     = 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.
148090WARN_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.
148095WARN_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.
148100WARN_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
148107EXTRACT_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.
148111EXTRACT_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.
148115EXTRACT_STATIC         = NO
148116_ATEOF
148117
148118
148119{ set +x
148120$as_echo "$at_srcdir/c++.at:101: doxygen --version || exit 77"
148121at_fn_check_prepare_trace "c++.at:101"
148122( $at_check_trace; doxygen --version || exit 77
148123) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148124at_status=$? at_failed=false
148125$at_check_filter
148126at_fn_diff_devnull "$at_stderr" || at_failed=:
148127echo stdout:; cat "$at_stdout"
148128at_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"
148134at_fn_check_prepare_trace "c++.at:101"
148135( $at_check_trace; doxygen
148136) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148137at_status=$? at_failed=false
148138$at_check_filter
148139echo stderr:; cat "$at_stderr"
148140at_fn_diff_devnull "$at_stdout" || at_failed=:
148141at_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
148150read at_status <"$at_status_file"
148151#AT_STOP_301
148152#AT_START_302
148153at_fn_group_banner 302 'c++.at:102' \
148154  "Doxygen Private Documentation" "                  " 18
148155at_xfail=no
148156(
148157  $as_echo "302. $at_setup_line: testing $at_desc ..."
148158  $at_traceon
148159
148160
148161
148162cat >input.yy <<'_ATEOF'
148163%skeleton "lalr1.cc"
148164%locations
148165%debug
148166%defines
148167%%
148168exp:;
148169%%
148170/* A C++ error reporting function.  */
148171void
148172yy::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
148180if 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"
148188at_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>&-
148192at_status=$? at_failed=false
148193$at_check_filter
148194echo stderr:; cat "$at_stderr"
148195echo stdout:; cat "$at_stdout"
148196at_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"
148202at_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>&-
148205at_status=$? at_failed=false
148206$at_check_filter
148207echo stderr:; cat "$at_stderr"
148208echo stdout:; cat "$at_stdout"
148209at_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"
148218at_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>&-
148223at_status=$? at_failed=false
148224$at_check_filter
148225at_fn_diff_devnull "$at_stderr" || at_failed=:
148226$at_diff expout "$at_stdout" || at_failed=:
148227at_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"
148236at_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>&-
148241at_status=$? at_failed=false
148242$at_check_filter
148243at_fn_diff_devnull "$at_stderr" || at_failed=:
148244$at_diff expout "$at_stdout" || at_failed=:
148245at_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
148251fi
148252{ set +x
148253$as_echo "$at_srcdir/c++.at:102: bison -o input.cc input.yy"
148254at_fn_check_prepare_trace "c++.at:102"
148255( $at_check_trace; bison -o input.cc input.yy
148256) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148257at_status=$? at_failed=false
148258$at_check_filter
148259at_fn_diff_devnull "$at_stderr" || at_failed=:
148260at_fn_diff_devnull "$at_stdout" || at_failed=:
148261at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
148262$at_failed && at_fn_log_failure
148263$at_traceon; }
148264
148265
148266
148267cat >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.
148270PROJECT_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.
148275QUIET = 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.
148280WARNINGS     = 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.
148284WARN_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.
148289WARN_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.
148294WARN_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
148301EXTRACT_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.
148305EXTRACT_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.
148309EXTRACT_STATIC         = YES
148310_ATEOF
148311
148312
148313{ set +x
148314$as_echo "$at_srcdir/c++.at:102: doxygen --version || exit 77"
148315at_fn_check_prepare_trace "c++.at:102"
148316( $at_check_trace; doxygen --version || exit 77
148317) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148318at_status=$? at_failed=false
148319$at_check_filter
148320at_fn_diff_devnull "$at_stderr" || at_failed=:
148321echo stdout:; cat "$at_stdout"
148322at_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"
148328at_fn_check_prepare_trace "c++.at:102"
148329( $at_check_trace; doxygen
148330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148331at_status=$? at_failed=false
148332$at_check_filter
148333echo stderr:; cat "$at_stderr"
148334at_fn_diff_devnull "$at_stdout" || at_failed=:
148335at_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
148344read at_status <"$at_status_file"
148345#AT_STOP_302
148346#AT_START_303
148347at_fn_group_banner 303 'c++.at:160' \
148348  "Relative namespace references" "                  " 18
148349at_xfail=no
148350(
148351  $as_echo "303. $at_setup_line: testing $at_desc ..."
148352  $at_traceon
148353
148354
148355
148356cat >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
148381start: ;
148382
148383%%
148384
148385void
148386foo::parser::error (const foo::parser::location_type &loc,
148387                     const std::string &msg)
148388{
148389  std::cerr << "At " << loc << ": " << msg << std::endl;
148390}
148391
148392int
148393main (void)
148394{
148395  foo::parser p;
148396  return p.parse ();
148397}
148398_ATEOF
148399
148400
148401
148402if 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"
148410at_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>&-
148414at_status=$? at_failed=false
148415$at_check_filter
148416echo stderr:; cat "$at_stderr"
148417echo stdout:; cat "$at_stdout"
148418at_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"
148424at_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>&-
148427at_status=$? at_failed=false
148428$at_check_filter
148429echo stderr:; cat "$at_stderr"
148430echo stdout:; cat "$at_stdout"
148431at_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"
148440at_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>&-
148445at_status=$? at_failed=false
148446$at_check_filter
148447at_fn_diff_devnull "$at_stderr" || at_failed=:
148448$at_diff expout "$at_stdout" || at_failed=:
148449at_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"
148458at_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>&-
148463at_status=$? at_failed=false
148464$at_check_filter
148465at_fn_diff_devnull "$at_stderr" || at_failed=:
148466$at_diff expout "$at_stdout" || at_failed=:
148467at_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
148473fi
148474{ set +x
148475$as_echo "$at_srcdir/c++.at:161: bison -o input.cc input.y"
148476at_fn_check_prepare_trace "c++.at:161"
148477( $at_check_trace; bison -o input.cc input.y
148478) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148479at_status=$? at_failed=false
148480$at_check_filter
148481at_fn_diff_devnull "$at_stderr" || at_failed=:
148482at_fn_diff_devnull "$at_stdout" || at_failed=:
148483at_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"
148492at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:161"
148493( $at_check_trace; $BISON_CXX_WORKS
148494) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148495at_status=$? at_failed=false
148496$at_check_filter
148497echo stderr:; cat "$at_stderr"
148498echo stdout:; cat "$at_stdout"
148499at_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"
148505at_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>&-
148508at_status=$? at_failed=false
148509$at_check_filter
148510echo stderr:; cat "$at_stderr"
148511echo stdout:; cat "$at_stdout"
148512at_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"
148518at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:161"
148519( $at_check_trace;  $PREPARSER ./input
148520) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148521at_status=$? at_failed=false
148522$at_check_filter
148523echo stderr:; tee stderr <"$at_stderr"
148524at_fn_diff_devnull "$at_stdout" || at_failed=:
148525at_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"
148531at_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>&-
148534at_status=$? at_failed=false
148535$at_check_filter
148536at_fn_diff_devnull "$at_stderr" || at_failed=:
148537at_fn_diff_devnull "$at_stdout" || at_failed=:
148538at_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
148547cat >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
148572start: ;
148573
148574%%
148575
148576void
148577foo::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
148583int
148584main (void)
148585{
148586  foo::bar::parser p;
148587  return p.parse ();
148588}
148589_ATEOF
148590
148591
148592
148593if 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"
148601at_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>&-
148605at_status=$? at_failed=false
148606$at_check_filter
148607echo stderr:; cat "$at_stderr"
148608echo stdout:; cat "$at_stdout"
148609at_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"
148615at_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>&-
148618at_status=$? at_failed=false
148619$at_check_filter
148620echo stderr:; cat "$at_stderr"
148621echo stdout:; cat "$at_stdout"
148622at_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"
148631at_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>&-
148636at_status=$? at_failed=false
148637$at_check_filter
148638at_fn_diff_devnull "$at_stderr" || at_failed=:
148639$at_diff expout "$at_stdout" || at_failed=:
148640at_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"
148649at_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>&-
148654at_status=$? at_failed=false
148655$at_check_filter
148656at_fn_diff_devnull "$at_stderr" || at_failed=:
148657$at_diff expout "$at_stdout" || at_failed=:
148658at_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
148664fi
148665{ set +x
148666$as_echo "$at_srcdir/c++.at:162: bison -o input.cc input.y"
148667at_fn_check_prepare_trace "c++.at:162"
148668( $at_check_trace; bison -o input.cc input.y
148669) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148670at_status=$? at_failed=false
148671$at_check_filter
148672at_fn_diff_devnull "$at_stderr" || at_failed=:
148673at_fn_diff_devnull "$at_stdout" || at_failed=:
148674at_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"
148683at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:162"
148684( $at_check_trace; $BISON_CXX_WORKS
148685) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148686at_status=$? at_failed=false
148687$at_check_filter
148688echo stderr:; cat "$at_stderr"
148689echo stdout:; cat "$at_stdout"
148690at_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"
148696at_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>&-
148699at_status=$? at_failed=false
148700$at_check_filter
148701echo stderr:; cat "$at_stderr"
148702echo stdout:; cat "$at_stdout"
148703at_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"
148709at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:162"
148710( $at_check_trace;  $PREPARSER ./input
148711) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148712at_status=$? at_failed=false
148713$at_check_filter
148714echo stderr:; tee stderr <"$at_stderr"
148715at_fn_diff_devnull "$at_stdout" || at_failed=:
148716at_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"
148722at_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>&-
148725at_status=$? at_failed=false
148726$at_check_filter
148727at_fn_diff_devnull "$at_stderr" || at_failed=:
148728at_fn_diff_devnull "$at_stdout" || at_failed=:
148729at_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
148738cat >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
148763start: ;
148764
148765%%
148766
148767void
148768foo::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
148774int
148775main (void)
148776{
148777  foo::bar::baz::parser p;
148778  return p.parse ();
148779}
148780_ATEOF
148781
148782
148783
148784if 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"
148792at_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>&-
148796at_status=$? at_failed=false
148797$at_check_filter
148798echo stderr:; cat "$at_stderr"
148799echo stdout:; cat "$at_stdout"
148800at_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"
148806at_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>&-
148809at_status=$? at_failed=false
148810$at_check_filter
148811echo stderr:; cat "$at_stderr"
148812echo stdout:; cat "$at_stdout"
148813at_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"
148822at_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>&-
148827at_status=$? at_failed=false
148828$at_check_filter
148829at_fn_diff_devnull "$at_stderr" || at_failed=:
148830$at_diff expout "$at_stdout" || at_failed=:
148831at_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"
148840at_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>&-
148845at_status=$? at_failed=false
148846$at_check_filter
148847at_fn_diff_devnull "$at_stderr" || at_failed=:
148848$at_diff expout "$at_stdout" || at_failed=:
148849at_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
148855fi
148856{ set +x
148857$as_echo "$at_srcdir/c++.at:163: bison -o input.cc input.y"
148858at_fn_check_prepare_trace "c++.at:163"
148859( $at_check_trace; bison -o input.cc input.y
148860) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148861at_status=$? at_failed=false
148862$at_check_filter
148863at_fn_diff_devnull "$at_stderr" || at_failed=:
148864at_fn_diff_devnull "$at_stdout" || at_failed=:
148865at_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"
148874at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:163"
148875( $at_check_trace; $BISON_CXX_WORKS
148876) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148877at_status=$? at_failed=false
148878$at_check_filter
148879echo stderr:; cat "$at_stderr"
148880echo stdout:; cat "$at_stdout"
148881at_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"
148887at_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>&-
148890at_status=$? at_failed=false
148891$at_check_filter
148892echo stderr:; cat "$at_stderr"
148893echo stdout:; cat "$at_stdout"
148894at_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"
148900at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:163"
148901( $at_check_trace;  $PREPARSER ./input
148902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
148903at_status=$? at_failed=false
148904$at_check_filter
148905echo stderr:; tee stderr <"$at_stderr"
148906at_fn_diff_devnull "$at_stdout" || at_failed=:
148907at_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"
148913at_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>&-
148916at_status=$? at_failed=false
148917$at_check_filter
148918at_fn_diff_devnull "$at_stderr" || at_failed=:
148919at_fn_diff_devnull "$at_stdout" || at_failed=:
148920at_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
148930read at_status <"$at_status_file"
148931#AT_STOP_303
148932#AT_START_304
148933at_fn_group_banner 304 'c++.at:166' \
148934  "Absolute namespace references" "                  " 18
148935at_xfail=no
148936(
148937  $as_echo "304. $at_setup_line: testing $at_desc ..."
148938  $at_traceon
148939
148940
148941
148942cat >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
148967start: ;
148968
148969%%
148970
148971void
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
148978int
148979main (void)
148980{
148981  ::foo::parser p;
148982  return p.parse ();
148983}
148984_ATEOF
148985
148986
148987
148988if 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"
148996at_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>&-
149000at_status=$? at_failed=false
149001$at_check_filter
149002echo stderr:; cat "$at_stderr"
149003echo stdout:; cat "$at_stdout"
149004at_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"
149010at_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>&-
149013at_status=$? at_failed=false
149014$at_check_filter
149015echo stderr:; cat "$at_stderr"
149016echo stdout:; cat "$at_stdout"
149017at_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"
149026at_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>&-
149031at_status=$? at_failed=false
149032$at_check_filter
149033at_fn_diff_devnull "$at_stderr" || at_failed=:
149034$at_diff expout "$at_stdout" || at_failed=:
149035at_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"
149044at_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>&-
149049at_status=$? at_failed=false
149050$at_check_filter
149051at_fn_diff_devnull "$at_stderr" || at_failed=:
149052$at_diff expout "$at_stdout" || at_failed=:
149053at_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
149059fi
149060{ set +x
149061$as_echo "$at_srcdir/c++.at:167: bison -o input.cc input.y"
149062at_fn_check_prepare_trace "c++.at:167"
149063( $at_check_trace; bison -o input.cc input.y
149064) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149065at_status=$? at_failed=false
149066$at_check_filter
149067at_fn_diff_devnull "$at_stderr" || at_failed=:
149068at_fn_diff_devnull "$at_stdout" || at_failed=:
149069at_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"
149078at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:167"
149079( $at_check_trace; $BISON_CXX_WORKS
149080) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149081at_status=$? at_failed=false
149082$at_check_filter
149083echo stderr:; cat "$at_stderr"
149084echo stdout:; cat "$at_stdout"
149085at_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"
149091at_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>&-
149094at_status=$? at_failed=false
149095$at_check_filter
149096echo stderr:; cat "$at_stderr"
149097echo stdout:; cat "$at_stdout"
149098at_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"
149104at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:167"
149105( $at_check_trace;  $PREPARSER ./input
149106) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149107at_status=$? at_failed=false
149108$at_check_filter
149109echo stderr:; tee stderr <"$at_stderr"
149110at_fn_diff_devnull "$at_stdout" || at_failed=:
149111at_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"
149117at_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>&-
149120at_status=$? at_failed=false
149121$at_check_filter
149122at_fn_diff_devnull "$at_stderr" || at_failed=:
149123at_fn_diff_devnull "$at_stdout" || at_failed=:
149124at_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
149133cat >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
149158start: ;
149159
149160%%
149161
149162void
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
149169int
149170main (void)
149171{
149172  ::foo::bar::parser p;
149173  return p.parse ();
149174}
149175_ATEOF
149176
149177
149178
149179if 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"
149187at_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>&-
149191at_status=$? at_failed=false
149192$at_check_filter
149193echo stderr:; cat "$at_stderr"
149194echo stdout:; cat "$at_stdout"
149195at_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"
149201at_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>&-
149204at_status=$? at_failed=false
149205$at_check_filter
149206echo stderr:; cat "$at_stderr"
149207echo stdout:; cat "$at_stdout"
149208at_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"
149217at_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>&-
149222at_status=$? at_failed=false
149223$at_check_filter
149224at_fn_diff_devnull "$at_stderr" || at_failed=:
149225$at_diff expout "$at_stdout" || at_failed=:
149226at_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"
149235at_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>&-
149240at_status=$? at_failed=false
149241$at_check_filter
149242at_fn_diff_devnull "$at_stderr" || at_failed=:
149243$at_diff expout "$at_stdout" || at_failed=:
149244at_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
149250fi
149251{ set +x
149252$as_echo "$at_srcdir/c++.at:168: bison -o input.cc input.y"
149253at_fn_check_prepare_trace "c++.at:168"
149254( $at_check_trace; bison -o input.cc input.y
149255) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149256at_status=$? at_failed=false
149257$at_check_filter
149258at_fn_diff_devnull "$at_stderr" || at_failed=:
149259at_fn_diff_devnull "$at_stdout" || at_failed=:
149260at_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"
149269at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:168"
149270( $at_check_trace; $BISON_CXX_WORKS
149271) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149272at_status=$? at_failed=false
149273$at_check_filter
149274echo stderr:; cat "$at_stderr"
149275echo stdout:; cat "$at_stdout"
149276at_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"
149282at_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>&-
149285at_status=$? at_failed=false
149286$at_check_filter
149287echo stderr:; cat "$at_stderr"
149288echo stdout:; cat "$at_stdout"
149289at_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"
149295at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:168"
149296( $at_check_trace;  $PREPARSER ./input
149297) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149298at_status=$? at_failed=false
149299$at_check_filter
149300echo stderr:; tee stderr <"$at_stderr"
149301at_fn_diff_devnull "$at_stdout" || at_failed=:
149302at_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"
149308at_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>&-
149311at_status=$? at_failed=false
149312$at_check_filter
149313at_fn_diff_devnull "$at_stderr" || at_failed=:
149314at_fn_diff_devnull "$at_stdout" || at_failed=:
149315at_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
149324cat >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
149349start: ;
149350
149351%%
149352
149353void
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
149360int
149361main (void)
149362{
149363  ::foo::bar::baz::parser p;
149364  return p.parse ();
149365}
149366_ATEOF
149367
149368
149369
149370if 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"
149378at_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>&-
149382at_status=$? at_failed=false
149383$at_check_filter
149384echo stderr:; cat "$at_stderr"
149385echo stdout:; cat "$at_stdout"
149386at_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"
149392at_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>&-
149395at_status=$? at_failed=false
149396$at_check_filter
149397echo stderr:; cat "$at_stderr"
149398echo stdout:; cat "$at_stdout"
149399at_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"
149408at_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>&-
149413at_status=$? at_failed=false
149414$at_check_filter
149415at_fn_diff_devnull "$at_stderr" || at_failed=:
149416$at_diff expout "$at_stdout" || at_failed=:
149417at_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"
149426at_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>&-
149431at_status=$? at_failed=false
149432$at_check_filter
149433at_fn_diff_devnull "$at_stderr" || at_failed=:
149434$at_diff expout "$at_stdout" || at_failed=:
149435at_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
149441fi
149442{ set +x
149443$as_echo "$at_srcdir/c++.at:169: bison -o input.cc input.y"
149444at_fn_check_prepare_trace "c++.at:169"
149445( $at_check_trace; bison -o input.cc input.y
149446) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149447at_status=$? at_failed=false
149448$at_check_filter
149449at_fn_diff_devnull "$at_stderr" || at_failed=:
149450at_fn_diff_devnull "$at_stdout" || at_failed=:
149451at_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"
149460at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:169"
149461( $at_check_trace; $BISON_CXX_WORKS
149462) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149463at_status=$? at_failed=false
149464$at_check_filter
149465echo stderr:; cat "$at_stderr"
149466echo stdout:; cat "$at_stdout"
149467at_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"
149473at_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>&-
149476at_status=$? at_failed=false
149477$at_check_filter
149478echo stderr:; cat "$at_stderr"
149479echo stdout:; cat "$at_stdout"
149480at_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"
149486at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:169"
149487( $at_check_trace;  $PREPARSER ./input
149488) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149489at_status=$? at_failed=false
149490$at_check_filter
149491echo stderr:; tee stderr <"$at_stderr"
149492at_fn_diff_devnull "$at_stdout" || at_failed=:
149493at_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"
149499at_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>&-
149502at_status=$? at_failed=false
149503$at_check_filter
149504at_fn_diff_devnull "$at_stderr" || at_failed=:
149505at_fn_diff_devnull "$at_stdout" || at_failed=:
149506at_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
149515cat >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
149540start: ;
149541
149542%%
149543
149544void
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
149551int
149552main (void)
149553{
149554  	::foo::parser p;
149555  return p.parse ();
149556}
149557_ATEOF
149558
149559
149560
149561if 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"
149569at_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>&-
149573at_status=$? at_failed=false
149574$at_check_filter
149575echo stderr:; cat "$at_stderr"
149576echo stdout:; cat "$at_stdout"
149577at_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"
149583at_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>&-
149586at_status=$? at_failed=false
149587$at_check_filter
149588echo stderr:; cat "$at_stderr"
149589echo stdout:; cat "$at_stdout"
149590at_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"
149599at_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>&-
149604at_status=$? at_failed=false
149605$at_check_filter
149606at_fn_diff_devnull "$at_stderr" || at_failed=:
149607$at_diff expout "$at_stdout" || at_failed=:
149608at_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"
149617at_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>&-
149622at_status=$? at_failed=false
149623$at_check_filter
149624at_fn_diff_devnull "$at_stderr" || at_failed=:
149625$at_diff expout "$at_stdout" || at_failed=:
149626at_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
149632fi
149633{ set +x
149634$as_echo "$at_srcdir/c++.at:170: bison -o input.cc input.y"
149635at_fn_check_prepare_trace "c++.at:170"
149636( $at_check_trace; bison -o input.cc input.y
149637) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149638at_status=$? at_failed=false
149639$at_check_filter
149640at_fn_diff_devnull "$at_stderr" || at_failed=:
149641at_fn_diff_devnull "$at_stdout" || at_failed=:
149642at_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"
149651at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:170"
149652( $at_check_trace; $BISON_CXX_WORKS
149653) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149654at_status=$? at_failed=false
149655$at_check_filter
149656echo stderr:; cat "$at_stderr"
149657echo stdout:; cat "$at_stdout"
149658at_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"
149664at_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>&-
149667at_status=$? at_failed=false
149668$at_check_filter
149669echo stderr:; cat "$at_stderr"
149670echo stdout:; cat "$at_stdout"
149671at_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"
149677at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:170"
149678( $at_check_trace;  $PREPARSER ./input
149679) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149680at_status=$? at_failed=false
149681$at_check_filter
149682echo stderr:; tee stderr <"$at_stderr"
149683at_fn_diff_devnull "$at_stdout" || at_failed=:
149684at_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"
149690at_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>&-
149693at_status=$? at_failed=false
149694$at_check_filter
149695at_fn_diff_devnull "$at_stderr" || at_failed=:
149696at_fn_diff_devnull "$at_stdout" || at_failed=:
149697at_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
149706cat >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
149731start: ;
149732
149733%%
149734
149735void
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
149742int
149743main (void)
149744{
149745    	 ::foo::bar::parser p;
149746  return p.parse ();
149747}
149748_ATEOF
149749
149750
149751
149752if 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"
149760at_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>&-
149764at_status=$? at_failed=false
149765$at_check_filter
149766echo stderr:; cat "$at_stderr"
149767echo stdout:; cat "$at_stdout"
149768at_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"
149774at_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>&-
149777at_status=$? at_failed=false
149778$at_check_filter
149779echo stderr:; cat "$at_stderr"
149780echo stdout:; cat "$at_stdout"
149781at_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"
149790at_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>&-
149795at_status=$? at_failed=false
149796$at_check_filter
149797at_fn_diff_devnull "$at_stderr" || at_failed=:
149798$at_diff expout "$at_stdout" || at_failed=:
149799at_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"
149808at_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>&-
149813at_status=$? at_failed=false
149814$at_check_filter
149815at_fn_diff_devnull "$at_stderr" || at_failed=:
149816$at_diff expout "$at_stdout" || at_failed=:
149817at_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
149823fi
149824{ set +x
149825$as_echo "$at_srcdir/c++.at:171: bison -o input.cc input.y"
149826at_fn_check_prepare_trace "c++.at:171"
149827( $at_check_trace; bison -o input.cc input.y
149828) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149829at_status=$? at_failed=false
149830$at_check_filter
149831at_fn_diff_devnull "$at_stderr" || at_failed=:
149832at_fn_diff_devnull "$at_stdout" || at_failed=:
149833at_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"
149842at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:171"
149843( $at_check_trace; $BISON_CXX_WORKS
149844) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149845at_status=$? at_failed=false
149846$at_check_filter
149847echo stderr:; cat "$at_stderr"
149848echo stdout:; cat "$at_stdout"
149849at_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"
149855at_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>&-
149858at_status=$? at_failed=false
149859$at_check_filter
149860echo stderr:; cat "$at_stderr"
149861echo stdout:; cat "$at_stdout"
149862at_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"
149868at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:171"
149869( $at_check_trace;  $PREPARSER ./input
149870) >>"$at_stdout" 2>>"$at_stderr" 5>&-
149871at_status=$? at_failed=false
149872$at_check_filter
149873echo stderr:; tee stderr <"$at_stderr"
149874at_fn_diff_devnull "$at_stdout" || at_failed=:
149875at_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"
149881at_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>&-
149884at_status=$? at_failed=false
149885$at_check_filter
149886at_fn_diff_devnull "$at_stderr" || at_failed=:
149887at_fn_diff_devnull "$at_stdout" || at_failed=:
149888at_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
149897cat >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
149922start: ;
149923
149924%%
149925
149926void
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
149933int
149934main (void)
149935{
149936    ::foo::bar::baz::parser p;
149937  return p.parse ();
149938}
149939_ATEOF
149940
149941
149942
149943if 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"
149951at_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>&-
149955at_status=$? at_failed=false
149956$at_check_filter
149957echo stderr:; cat "$at_stderr"
149958echo stdout:; cat "$at_stdout"
149959at_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"
149965at_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>&-
149968at_status=$? at_failed=false
149969$at_check_filter
149970echo stderr:; cat "$at_stderr"
149971echo stdout:; cat "$at_stdout"
149972at_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"
149981at_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>&-
149986at_status=$? at_failed=false
149987$at_check_filter
149988at_fn_diff_devnull "$at_stderr" || at_failed=:
149989$at_diff expout "$at_stdout" || at_failed=:
149990at_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"
149999at_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>&-
150004at_status=$? at_failed=false
150005$at_check_filter
150006at_fn_diff_devnull "$at_stderr" || at_failed=:
150007$at_diff expout "$at_stdout" || at_failed=:
150008at_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
150014fi
150015{ set +x
150016$as_echo "$at_srcdir/c++.at:172: bison -o input.cc input.y"
150017at_fn_check_prepare_trace "c++.at:172"
150018( $at_check_trace; bison -o input.cc input.y
150019) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150020at_status=$? at_failed=false
150021$at_check_filter
150022at_fn_diff_devnull "$at_stderr" || at_failed=:
150023at_fn_diff_devnull "$at_stdout" || at_failed=:
150024at_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"
150033at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:172"
150034( $at_check_trace; $BISON_CXX_WORKS
150035) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150036at_status=$? at_failed=false
150037$at_check_filter
150038echo stderr:; cat "$at_stderr"
150039echo stdout:; cat "$at_stdout"
150040at_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"
150046at_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>&-
150049at_status=$? at_failed=false
150050$at_check_filter
150051echo stderr:; cat "$at_stderr"
150052echo stdout:; cat "$at_stdout"
150053at_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"
150059at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:172"
150060( $at_check_trace;  $PREPARSER ./input
150061) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150062at_status=$? at_failed=false
150063$at_check_filter
150064echo stderr:; tee stderr <"$at_stderr"
150065at_fn_diff_devnull "$at_stdout" || at_failed=:
150066at_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"
150072at_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>&-
150075at_status=$? at_failed=false
150076$at_check_filter
150077at_fn_diff_devnull "$at_stderr" || at_failed=:
150078at_fn_diff_devnull "$at_stdout" || at_failed=:
150079at_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
150089read at_status <"$at_status_file"
150090#AT_STOP_304
150091#AT_START_305
150092at_fn_group_banner 305 'c++.at:175' \
150093  "Syntactically invalid namespace references" "     " 18
150094at_xfail=no
150095(
150096  $as_echo "305. $at_setup_line: testing $at_desc ..."
150097  $at_traceon
150098
150099
150100
150101cat >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
150126start: ;
150127
150128%%
150129
150130void
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
150137int
150138main (void)
150139{
150140  :foo:bar::parser p;
150141  return p.parse ();
150142}
150143_ATEOF
150144
150145
150146
150147if 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"
150155at_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>&-
150159at_status=$? at_failed=false
150160$at_check_filter
150161echo stderr:; cat "$at_stderr"
150162echo stdout:; cat "$at_stdout"
150163at_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"
150169at_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>&-
150172at_status=$? at_failed=false
150173$at_check_filter
150174echo stderr:; cat "$at_stderr"
150175echo stdout:; cat "$at_stdout"
150176at_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"
150185at_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>&-
150190at_status=$? at_failed=false
150191$at_check_filter
150192at_fn_diff_devnull "$at_stderr" || at_failed=:
150193$at_diff expout "$at_stdout" || at_failed=:
150194at_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"
150203at_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>&-
150208at_status=$? at_failed=false
150209$at_check_filter
150210at_fn_diff_devnull "$at_stderr" || at_failed=:
150211$at_diff expout "$at_stdout" || at_failed=:
150212at_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
150218fi
150219{ set +x
150220$as_echo "$at_srcdir/c++.at:176: bison -o input.cc input.y"
150221at_fn_check_prepare_trace "c++.at:176"
150222( $at_check_trace; bison -o input.cc input.y
150223) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150224at_status=$? at_failed=false
150225$at_check_filter
150226at_fn_diff_devnull "$at_stderr" || at_failed=:
150227at_fn_diff_devnull "$at_stdout" || at_failed=:
150228at_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
150239cat >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
150264start: ;
150265
150266%%
150267
150268void
150269foo: :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
150275int
150276main (void)
150277{
150278  foo: :bar::parser p;
150279  return p.parse ();
150280}
150281_ATEOF
150282
150283
150284
150285if 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"
150293at_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>&-
150297at_status=$? at_failed=false
150298$at_check_filter
150299echo stderr:; cat "$at_stderr"
150300echo stdout:; cat "$at_stdout"
150301at_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"
150307at_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>&-
150310at_status=$? at_failed=false
150311$at_check_filter
150312echo stderr:; cat "$at_stderr"
150313echo stdout:; cat "$at_stdout"
150314at_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"
150323at_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>&-
150328at_status=$? at_failed=false
150329$at_check_filter
150330at_fn_diff_devnull "$at_stderr" || at_failed=:
150331$at_diff expout "$at_stdout" || at_failed=:
150332at_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"
150341at_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>&-
150346at_status=$? at_failed=false
150347$at_check_filter
150348at_fn_diff_devnull "$at_stderr" || at_failed=:
150349$at_diff expout "$at_stdout" || at_failed=:
150350at_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
150356fi
150357{ set +x
150358$as_echo "$at_srcdir/c++.at:177: bison -o input.cc input.y"
150359at_fn_check_prepare_trace "c++.at:177"
150360( $at_check_trace; bison -o input.cc input.y
150361) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150362at_status=$? at_failed=false
150363$at_check_filter
150364at_fn_diff_devnull "$at_stderr" || at_failed=:
150365at_fn_diff_devnull "$at_stdout" || at_failed=:
150366at_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
150379cat >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
150404start: ;
150405
150406%%
150407
150408void
150409foo[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
150415int
150416main (void)
150417{
150418  foo[3]::bar::baz::parser p;
150419  return p.parse ();
150420}
150421_ATEOF
150422
150423
150424
150425if 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"
150433at_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>&-
150437at_status=$? at_failed=false
150438$at_check_filter
150439echo stderr:; cat "$at_stderr"
150440echo stdout:; cat "$at_stdout"
150441at_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"
150447at_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>&-
150450at_status=$? at_failed=false
150451$at_check_filter
150452echo stderr:; cat "$at_stderr"
150453echo stdout:; cat "$at_stdout"
150454at_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"
150463at_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>&-
150468at_status=$? at_failed=false
150469$at_check_filter
150470at_fn_diff_devnull "$at_stderr" || at_failed=:
150471$at_diff expout "$at_stdout" || at_failed=:
150472at_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"
150481at_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>&-
150486at_status=$? at_failed=false
150487$at_check_filter
150488at_fn_diff_devnull "$at_stderr" || at_failed=:
150489$at_diff expout "$at_stdout" || at_failed=:
150490at_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
150496fi
150497{ set +x
150498$as_echo "$at_srcdir/c++.at:180: bison -o input.cc input.y"
150499at_fn_check_prepare_trace "c++.at:180"
150500( $at_check_trace; bison -o input.cc input.y
150501) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150502at_status=$? at_failed=false
150503$at_check_filter
150504at_fn_diff_devnull "$at_stderr" || at_failed=:
150505at_fn_diff_devnull "$at_stdout" || at_failed=:
150506at_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
150517cat >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
150542start: ;
150543
150544%%
150545
150546void
150547foo::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
150553int
150554main (void)
150555{
150556  foo::bar,baz::parser p;
150557  return p.parse ();
150558}
150559_ATEOF
150560
150561
150562
150563if 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"
150571at_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>&-
150575at_status=$? at_failed=false
150576$at_check_filter
150577echo stderr:; cat "$at_stderr"
150578echo stdout:; cat "$at_stdout"
150579at_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"
150585at_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>&-
150588at_status=$? at_failed=false
150589$at_check_filter
150590echo stderr:; cat "$at_stderr"
150591echo stdout:; cat "$at_stdout"
150592at_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"
150601at_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>&-
150606at_status=$? at_failed=false
150607$at_check_filter
150608at_fn_diff_devnull "$at_stderr" || at_failed=:
150609$at_diff expout "$at_stdout" || at_failed=:
150610at_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"
150619at_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>&-
150624at_status=$? at_failed=false
150625$at_check_filter
150626at_fn_diff_devnull "$at_stderr" || at_failed=:
150627$at_diff expout "$at_stdout" || at_failed=:
150628at_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
150634fi
150635{ set +x
150636$as_echo "$at_srcdir/c++.at:181: bison -o input.cc input.y"
150637at_fn_check_prepare_trace "c++.at:181"
150638( $at_check_trace; bison -o input.cc input.y
150639) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150640at_status=$? at_failed=false
150641$at_check_filter
150642at_fn_diff_devnull "$at_stderr" || at_failed=:
150643at_fn_diff_devnull "$at_stdout" || at_failed=:
150644at_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
150655cat >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
150680start: ;
150681
150682%%
150683
150684void
150685foo::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
150691int
150692main (void)
150693{
150694  foo::bar::(baz::parser p;
150695  return p.parse ();
150696}
150697_ATEOF
150698
150699
150700
150701if 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"
150709at_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>&-
150713at_status=$? at_failed=false
150714$at_check_filter
150715echo stderr:; cat "$at_stderr"
150716echo stdout:; cat "$at_stdout"
150717at_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"
150723at_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>&-
150726at_status=$? at_failed=false
150727$at_check_filter
150728echo stderr:; cat "$at_stderr"
150729echo stdout:; cat "$at_stdout"
150730at_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"
150739at_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>&-
150744at_status=$? at_failed=false
150745$at_check_filter
150746at_fn_diff_devnull "$at_stderr" || at_failed=:
150747$at_diff expout "$at_stdout" || at_failed=:
150748at_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"
150757at_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>&-
150762at_status=$? at_failed=false
150763$at_check_filter
150764at_fn_diff_devnull "$at_stderr" || at_failed=:
150765$at_diff expout "$at_stdout" || at_failed=:
150766at_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
150772fi
150773{ set +x
150774$as_echo "$at_srcdir/c++.at:182: bison -o input.cc input.y"
150775at_fn_check_prepare_trace "c++.at:182"
150776( $at_check_trace; bison -o input.cc input.y
150777) >>"$at_stdout" 2>>"$at_stderr" 5>&-
150778at_status=$? at_failed=false
150779$at_check_filter
150780at_fn_diff_devnull "$at_stderr" || at_failed=:
150781at_fn_diff_devnull "$at_stdout" || at_failed=:
150782at_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
150794read at_status <"$at_status_file"
150795#AT_STOP_305
150796#AT_START_306
150797at_fn_group_banner 306 'c++.at:190' \
150798  "Exception safety" "                               " 18
150799at_xfail=no
150800(
150801  $as_echo "306. $at_setup_line: testing $at_desc ..."
150802  $at_traceon
150803
150804
150805
150806
150807cat >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
150913start: list { delete $1; };
150914
150915list:
150916  item       { $$ = $1; }
150917| item list  { $$ = $1; delete $2; } // Right recursion to load the stack.
150918;
150919
150920item:
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
150934int
150935yylex (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.  */
150958void
150959yy::parser::error (const location_type& l, const std::string& m)
150960{
150961  YYUSE (l);
150962  throw std::runtime_error (m);
150963}
150964
150965int
150966main (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
151005if 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"
151013at_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>&-
151017at_status=$? at_failed=false
151018$at_check_filter
151019echo stderr:; cat "$at_stderr"
151020echo stdout:; cat "$at_stdout"
151021at_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"
151027at_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>&-
151030at_status=$? at_failed=false
151031$at_check_filter
151032echo stderr:; cat "$at_stderr"
151033echo stdout:; cat "$at_stdout"
151034at_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"
151043at_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>&-
151048at_status=$? at_failed=false
151049$at_check_filter
151050at_fn_diff_devnull "$at_stderr" || at_failed=:
151051$at_diff expout "$at_stdout" || at_failed=:
151052at_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"
151061at_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>&-
151066at_status=$? at_failed=false
151067$at_check_filter
151068at_fn_diff_devnull "$at_stderr" || at_failed=:
151069$at_diff expout "$at_stdout" || at_failed=:
151070at_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
151076fi
151077{ set +x
151078$as_echo "$at_srcdir/c++.at:382: bison -o input.cc --report=all input.yy"
151079at_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>&-
151082at_status=$? at_failed=false
151083$at_check_filter
151084at_fn_diff_devnull "$at_stderr" || at_failed=:
151085at_fn_diff_devnull "$at_stdout" || at_failed=:
151086at_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"
151094at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:383"
151095( $at_check_trace; $BISON_CXX_WORKS
151096) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151097at_status=$? at_failed=false
151098$at_check_filter
151099echo stderr:; cat "$at_stderr"
151100echo stdout:; cat "$at_stdout"
151101at_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"
151107at_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>&-
151110at_status=$? at_failed=false
151111$at_check_filter
151112echo stderr:; cat "$at_stderr"
151113echo stdout:; cat "$at_stdout"
151114at_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"
151121at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:385"
151122( $at_check_trace;  $PREPARSER ./input aaaas
151123) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151124at_status=$? at_failed=false
151125$at_check_filter
151126echo stderr:; tee stderr <"$at_stderr"
151127at_fn_diff_devnull "$at_stdout" || at_failed=:
151128at_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"
151134at_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>&-
151137at_status=$? at_failed=false
151138$at_check_filter
151139echo >>"$at_stderr"; $as_echo "exception caught: reduction
151140" | \
151141  $at_diff - "$at_stderr" || at_failed=:
151142at_fn_diff_devnull "$at_stdout" || at_failed=:
151143at_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"
151151at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:389"
151152( $at_check_trace;  $PREPARSER ./input aaaal
151153) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151154at_status=$? at_failed=false
151155$at_check_filter
151156echo stderr:; tee stderr <"$at_stderr"
151157at_fn_diff_devnull "$at_stdout" || at_failed=:
151158at_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"
151164at_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>&-
151167at_status=$? at_failed=false
151168$at_check_filter
151169echo >>"$at_stderr"; $as_echo "exception caught: yylex
151170" | \
151171  $at_diff - "$at_stderr" || at_failed=:
151172at_fn_diff_devnull "$at_stdout" || at_failed=:
151173at_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"
151181at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:393"
151182( $at_check_trace;  $PREPARSER ./input i
151183) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151184at_status=$? at_failed=false
151185$at_check_filter
151186echo stderr:; tee stderr <"$at_stderr"
151187at_fn_diff_devnull "$at_stdout" || at_failed=:
151188at_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"
151194at_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>&-
151197at_status=$? at_failed=false
151198$at_check_filter
151199echo >>"$at_stderr"; $as_echo "exception caught: initial-action
151200" | \
151201  $at_diff - "$at_stderr" || at_failed=:
151202at_fn_diff_devnull "$at_stdout" || at_failed=:
151203at_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"
151211at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:397"
151212( $at_check_trace;  $PREPARSER ./input aaaap
151213) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151214at_status=$? at_failed=false
151215$at_check_filter
151216echo stderr:; tee stderr <"$at_stderr"
151217at_fn_diff_devnull "$at_stdout" || at_failed=:
151218at_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"
151224at_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>&-
151227at_status=$? at_failed=false
151228$at_check_filter
151229at_fn_diff_devnull "$at_stderr" || at_failed=:
151230at_fn_diff_devnull "$at_stdout" || at_failed=:
151231at_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"
151239at_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>&-
151242at_status=$? at_failed=false
151243$at_check_filter
151244echo stderr:; tee stderr <"$at_stderr"
151245at_fn_diff_devnull "$at_stdout" || at_failed=:
151246at_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"
151252at_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>&-
151255at_status=$? at_failed=false
151256$at_check_filter
151257echo stderr:; tee stderr <"$at_stderr"
151258at_fn_diff_devnull "$at_stdout" || at_failed=:
151259at_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"
151266at_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>&-
151269at_status=$? at_failed=false
151270$at_check_filter
151271at_fn_diff_devnull "$at_stderr" || at_failed=:
151272echo stdout:; cat "$at_stdout"
151273at_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"
151280at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:402"
151281( $at_check_trace;  $PREPARSER ./input aaaae
151282) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151283at_status=$? at_failed=false
151284$at_check_filter
151285echo stderr:; tee stderr <"$at_stderr"
151286at_fn_diff_devnull "$at_stdout" || at_failed=:
151287at_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"
151293at_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>&-
151296at_status=$? at_failed=false
151297$at_check_filter
151298echo >>"$at_stderr"; $as_echo "exception caught: syntax error
151299" | \
151300  $at_diff - "$at_stderr" || at_failed=:
151301at_fn_diff_devnull "$at_stdout" || at_failed=:
151302at_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"
151310at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:406"
151311( $at_check_trace;  $PREPARSER ./input aaaaE
151312) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151313at_status=$? at_failed=false
151314$at_check_filter
151315echo stderr:; tee stderr <"$at_stderr"
151316at_fn_diff_devnull "$at_stdout" || at_failed=:
151317at_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"
151323at_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>&-
151326at_status=$? at_failed=false
151327$at_check_filter
151328echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a'
151329" | \
151330  $at_diff - "$at_stderr" || at_failed=:
151331at_fn_diff_devnull "$at_stdout" || at_failed=:
151332at_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"
151340at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:410"
151341( $at_check_trace;  $PREPARSER ./input aaaaT
151342) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151343at_status=$? at_failed=false
151344$at_check_filter
151345echo stderr:; tee stderr <"$at_stderr"
151346at_fn_diff_devnull "$at_stdout" || at_failed=:
151347at_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"
151353at_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>&-
151356at_status=$? at_failed=false
151357$at_check_filter
151358at_fn_diff_devnull "$at_stderr" || at_failed=:
151359at_fn_diff_devnull "$at_stdout" || at_failed=:
151360at_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"
151369at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:413"
151370( $at_check_trace;  $PREPARSER ./input aaaaR
151371) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151372at_status=$? at_failed=false
151373$at_check_filter
151374echo stderr:; tee stderr <"$at_stderr"
151375at_fn_diff_devnull "$at_stdout" || at_failed=:
151376at_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"
151382at_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>&-
151385at_status=$? at_failed=false
151386$at_check_filter
151387at_fn_diff_devnull "$at_stderr" || at_failed=:
151388at_fn_diff_devnull "$at_stdout" || at_failed=:
151389at_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
151400read at_status <"$at_status_file"
151401#AT_STOP_306
151402#AT_START_307
151403at_fn_group_banner 307 'java.at:360' \
151404  "Calculator " "                                    " 19
151405at_xfail=no
151406(
151407  $as_echo "307. $at_setup_line: testing $at_desc ..."
151408  $at_traceon
151409
151410
151411
151412
151413
151414cat >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%%
151453input:
151454  line
151455| input line
151456;
151457
151458line:
151459  '\n'
151460| exp '\n'
151461| error '\n'
151462;
151463
151464exp:
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%%
151487class 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
151541class 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
151584if 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"
151592at_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>&-
151596at_status=$? at_failed=false
151597$at_check_filter
151598echo stderr:; cat "$at_stderr"
151599echo stdout:; cat "$at_stdout"
151600at_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"
151606at_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>&-
151609at_status=$? at_failed=false
151610$at_check_filter
151611echo stderr:; cat "$at_stderr"
151612echo stdout:; cat "$at_stdout"
151613at_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"
151622at_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>&-
151627at_status=$? at_failed=false
151628$at_check_filter
151629at_fn_diff_devnull "$at_stderr" || at_failed=:
151630$at_diff expout "$at_stdout" || at_failed=:
151631at_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"
151640at_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>&-
151645at_status=$? at_failed=false
151646$at_check_filter
151647at_fn_diff_devnull "$at_stderr" || at_failed=:
151648$at_diff expout "$at_stdout" || at_failed=:
151649at_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
151655fi
151656{ set +x
151657$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
151658at_fn_check_prepare_trace "java.at:360"
151659( $at_check_trace; bison -o Calc.java Calc.y
151660) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151661at_status=$? at_failed=false
151662$at_check_filter
151663at_fn_diff_devnull "$at_stderr" || at_failed=:
151664at_fn_diff_devnull "$at_stdout" || at_failed=:
151665at_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"
151679at_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>&-
151682at_status=$? at_failed=false
151683$at_check_filter
151684echo stderr:; cat "$at_stderr"
151685echo stdout:; cat "$at_stdout"
151686at_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.
151692cat >input <<'_ATEOF'
1516931 + 2 * 3 = 7
1516941 + 2 * -3 = -5
151695
151696-1^2 = -1
151697(-1)^2 = 1
151698
151699---1 = -1
151700
1517011 - 2 - 3 = -4
1517021 - (2 - 3) = 2
151703
1517042^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"
151710at_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>&-
151713at_status=$? at_failed=false
151714$at_check_filter
151715echo stderr:; tee stderr <"$at_stderr"
151716at_fn_diff_devnull "$at_stdout" || at_failed=:
151717at_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.
151724cat >input <<'_ATEOF'
1517250 0
151726_ATEOF
151727
151728{ set +x
151729$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
151730at_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>&-
151733at_status=$? at_failed=false
151734$at_check_filter
151735echo stderr:; tee stderr <"$at_stderr"
151736at_fn_diff_devnull "$at_stdout" || at_failed=:
151737at_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.
151745cat >expout <<'_ATEOF'
1517461.2: syntax error, unexpected number
151747_ATEOF
151748
151749# 2. If locations are not used, remove them.
151750sed 's/^[-0-9.]*: //' expout >at-expout
151751mv at-expout expout
151752# 3. If error-verbose is not used, strip the`, unexpected....' part.
151753sed 's/syntax error, .*$/syntax error/' expout >at-expout
151754mv at-expout expout
151755# 4. Check
151756{ set +x
151757$as_echo "$at_srcdir/java.at:360: cat stderr"
151758at_fn_check_prepare_trace "java.at:360"
151759( $at_check_trace; cat stderr
151760) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151761at_status=$? at_failed=false
151762$at_check_filter
151763at_fn_diff_devnull "$at_stderr" || at_failed=:
151764$at_diff expout "$at_stdout" || at_failed=:
151765at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
151766$at_failed && at_fn_log_failure
151767$at_traceon; }
151768
151769
151770cat >input <<'_ATEOF'
1517711//2
151772_ATEOF
151773
151774{ set +x
151775$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
151776at_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>&-
151779at_status=$? at_failed=false
151780$at_check_filter
151781echo stderr:; tee stderr <"$at_stderr"
151782at_fn_diff_devnull "$at_stdout" || at_failed=:
151783at_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.
151791cat >expout <<'_ATEOF'
1517921.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
151793_ATEOF
151794
151795# 2. If locations are not used, remove them.
151796sed 's/^[-0-9.]*: //' expout >at-expout
151797mv at-expout expout
151798# 3. If error-verbose is not used, strip the`, unexpected....' part.
151799sed 's/syntax error, .*$/syntax error/' expout >at-expout
151800mv at-expout expout
151801# 4. Check
151802{ set +x
151803$as_echo "$at_srcdir/java.at:360: cat stderr"
151804at_fn_check_prepare_trace "java.at:360"
151805( $at_check_trace; cat stderr
151806) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151807at_status=$? at_failed=false
151808$at_check_filter
151809at_fn_diff_devnull "$at_stderr" || at_failed=:
151810$at_diff expout "$at_stdout" || at_failed=:
151811at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
151812$at_failed && at_fn_log_failure
151813$at_traceon; }
151814
151815
151816cat >input <<'_ATEOF'
151817error
151818_ATEOF
151819
151820{ set +x
151821$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
151822at_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>&-
151825at_status=$? at_failed=false
151826$at_check_filter
151827echo stderr:; tee stderr <"$at_stderr"
151828at_fn_diff_devnull "$at_stdout" || at_failed=:
151829at_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.
151837cat >expout <<'_ATEOF'
1518381.1: syntax error, unexpected $undefined
151839_ATEOF
151840
151841# 2. If locations are not used, remove them.
151842sed 's/^[-0-9.]*: //' expout >at-expout
151843mv at-expout expout
151844# 3. If error-verbose is not used, strip the`, unexpected....' part.
151845sed 's/syntax error, .*$/syntax error/' expout >at-expout
151846mv at-expout expout
151847# 4. Check
151848{ set +x
151849$as_echo "$at_srcdir/java.at:360: cat stderr"
151850at_fn_check_prepare_trace "java.at:360"
151851( $at_check_trace; cat stderr
151852) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151853at_status=$? at_failed=false
151854$at_check_filter
151855at_fn_diff_devnull "$at_stderr" || at_failed=:
151856$at_diff expout "$at_stdout" || at_failed=:
151857at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
151858$at_failed && at_fn_log_failure
151859$at_traceon; }
151860
151861
151862cat >input <<'_ATEOF'
1518631 = 2 = 3
151864_ATEOF
151865
151866{ set +x
151867$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
151868at_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>&-
151871at_status=$? at_failed=false
151872$at_check_filter
151873echo stderr:; tee stderr <"$at_stderr"
151874at_fn_diff_devnull "$at_stdout" || at_failed=:
151875at_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.
151883cat >expout <<'_ATEOF'
1518841.4: syntax error, unexpected '='
151885_ATEOF
151886
151887# 2. If locations are not used, remove them.
151888sed 's/^[-0-9.]*: //' expout >at-expout
151889mv at-expout expout
151890# 3. If error-verbose is not used, strip the`, unexpected....' part.
151891sed 's/syntax error, .*$/syntax error/' expout >at-expout
151892mv at-expout expout
151893# 4. Check
151894{ set +x
151895$as_echo "$at_srcdir/java.at:360: cat stderr"
151896at_fn_check_prepare_trace "java.at:360"
151897( $at_check_trace; cat stderr
151898) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151899at_status=$? at_failed=false
151900$at_check_filter
151901at_fn_diff_devnull "$at_stderr" || at_failed=:
151902$at_diff expout "$at_stdout" || at_failed=:
151903at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
151904$at_failed && at_fn_log_failure
151905$at_traceon; }
151906
151907
151908cat >input <<'_ATEOF'
151909
151910+1
151911_ATEOF
151912
151913{ set +x
151914$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
151915at_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>&-
151918at_status=$? at_failed=false
151919$at_check_filter
151920echo stderr:; tee stderr <"$at_stderr"
151921at_fn_diff_devnull "$at_stdout" || at_failed=:
151922at_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.
151930cat >expout <<'_ATEOF'
1519312.1: syntax error, unexpected '+'
151932_ATEOF
151933
151934# 2. If locations are not used, remove them.
151935sed 's/^[-0-9.]*: //' expout >at-expout
151936mv at-expout expout
151937# 3. If error-verbose is not used, strip the`, unexpected....' part.
151938sed 's/syntax error, .*$/syntax error/' expout >at-expout
151939mv at-expout expout
151940# 4. Check
151941{ set +x
151942$as_echo "$at_srcdir/java.at:360: cat stderr"
151943at_fn_check_prepare_trace "java.at:360"
151944( $at_check_trace; cat stderr
151945) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151946at_status=$? at_failed=false
151947$at_check_filter
151948at_fn_diff_devnull "$at_stderr" || at_failed=:
151949$at_diff expout "$at_stdout" || at_failed=:
151950at_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"
151958at_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>&-
151961at_status=$? at_failed=false
151962$at_check_filter
151963echo stderr:; tee stderr <"$at_stderr"
151964at_fn_diff_devnull "$at_stdout" || at_failed=:
151965at_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.
151973cat >expout <<'_ATEOF'
1519741.1: syntax error, unexpected end of input
151975_ATEOF
151976
151977# 2. If locations are not used, remove them.
151978sed 's/^[-0-9.]*: //' expout >at-expout
151979mv at-expout expout
151980# 3. If error-verbose is not used, strip the`, unexpected....' part.
151981sed 's/syntax error, .*$/syntax error/' expout >at-expout
151982mv at-expout expout
151983# 4. Check
151984{ set +x
151985$as_echo "$at_srcdir/java.at:360: cat stderr"
151986at_fn_check_prepare_trace "java.at:360"
151987( $at_check_trace; cat stderr
151988) >>"$at_stdout" 2>>"$at_stderr" 5>&-
151989at_status=$? at_failed=false
151990$at_check_filter
151991at_fn_diff_devnull "$at_stderr" || at_failed=:
151992$at_diff expout "$at_stdout" || at_failed=:
151993at_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#
152015cat >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"
152021at_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>&-
152024at_status=$? at_failed=false
152025$at_check_filter
152026echo stderr:; tee stderr <"$at_stderr"
152027at_fn_diff_devnull "$at_stdout" || at_failed=:
152028at_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.
152036cat >expout <<'_ATEOF'
1520371.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1520381.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1520391.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1520401.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1520411.1-1.27: calc: error: 4444 != 1
152042_ATEOF
152043
152044# 2. If locations are not used, remove them.
152045sed 's/^[-0-9.]*: //' expout >at-expout
152046mv at-expout expout
152047# 3. If error-verbose is not used, strip the`, unexpected....' part.
152048sed 's/syntax error, .*$/syntax error/' expout >at-expout
152049mv at-expout expout
152050# 4. Check
152051{ set +x
152052$as_echo "$at_srcdir/java.at:360: cat stderr"
152053at_fn_check_prepare_trace "java.at:360"
152054( $at_check_trace; cat stderr
152055) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152056at_status=$? at_failed=false
152057$at_check_filter
152058at_fn_diff_devnull "$at_stderr" || at_failed=:
152059$at_diff expout "$at_stdout" || at_failed=:
152060at_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.
152068cat >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"
152074at_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>&-
152077at_status=$? at_failed=false
152078$at_check_filter
152079echo stderr:; tee stderr <"$at_stderr"
152080at_fn_diff_devnull "$at_stdout" || at_failed=:
152081at_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.
152089cat >expout <<'_ATEOF'
1520901.7: syntax error, unexpected number
1520911.1-1.10: calc: error: 2222 != 1
152092_ATEOF
152093
152094# 2. If locations are not used, remove them.
152095sed 's/^[-0-9.]*: //' expout >at-expout
152096mv at-expout expout
152097# 3. If error-verbose is not used, strip the`, unexpected....' part.
152098sed 's/syntax error, .*$/syntax error/' expout >at-expout
152099mv at-expout expout
152100# 4. Check
152101{ set +x
152102$as_echo "$at_srcdir/java.at:360: cat stderr"
152103at_fn_check_prepare_trace "java.at:360"
152104( $at_check_trace; cat stderr
152105) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152106at_status=$? at_failed=false
152107$at_check_filter
152108at_fn_diff_devnull "$at_stderr" || at_failed=:
152109$at_diff expout "$at_stdout" || at_failed=:
152110at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152111$at_failed && at_fn_log_failure
152112$at_traceon; }
152113
152114
152115cat >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"
152121at_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>&-
152124at_status=$? at_failed=false
152125$at_check_filter
152126echo stderr:; tee stderr <"$at_stderr"
152127at_fn_diff_devnull "$at_stdout" || at_failed=:
152128at_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.
152136cat >expout <<'_ATEOF'
1521371.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1521381.8: syntax error, unexpected number
1521391.1-1.11: calc: error: 2222 != 1
152140_ATEOF
152141
152142# 2. If locations are not used, remove them.
152143sed 's/^[-0-9.]*: //' expout >at-expout
152144mv at-expout expout
152145# 3. If error-verbose is not used, strip the`, unexpected....' part.
152146sed 's/syntax error, .*$/syntax error/' expout >at-expout
152147mv at-expout expout
152148# 4. Check
152149{ set +x
152150$as_echo "$at_srcdir/java.at:360: cat stderr"
152151at_fn_check_prepare_trace "java.at:360"
152152( $at_check_trace; cat stderr
152153) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152154at_status=$? at_failed=false
152155$at_check_filter
152156at_fn_diff_devnull "$at_stderr" || at_failed=:
152157$at_diff expout "$at_stdout" || at_failed=:
152158at_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
152168read at_status <"$at_status_file"
152169#AT_STOP_307
152170#AT_START_308
152171at_fn_group_banner 308 'java.at:360' \
152172  "Calculator %error-verbose " "                     " 19
152173at_xfail=no
152174(
152175  $as_echo "308. $at_setup_line: testing $at_desc ..."
152176  $at_traceon
152177
152178
152179
152180
152181
152182cat >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%%
152221input:
152222  line
152223| input line
152224;
152225
152226line:
152227  '\n'
152228| exp '\n'
152229| error '\n'
152230;
152231
152232exp:
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%%
152255class 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
152309class 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
152352if 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"
152360at_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>&-
152364at_status=$? at_failed=false
152365$at_check_filter
152366echo stderr:; cat "$at_stderr"
152367echo stdout:; cat "$at_stdout"
152368at_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"
152374at_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>&-
152377at_status=$? at_failed=false
152378$at_check_filter
152379echo stderr:; cat "$at_stderr"
152380echo stdout:; cat "$at_stdout"
152381at_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"
152390at_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>&-
152395at_status=$? at_failed=false
152396$at_check_filter
152397at_fn_diff_devnull "$at_stderr" || at_failed=:
152398$at_diff expout "$at_stdout" || at_failed=:
152399at_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"
152408at_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>&-
152413at_status=$? at_failed=false
152414$at_check_filter
152415at_fn_diff_devnull "$at_stderr" || at_failed=:
152416$at_diff expout "$at_stdout" || at_failed=:
152417at_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
152423fi
152424{ set +x
152425$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
152426at_fn_check_prepare_trace "java.at:360"
152427( $at_check_trace; bison -o Calc.java Calc.y
152428) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152429at_status=$? at_failed=false
152430$at_check_filter
152431at_fn_diff_devnull "$at_stderr" || at_failed=:
152432at_fn_diff_devnull "$at_stdout" || at_failed=:
152433at_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"
152447at_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>&-
152450at_status=$? at_failed=false
152451$at_check_filter
152452echo stderr:; cat "$at_stderr"
152453echo stdout:; cat "$at_stdout"
152454at_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.
152460cat >input <<'_ATEOF'
1524611 + 2 * 3 = 7
1524621 + 2 * -3 = -5
152463
152464-1^2 = -1
152465(-1)^2 = 1
152466
152467---1 = -1
152468
1524691 - 2 - 3 = -4
1524701 - (2 - 3) = 2
152471
1524722^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"
152478at_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>&-
152481at_status=$? at_failed=false
152482$at_check_filter
152483echo stderr:; tee stderr <"$at_stderr"
152484at_fn_diff_devnull "$at_stdout" || at_failed=:
152485at_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.
152492cat >input <<'_ATEOF'
1524930 0
152494_ATEOF
152495
152496{ set +x
152497$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
152498at_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>&-
152501at_status=$? at_failed=false
152502$at_check_filter
152503echo stderr:; tee stderr <"$at_stderr"
152504at_fn_diff_devnull "$at_stdout" || at_failed=:
152505at_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.
152513cat >expout <<'_ATEOF'
1525141.2: syntax error, unexpected number
152515_ATEOF
152516
152517# 2. If locations are not used, remove them.
152518sed 's/^[-0-9.]*: //' expout >at-expout
152519mv 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"
152525at_fn_check_prepare_trace "java.at:360"
152526( $at_check_trace; cat stderr
152527) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152528at_status=$? at_failed=false
152529$at_check_filter
152530at_fn_diff_devnull "$at_stderr" || at_failed=:
152531$at_diff expout "$at_stdout" || at_failed=:
152532at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152533$at_failed && at_fn_log_failure
152534$at_traceon; }
152535
152536
152537cat >input <<'_ATEOF'
1525381//2
152539_ATEOF
152540
152541{ set +x
152542$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
152543at_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>&-
152546at_status=$? at_failed=false
152547$at_check_filter
152548echo stderr:; tee stderr <"$at_stderr"
152549at_fn_diff_devnull "$at_stdout" || at_failed=:
152550at_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.
152558cat >expout <<'_ATEOF'
1525591.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
152560_ATEOF
152561
152562# 2. If locations are not used, remove them.
152563sed 's/^[-0-9.]*: //' expout >at-expout
152564mv 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"
152570at_fn_check_prepare_trace "java.at:360"
152571( $at_check_trace; cat stderr
152572) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152573at_status=$? at_failed=false
152574$at_check_filter
152575at_fn_diff_devnull "$at_stderr" || at_failed=:
152576$at_diff expout "$at_stdout" || at_failed=:
152577at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152578$at_failed && at_fn_log_failure
152579$at_traceon; }
152580
152581
152582cat >input <<'_ATEOF'
152583error
152584_ATEOF
152585
152586{ set +x
152587$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
152588at_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>&-
152591at_status=$? at_failed=false
152592$at_check_filter
152593echo stderr:; tee stderr <"$at_stderr"
152594at_fn_diff_devnull "$at_stdout" || at_failed=:
152595at_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.
152603cat >expout <<'_ATEOF'
1526041.1: syntax error, unexpected $undefined
152605_ATEOF
152606
152607# 2. If locations are not used, remove them.
152608sed 's/^[-0-9.]*: //' expout >at-expout
152609mv 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"
152615at_fn_check_prepare_trace "java.at:360"
152616( $at_check_trace; cat stderr
152617) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152618at_status=$? at_failed=false
152619$at_check_filter
152620at_fn_diff_devnull "$at_stderr" || at_failed=:
152621$at_diff expout "$at_stdout" || at_failed=:
152622at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152623$at_failed && at_fn_log_failure
152624$at_traceon; }
152625
152626
152627cat >input <<'_ATEOF'
1526281 = 2 = 3
152629_ATEOF
152630
152631{ set +x
152632$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
152633at_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>&-
152636at_status=$? at_failed=false
152637$at_check_filter
152638echo stderr:; tee stderr <"$at_stderr"
152639at_fn_diff_devnull "$at_stdout" || at_failed=:
152640at_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.
152648cat >expout <<'_ATEOF'
1526491.4: syntax error, unexpected '='
152650_ATEOF
152651
152652# 2. If locations are not used, remove them.
152653sed 's/^[-0-9.]*: //' expout >at-expout
152654mv 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"
152660at_fn_check_prepare_trace "java.at:360"
152661( $at_check_trace; cat stderr
152662) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152663at_status=$? at_failed=false
152664$at_check_filter
152665at_fn_diff_devnull "$at_stderr" || at_failed=:
152666$at_diff expout "$at_stdout" || at_failed=:
152667at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152668$at_failed && at_fn_log_failure
152669$at_traceon; }
152670
152671
152672cat >input <<'_ATEOF'
152673
152674+1
152675_ATEOF
152676
152677{ set +x
152678$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
152679at_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>&-
152682at_status=$? at_failed=false
152683$at_check_filter
152684echo stderr:; tee stderr <"$at_stderr"
152685at_fn_diff_devnull "$at_stdout" || at_failed=:
152686at_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.
152694cat >expout <<'_ATEOF'
1526952.1: syntax error, unexpected '+'
152696_ATEOF
152697
152698# 2. If locations are not used, remove them.
152699sed 's/^[-0-9.]*: //' expout >at-expout
152700mv 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"
152706at_fn_check_prepare_trace "java.at:360"
152707( $at_check_trace; cat stderr
152708) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152709at_status=$? at_failed=false
152710$at_check_filter
152711at_fn_diff_devnull "$at_stderr" || at_failed=:
152712$at_diff expout "$at_stdout" || at_failed=:
152713at_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"
152721at_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>&-
152724at_status=$? at_failed=false
152725$at_check_filter
152726echo stderr:; tee stderr <"$at_stderr"
152727at_fn_diff_devnull "$at_stdout" || at_failed=:
152728at_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.
152736cat >expout <<'_ATEOF'
1527371.1: syntax error, unexpected end of input
152738_ATEOF
152739
152740# 2. If locations are not used, remove them.
152741sed 's/^[-0-9.]*: //' expout >at-expout
152742mv 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"
152748at_fn_check_prepare_trace "java.at:360"
152749( $at_check_trace; cat stderr
152750) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152751at_status=$? at_failed=false
152752$at_check_filter
152753at_fn_diff_devnull "$at_stderr" || at_failed=:
152754$at_diff expout "$at_stdout" || at_failed=:
152755at_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#
152777cat >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"
152783at_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>&-
152786at_status=$? at_failed=false
152787$at_check_filter
152788echo stderr:; tee stderr <"$at_stderr"
152789at_fn_diff_devnull "$at_stdout" || at_failed=:
152790at_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.
152798cat >expout <<'_ATEOF'
1527991.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1528001.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1528011.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1528021.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1528031.1-1.27: calc: error: 4444 != 1
152804_ATEOF
152805
152806# 2. If locations are not used, remove them.
152807sed 's/^[-0-9.]*: //' expout >at-expout
152808mv 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"
152814at_fn_check_prepare_trace "java.at:360"
152815( $at_check_trace; cat stderr
152816) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152817at_status=$? at_failed=false
152818$at_check_filter
152819at_fn_diff_devnull "$at_stderr" || at_failed=:
152820$at_diff expout "$at_stdout" || at_failed=:
152821at_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.
152829cat >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"
152835at_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>&-
152838at_status=$? at_failed=false
152839$at_check_filter
152840echo stderr:; tee stderr <"$at_stderr"
152841at_fn_diff_devnull "$at_stdout" || at_failed=:
152842at_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.
152850cat >expout <<'_ATEOF'
1528511.7: syntax error, unexpected number
1528521.1-1.10: calc: error: 2222 != 1
152853_ATEOF
152854
152855# 2. If locations are not used, remove them.
152856sed 's/^[-0-9.]*: //' expout >at-expout
152857mv 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"
152863at_fn_check_prepare_trace "java.at:360"
152864( $at_check_trace; cat stderr
152865) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152866at_status=$? at_failed=false
152867$at_check_filter
152868at_fn_diff_devnull "$at_stderr" || at_failed=:
152869$at_diff expout "$at_stdout" || at_failed=:
152870at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
152871$at_failed && at_fn_log_failure
152872$at_traceon; }
152873
152874
152875cat >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"
152881at_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>&-
152884at_status=$? at_failed=false
152885$at_check_filter
152886echo stderr:; tee stderr <"$at_stderr"
152887at_fn_diff_devnull "$at_stdout" || at_failed=:
152888at_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.
152896cat >expout <<'_ATEOF'
1528971.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1528981.8: syntax error, unexpected number
1528991.1-1.11: calc: error: 2222 != 1
152900_ATEOF
152901
152902# 2. If locations are not used, remove them.
152903sed 's/^[-0-9.]*: //' expout >at-expout
152904mv 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"
152910at_fn_check_prepare_trace "java.at:360"
152911( $at_check_trace; cat stderr
152912) >>"$at_stdout" 2>>"$at_stderr" 5>&-
152913at_status=$? at_failed=false
152914$at_check_filter
152915at_fn_diff_devnull "$at_stderr" || at_failed=:
152916$at_diff expout "$at_stdout" || at_failed=:
152917at_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
152927read at_status <"$at_status_file"
152928#AT_STOP_308
152929#AT_START_309
152930at_fn_group_banner 309 'java.at:360' \
152931  "Calculator %locations " "                         " 19
152932at_xfail=no
152933(
152934  $as_echo "309. $at_setup_line: testing $at_desc ..."
152935  $at_traceon
152936
152937
152938
152939
152940
152941cat >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%%
152980input:
152981  line
152982| input line
152983;
152984
152985line:
152986  '\n'
152987| exp '\n'
152988| error '\n'
152989;
152990
152991exp:
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%%
153014class 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
153082class 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
153125if 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"
153133at_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>&-
153137at_status=$? at_failed=false
153138$at_check_filter
153139echo stderr:; cat "$at_stderr"
153140echo stdout:; cat "$at_stdout"
153141at_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"
153147at_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>&-
153150at_status=$? at_failed=false
153151$at_check_filter
153152echo stderr:; cat "$at_stderr"
153153echo stdout:; cat "$at_stdout"
153154at_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"
153163at_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>&-
153168at_status=$? at_failed=false
153169$at_check_filter
153170at_fn_diff_devnull "$at_stderr" || at_failed=:
153171$at_diff expout "$at_stdout" || at_failed=:
153172at_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"
153181at_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>&-
153186at_status=$? at_failed=false
153187$at_check_filter
153188at_fn_diff_devnull "$at_stderr" || at_failed=:
153189$at_diff expout "$at_stdout" || at_failed=:
153190at_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
153196fi
153197{ set +x
153198$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
153199at_fn_check_prepare_trace "java.at:360"
153200( $at_check_trace; bison -o Calc.java Calc.y
153201) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153202at_status=$? at_failed=false
153203$at_check_filter
153204at_fn_diff_devnull "$at_stderr" || at_failed=:
153205at_fn_diff_devnull "$at_stdout" || at_failed=:
153206at_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"
153220at_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>&-
153223at_status=$? at_failed=false
153224$at_check_filter
153225echo stderr:; cat "$at_stderr"
153226echo stdout:; cat "$at_stdout"
153227at_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.
153233cat >input <<'_ATEOF'
1532341 + 2 * 3 = 7
1532351 + 2 * -3 = -5
153236
153237-1^2 = -1
153238(-1)^2 = 1
153239
153240---1 = -1
153241
1532421 - 2 - 3 = -4
1532431 - (2 - 3) = 2
153244
1532452^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"
153251at_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>&-
153254at_status=$? at_failed=false
153255$at_check_filter
153256echo stderr:; tee stderr <"$at_stderr"
153257at_fn_diff_devnull "$at_stdout" || at_failed=:
153258at_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.
153265cat >input <<'_ATEOF'
1532660 0
153267_ATEOF
153268
153269{ set +x
153270$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
153271at_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>&-
153274at_status=$? at_failed=false
153275$at_check_filter
153276echo stderr:; tee stderr <"$at_stderr"
153277at_fn_diff_devnull "$at_stdout" || at_failed=:
153278at_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.
153286cat >expout <<'_ATEOF'
1532871.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.
153293sed 's/syntax error, .*$/syntax error/' expout >at-expout
153294mv at-expout expout
153295# 4. Check
153296{ set +x
153297$as_echo "$at_srcdir/java.at:360: cat stderr"
153298at_fn_check_prepare_trace "java.at:360"
153299( $at_check_trace; cat stderr
153300) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153301at_status=$? at_failed=false
153302$at_check_filter
153303at_fn_diff_devnull "$at_stderr" || at_failed=:
153304$at_diff expout "$at_stdout" || at_failed=:
153305at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
153306$at_failed && at_fn_log_failure
153307$at_traceon; }
153308
153309
153310cat >input <<'_ATEOF'
1533111//2
153312_ATEOF
153313
153314{ set +x
153315$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
153316at_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>&-
153319at_status=$? at_failed=false
153320$at_check_filter
153321echo stderr:; tee stderr <"$at_stderr"
153322at_fn_diff_devnull "$at_stdout" || at_failed=:
153323at_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.
153331cat >expout <<'_ATEOF'
1533321.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.
153338sed 's/syntax error, .*$/syntax error/' expout >at-expout
153339mv at-expout expout
153340# 4. Check
153341{ set +x
153342$as_echo "$at_srcdir/java.at:360: cat stderr"
153343at_fn_check_prepare_trace "java.at:360"
153344( $at_check_trace; cat stderr
153345) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153346at_status=$? at_failed=false
153347$at_check_filter
153348at_fn_diff_devnull "$at_stderr" || at_failed=:
153349$at_diff expout "$at_stdout" || at_failed=:
153350at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
153351$at_failed && at_fn_log_failure
153352$at_traceon; }
153353
153354
153355cat >input <<'_ATEOF'
153356error
153357_ATEOF
153358
153359{ set +x
153360$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
153361at_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>&-
153364at_status=$? at_failed=false
153365$at_check_filter
153366echo stderr:; tee stderr <"$at_stderr"
153367at_fn_diff_devnull "$at_stdout" || at_failed=:
153368at_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.
153376cat >expout <<'_ATEOF'
1533771.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.
153383sed 's/syntax error, .*$/syntax error/' expout >at-expout
153384mv at-expout expout
153385# 4. Check
153386{ set +x
153387$as_echo "$at_srcdir/java.at:360: cat stderr"
153388at_fn_check_prepare_trace "java.at:360"
153389( $at_check_trace; cat stderr
153390) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153391at_status=$? at_failed=false
153392$at_check_filter
153393at_fn_diff_devnull "$at_stderr" || at_failed=:
153394$at_diff expout "$at_stdout" || at_failed=:
153395at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
153396$at_failed && at_fn_log_failure
153397$at_traceon; }
153398
153399
153400cat >input <<'_ATEOF'
1534011 = 2 = 3
153402_ATEOF
153403
153404{ set +x
153405$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
153406at_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>&-
153409at_status=$? at_failed=false
153410$at_check_filter
153411echo stderr:; tee stderr <"$at_stderr"
153412at_fn_diff_devnull "$at_stdout" || at_failed=:
153413at_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.
153421cat >expout <<'_ATEOF'
1534221.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.
153428sed 's/syntax error, .*$/syntax error/' expout >at-expout
153429mv at-expout expout
153430# 4. Check
153431{ set +x
153432$as_echo "$at_srcdir/java.at:360: cat stderr"
153433at_fn_check_prepare_trace "java.at:360"
153434( $at_check_trace; cat stderr
153435) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153436at_status=$? at_failed=false
153437$at_check_filter
153438at_fn_diff_devnull "$at_stderr" || at_failed=:
153439$at_diff expout "$at_stdout" || at_failed=:
153440at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
153441$at_failed && at_fn_log_failure
153442$at_traceon; }
153443
153444
153445cat >input <<'_ATEOF'
153446
153447+1
153448_ATEOF
153449
153450{ set +x
153451$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
153452at_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>&-
153455at_status=$? at_failed=false
153456$at_check_filter
153457echo stderr:; tee stderr <"$at_stderr"
153458at_fn_diff_devnull "$at_stdout" || at_failed=:
153459at_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.
153467cat >expout <<'_ATEOF'
1534682.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.
153474sed 's/syntax error, .*$/syntax error/' expout >at-expout
153475mv at-expout expout
153476# 4. Check
153477{ set +x
153478$as_echo "$at_srcdir/java.at:360: cat stderr"
153479at_fn_check_prepare_trace "java.at:360"
153480( $at_check_trace; cat stderr
153481) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153482at_status=$? at_failed=false
153483$at_check_filter
153484at_fn_diff_devnull "$at_stderr" || at_failed=:
153485$at_diff expout "$at_stdout" || at_failed=:
153486at_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"
153494at_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>&-
153497at_status=$? at_failed=false
153498$at_check_filter
153499echo stderr:; tee stderr <"$at_stderr"
153500at_fn_diff_devnull "$at_stdout" || at_failed=:
153501at_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.
153509cat >expout <<'_ATEOF'
1535101.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.
153516sed 's/syntax error, .*$/syntax error/' expout >at-expout
153517mv at-expout expout
153518# 4. Check
153519{ set +x
153520$as_echo "$at_srcdir/java.at:360: cat stderr"
153521at_fn_check_prepare_trace "java.at:360"
153522( $at_check_trace; cat stderr
153523) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153524at_status=$? at_failed=false
153525$at_check_filter
153526at_fn_diff_devnull "$at_stderr" || at_failed=:
153527$at_diff expout "$at_stdout" || at_failed=:
153528at_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#
153550cat >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"
153556at_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>&-
153559at_status=$? at_failed=false
153560$at_check_filter
153561echo stderr:; tee stderr <"$at_stderr"
153562at_fn_diff_devnull "$at_stdout" || at_failed=:
153563at_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.
153571cat >expout <<'_ATEOF'
1535721.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1535731.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1535741.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1535751.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1535761.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.
153582sed 's/syntax error, .*$/syntax error/' expout >at-expout
153583mv at-expout expout
153584# 4. Check
153585{ set +x
153586$as_echo "$at_srcdir/java.at:360: cat stderr"
153587at_fn_check_prepare_trace "java.at:360"
153588( $at_check_trace; cat stderr
153589) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153590at_status=$? at_failed=false
153591$at_check_filter
153592at_fn_diff_devnull "$at_stderr" || at_failed=:
153593$at_diff expout "$at_stdout" || at_failed=:
153594at_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.
153602cat >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"
153608at_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>&-
153611at_status=$? at_failed=false
153612$at_check_filter
153613echo stderr:; tee stderr <"$at_stderr"
153614at_fn_diff_devnull "$at_stdout" || at_failed=:
153615at_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.
153623cat >expout <<'_ATEOF'
1536241.7: syntax error, unexpected number
1536251.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.
153631sed 's/syntax error, .*$/syntax error/' expout >at-expout
153632mv at-expout expout
153633# 4. Check
153634{ set +x
153635$as_echo "$at_srcdir/java.at:360: cat stderr"
153636at_fn_check_prepare_trace "java.at:360"
153637( $at_check_trace; cat stderr
153638) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153639at_status=$? at_failed=false
153640$at_check_filter
153641at_fn_diff_devnull "$at_stderr" || at_failed=:
153642$at_diff expout "$at_stdout" || at_failed=:
153643at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
153644$at_failed && at_fn_log_failure
153645$at_traceon; }
153646
153647
153648cat >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"
153654at_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>&-
153657at_status=$? at_failed=false
153658$at_check_filter
153659echo stderr:; tee stderr <"$at_stderr"
153660at_fn_diff_devnull "$at_stdout" || at_failed=:
153661at_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.
153669cat >expout <<'_ATEOF'
1536701.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1536711.8: syntax error, unexpected number
1536721.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.
153678sed 's/syntax error, .*$/syntax error/' expout >at-expout
153679mv at-expout expout
153680# 4. Check
153681{ set +x
153682$as_echo "$at_srcdir/java.at:360: cat stderr"
153683at_fn_check_prepare_trace "java.at:360"
153684( $at_check_trace; cat stderr
153685) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153686at_status=$? at_failed=false
153687$at_check_filter
153688at_fn_diff_devnull "$at_stderr" || at_failed=:
153689$at_diff expout "$at_stdout" || at_failed=:
153690at_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
153700read at_status <"$at_status_file"
153701#AT_STOP_309
153702#AT_START_310
153703at_fn_group_banner 310 'java.at:360' \
153704  "Calculator %error-verbose %locations " "          " 19
153705at_xfail=no
153706(
153707  $as_echo "310. $at_setup_line: testing $at_desc ..."
153708  $at_traceon
153709
153710
153711
153712
153713
153714cat >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%%
153753input:
153754  line
153755| input line
153756;
153757
153758line:
153759  '\n'
153760| exp '\n'
153761| error '\n'
153762;
153763
153764exp:
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%%
153787class 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
153855class 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
153898if 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"
153906at_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>&-
153910at_status=$? at_failed=false
153911$at_check_filter
153912echo stderr:; cat "$at_stderr"
153913echo stdout:; cat "$at_stdout"
153914at_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"
153920at_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>&-
153923at_status=$? at_failed=false
153924$at_check_filter
153925echo stderr:; cat "$at_stderr"
153926echo stdout:; cat "$at_stdout"
153927at_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"
153936at_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>&-
153941at_status=$? at_failed=false
153942$at_check_filter
153943at_fn_diff_devnull "$at_stderr" || at_failed=:
153944$at_diff expout "$at_stdout" || at_failed=:
153945at_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"
153954at_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>&-
153959at_status=$? at_failed=false
153960$at_check_filter
153961at_fn_diff_devnull "$at_stderr" || at_failed=:
153962$at_diff expout "$at_stdout" || at_failed=:
153963at_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
153969fi
153970{ set +x
153971$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
153972at_fn_check_prepare_trace "java.at:360"
153973( $at_check_trace; bison -o Calc.java Calc.y
153974) >>"$at_stdout" 2>>"$at_stderr" 5>&-
153975at_status=$? at_failed=false
153976$at_check_filter
153977at_fn_diff_devnull "$at_stderr" || at_failed=:
153978at_fn_diff_devnull "$at_stdout" || at_failed=:
153979at_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"
153993at_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>&-
153996at_status=$? at_failed=false
153997$at_check_filter
153998echo stderr:; cat "$at_stderr"
153999echo stdout:; cat "$at_stdout"
154000at_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.
154006cat >input <<'_ATEOF'
1540071 + 2 * 3 = 7
1540081 + 2 * -3 = -5
154009
154010-1^2 = -1
154011(-1)^2 = 1
154012
154013---1 = -1
154014
1540151 - 2 - 3 = -4
1540161 - (2 - 3) = 2
154017
1540182^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"
154024at_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>&-
154027at_status=$? at_failed=false
154028$at_check_filter
154029echo stderr:; tee stderr <"$at_stderr"
154030at_fn_diff_devnull "$at_stdout" || at_failed=:
154031at_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.
154038cat >input <<'_ATEOF'
1540390 0
154040_ATEOF
154041
154042{ set +x
154043$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
154044at_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>&-
154047at_status=$? at_failed=false
154048$at_check_filter
154049echo stderr:; tee stderr <"$at_stderr"
154050at_fn_diff_devnull "$at_stdout" || at_failed=:
154051at_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.
154059cat >expout <<'_ATEOF'
1540601.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"
154070at_fn_check_prepare_trace "java.at:360"
154071( $at_check_trace; cat stderr
154072) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154073at_status=$? at_failed=false
154074$at_check_filter
154075at_fn_diff_devnull "$at_stderr" || at_failed=:
154076$at_diff expout "$at_stdout" || at_failed=:
154077at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
154078$at_failed && at_fn_log_failure
154079$at_traceon; }
154080
154081
154082cat >input <<'_ATEOF'
1540831//2
154084_ATEOF
154085
154086{ set +x
154087$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
154088at_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>&-
154091at_status=$? at_failed=false
154092$at_check_filter
154093echo stderr:; tee stderr <"$at_stderr"
154094at_fn_diff_devnull "$at_stdout" || at_failed=:
154095at_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.
154103cat >expout <<'_ATEOF'
1541041.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"
154114at_fn_check_prepare_trace "java.at:360"
154115( $at_check_trace; cat stderr
154116) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154117at_status=$? at_failed=false
154118$at_check_filter
154119at_fn_diff_devnull "$at_stderr" || at_failed=:
154120$at_diff expout "$at_stdout" || at_failed=:
154121at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
154122$at_failed && at_fn_log_failure
154123$at_traceon; }
154124
154125
154126cat >input <<'_ATEOF'
154127error
154128_ATEOF
154129
154130{ set +x
154131$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
154132at_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>&-
154135at_status=$? at_failed=false
154136$at_check_filter
154137echo stderr:; tee stderr <"$at_stderr"
154138at_fn_diff_devnull "$at_stdout" || at_failed=:
154139at_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.
154147cat >expout <<'_ATEOF'
1541481.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"
154158at_fn_check_prepare_trace "java.at:360"
154159( $at_check_trace; cat stderr
154160) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154161at_status=$? at_failed=false
154162$at_check_filter
154163at_fn_diff_devnull "$at_stderr" || at_failed=:
154164$at_diff expout "$at_stdout" || at_failed=:
154165at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
154166$at_failed && at_fn_log_failure
154167$at_traceon; }
154168
154169
154170cat >input <<'_ATEOF'
1541711 = 2 = 3
154172_ATEOF
154173
154174{ set +x
154175$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
154176at_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>&-
154179at_status=$? at_failed=false
154180$at_check_filter
154181echo stderr:; tee stderr <"$at_stderr"
154182at_fn_diff_devnull "$at_stdout" || at_failed=:
154183at_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.
154191cat >expout <<'_ATEOF'
1541921.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"
154202at_fn_check_prepare_trace "java.at:360"
154203( $at_check_trace; cat stderr
154204) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154205at_status=$? at_failed=false
154206$at_check_filter
154207at_fn_diff_devnull "$at_stderr" || at_failed=:
154208$at_diff expout "$at_stdout" || at_failed=:
154209at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
154210$at_failed && at_fn_log_failure
154211$at_traceon; }
154212
154213
154214cat >input <<'_ATEOF'
154215
154216+1
154217_ATEOF
154218
154219{ set +x
154220$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
154221at_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>&-
154224at_status=$? at_failed=false
154225$at_check_filter
154226echo stderr:; tee stderr <"$at_stderr"
154227at_fn_diff_devnull "$at_stdout" || at_failed=:
154228at_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.
154236cat >expout <<'_ATEOF'
1542372.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"
154247at_fn_check_prepare_trace "java.at:360"
154248( $at_check_trace; cat stderr
154249) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154250at_status=$? at_failed=false
154251$at_check_filter
154252at_fn_diff_devnull "$at_stderr" || at_failed=:
154253$at_diff expout "$at_stdout" || at_failed=:
154254at_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"
154262at_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>&-
154265at_status=$? at_failed=false
154266$at_check_filter
154267echo stderr:; tee stderr <"$at_stderr"
154268at_fn_diff_devnull "$at_stdout" || at_failed=:
154269at_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.
154277cat >expout <<'_ATEOF'
1542781.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"
154288at_fn_check_prepare_trace "java.at:360"
154289( $at_check_trace; cat stderr
154290) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154291at_status=$? at_failed=false
154292$at_check_filter
154293at_fn_diff_devnull "$at_stderr" || at_failed=:
154294$at_diff expout "$at_stdout" || at_failed=:
154295at_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#
154317cat >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"
154323at_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>&-
154326at_status=$? at_failed=false
154327$at_check_filter
154328echo stderr:; tee stderr <"$at_stderr"
154329at_fn_diff_devnull "$at_stdout" || at_failed=:
154330at_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.
154338cat >expout <<'_ATEOF'
1543391.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1543401.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1543411.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1543421.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1543431.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"
154353at_fn_check_prepare_trace "java.at:360"
154354( $at_check_trace; cat stderr
154355) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154356at_status=$? at_failed=false
154357$at_check_filter
154358at_fn_diff_devnull "$at_stderr" || at_failed=:
154359$at_diff expout "$at_stdout" || at_failed=:
154360at_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.
154368cat >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"
154374at_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>&-
154377at_status=$? at_failed=false
154378$at_check_filter
154379echo stderr:; tee stderr <"$at_stderr"
154380at_fn_diff_devnull "$at_stdout" || at_failed=:
154381at_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.
154389cat >expout <<'_ATEOF'
1543901.7: syntax error, unexpected number
1543911.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"
154401at_fn_check_prepare_trace "java.at:360"
154402( $at_check_trace; cat stderr
154403) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154404at_status=$? at_failed=false
154405$at_check_filter
154406at_fn_diff_devnull "$at_stderr" || at_failed=:
154407$at_diff expout "$at_stdout" || at_failed=:
154408at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
154409$at_failed && at_fn_log_failure
154410$at_traceon; }
154411
154412
154413cat >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"
154419at_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>&-
154422at_status=$? at_failed=false
154423$at_check_filter
154424echo stderr:; tee stderr <"$at_stderr"
154425at_fn_diff_devnull "$at_stdout" || at_failed=:
154426at_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.
154434cat >expout <<'_ATEOF'
1544351.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1544361.8: syntax error, unexpected number
1544371.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"
154447at_fn_check_prepare_trace "java.at:360"
154448( $at_check_trace; cat stderr
154449) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154450at_status=$? at_failed=false
154451$at_check_filter
154452at_fn_diff_devnull "$at_stderr" || at_failed=:
154453$at_diff expout "$at_stdout" || at_failed=:
154454at_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
154464read at_status <"$at_status_file"
154465#AT_STOP_310
154466#AT_START_311
154467at_fn_group_banner 311 'java.at:369' \
154468  "Calculator %lex-param { InputStream is } " "      " 19
154469at_xfail=no
154470(
154471  $as_echo "311. $at_setup_line: testing $at_desc ..."
154472  $at_traceon
154473
154474
154475
154476
154477
154478cat >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%%
154515input:
154516  line
154517| input line
154518;
154519
154520line:
154521  '\n'
154522| exp '\n'
154523| error '\n'
154524;
154525
154526exp:
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
154603class 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
154646if 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"
154654at_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>&-
154658at_status=$? at_failed=false
154659$at_check_filter
154660echo stderr:; cat "$at_stderr"
154661echo stdout:; cat "$at_stdout"
154662at_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"
154668at_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>&-
154671at_status=$? at_failed=false
154672$at_check_filter
154673echo stderr:; cat "$at_stderr"
154674echo stdout:; cat "$at_stdout"
154675at_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"
154684at_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>&-
154689at_status=$? at_failed=false
154690$at_check_filter
154691at_fn_diff_devnull "$at_stderr" || at_failed=:
154692$at_diff expout "$at_stdout" || at_failed=:
154693at_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"
154702at_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>&-
154707at_status=$? at_failed=false
154708$at_check_filter
154709at_fn_diff_devnull "$at_stderr" || at_failed=:
154710$at_diff expout "$at_stdout" || at_failed=:
154711at_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
154717fi
154718{ set +x
154719$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
154720at_fn_check_prepare_trace "java.at:369"
154721( $at_check_trace; bison -o Calc.java Calc.y
154722) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154723at_status=$? at_failed=false
154724$at_check_filter
154725at_fn_diff_devnull "$at_stderr" || at_failed=:
154726at_fn_diff_devnull "$at_stdout" || at_failed=:
154727at_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"
154741at_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>&-
154744at_status=$? at_failed=false
154745$at_check_filter
154746echo stderr:; cat "$at_stderr"
154747echo stdout:; cat "$at_stdout"
154748at_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.
154754cat >input <<'_ATEOF'
1547551 + 2 * 3 = 7
1547561 + 2 * -3 = -5
154757
154758-1^2 = -1
154759(-1)^2 = 1
154760
154761---1 = -1
154762
1547631 - 2 - 3 = -4
1547641 - (2 - 3) = 2
154765
1547662^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"
154772at_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>&-
154775at_status=$? at_failed=false
154776$at_check_filter
154777echo stderr:; tee stderr <"$at_stderr"
154778at_fn_diff_devnull "$at_stdout" || at_failed=:
154779at_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.
154786cat >input <<'_ATEOF'
1547870 0
154788_ATEOF
154789
154790{ set +x
154791$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
154792at_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>&-
154795at_status=$? at_failed=false
154796$at_check_filter
154797echo stderr:; tee stderr <"$at_stderr"
154798at_fn_diff_devnull "$at_stdout" || at_failed=:
154799at_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.
154807cat >expout <<'_ATEOF'
1548081.2: syntax error, unexpected number
154809_ATEOF
154810
154811# 2. If locations are not used, remove them.
154812sed 's/^[-0-9.]*: //' expout >at-expout
154813mv at-expout expout
154814# 3. If error-verbose is not used, strip the`, unexpected....' part.
154815sed 's/syntax error, .*$/syntax error/' expout >at-expout
154816mv at-expout expout
154817# 4. Check
154818{ set +x
154819$as_echo "$at_srcdir/java.at:369: cat stderr"
154820at_fn_check_prepare_trace "java.at:369"
154821( $at_check_trace; cat stderr
154822) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154823at_status=$? at_failed=false
154824$at_check_filter
154825at_fn_diff_devnull "$at_stderr" || at_failed=:
154826$at_diff expout "$at_stdout" || at_failed=:
154827at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
154828$at_failed && at_fn_log_failure
154829$at_traceon; }
154830
154831
154832cat >input <<'_ATEOF'
1548331//2
154834_ATEOF
154835
154836{ set +x
154837$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
154838at_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>&-
154841at_status=$? at_failed=false
154842$at_check_filter
154843echo stderr:; tee stderr <"$at_stderr"
154844at_fn_diff_devnull "$at_stdout" || at_failed=:
154845at_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.
154853cat >expout <<'_ATEOF'
1548541.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
154855_ATEOF
154856
154857# 2. If locations are not used, remove them.
154858sed 's/^[-0-9.]*: //' expout >at-expout
154859mv at-expout expout
154860# 3. If error-verbose is not used, strip the`, unexpected....' part.
154861sed 's/syntax error, .*$/syntax error/' expout >at-expout
154862mv at-expout expout
154863# 4. Check
154864{ set +x
154865$as_echo "$at_srcdir/java.at:369: cat stderr"
154866at_fn_check_prepare_trace "java.at:369"
154867( $at_check_trace; cat stderr
154868) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154869at_status=$? at_failed=false
154870$at_check_filter
154871at_fn_diff_devnull "$at_stderr" || at_failed=:
154872$at_diff expout "$at_stdout" || at_failed=:
154873at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
154874$at_failed && at_fn_log_failure
154875$at_traceon; }
154876
154877
154878cat >input <<'_ATEOF'
154879error
154880_ATEOF
154881
154882{ set +x
154883$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
154884at_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>&-
154887at_status=$? at_failed=false
154888$at_check_filter
154889echo stderr:; tee stderr <"$at_stderr"
154890at_fn_diff_devnull "$at_stdout" || at_failed=:
154891at_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.
154899cat >expout <<'_ATEOF'
1549001.1: syntax error, unexpected $undefined
154901_ATEOF
154902
154903# 2. If locations are not used, remove them.
154904sed 's/^[-0-9.]*: //' expout >at-expout
154905mv at-expout expout
154906# 3. If error-verbose is not used, strip the`, unexpected....' part.
154907sed 's/syntax error, .*$/syntax error/' expout >at-expout
154908mv at-expout expout
154909# 4. Check
154910{ set +x
154911$as_echo "$at_srcdir/java.at:369: cat stderr"
154912at_fn_check_prepare_trace "java.at:369"
154913( $at_check_trace; cat stderr
154914) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154915at_status=$? at_failed=false
154916$at_check_filter
154917at_fn_diff_devnull "$at_stderr" || at_failed=:
154918$at_diff expout "$at_stdout" || at_failed=:
154919at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
154920$at_failed && at_fn_log_failure
154921$at_traceon; }
154922
154923
154924cat >input <<'_ATEOF'
1549251 = 2 = 3
154926_ATEOF
154927
154928{ set +x
154929$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
154930at_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>&-
154933at_status=$? at_failed=false
154934$at_check_filter
154935echo stderr:; tee stderr <"$at_stderr"
154936at_fn_diff_devnull "$at_stdout" || at_failed=:
154937at_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.
154945cat >expout <<'_ATEOF'
1549461.4: syntax error, unexpected '='
154947_ATEOF
154948
154949# 2. If locations are not used, remove them.
154950sed 's/^[-0-9.]*: //' expout >at-expout
154951mv at-expout expout
154952# 3. If error-verbose is not used, strip the`, unexpected....' part.
154953sed 's/syntax error, .*$/syntax error/' expout >at-expout
154954mv at-expout expout
154955# 4. Check
154956{ set +x
154957$as_echo "$at_srcdir/java.at:369: cat stderr"
154958at_fn_check_prepare_trace "java.at:369"
154959( $at_check_trace; cat stderr
154960) >>"$at_stdout" 2>>"$at_stderr" 5>&-
154961at_status=$? at_failed=false
154962$at_check_filter
154963at_fn_diff_devnull "$at_stderr" || at_failed=:
154964$at_diff expout "$at_stdout" || at_failed=:
154965at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
154966$at_failed && at_fn_log_failure
154967$at_traceon; }
154968
154969
154970cat >input <<'_ATEOF'
154971
154972+1
154973_ATEOF
154974
154975{ set +x
154976$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
154977at_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>&-
154980at_status=$? at_failed=false
154981$at_check_filter
154982echo stderr:; tee stderr <"$at_stderr"
154983at_fn_diff_devnull "$at_stdout" || at_failed=:
154984at_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.
154992cat >expout <<'_ATEOF'
1549932.1: syntax error, unexpected '+'
154994_ATEOF
154995
154996# 2. If locations are not used, remove them.
154997sed 's/^[-0-9.]*: //' expout >at-expout
154998mv at-expout expout
154999# 3. If error-verbose is not used, strip the`, unexpected....' part.
155000sed 's/syntax error, .*$/syntax error/' expout >at-expout
155001mv at-expout expout
155002# 4. Check
155003{ set +x
155004$as_echo "$at_srcdir/java.at:369: cat stderr"
155005at_fn_check_prepare_trace "java.at:369"
155006( $at_check_trace; cat stderr
155007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155008at_status=$? at_failed=false
155009$at_check_filter
155010at_fn_diff_devnull "$at_stderr" || at_failed=:
155011$at_diff expout "$at_stdout" || at_failed=:
155012at_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"
155020at_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>&-
155023at_status=$? at_failed=false
155024$at_check_filter
155025echo stderr:; tee stderr <"$at_stderr"
155026at_fn_diff_devnull "$at_stdout" || at_failed=:
155027at_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.
155035cat >expout <<'_ATEOF'
1550361.1: syntax error, unexpected end of input
155037_ATEOF
155038
155039# 2. If locations are not used, remove them.
155040sed 's/^[-0-9.]*: //' expout >at-expout
155041mv at-expout expout
155042# 3. If error-verbose is not used, strip the`, unexpected....' part.
155043sed 's/syntax error, .*$/syntax error/' expout >at-expout
155044mv at-expout expout
155045# 4. Check
155046{ set +x
155047$as_echo "$at_srcdir/java.at:369: cat stderr"
155048at_fn_check_prepare_trace "java.at:369"
155049( $at_check_trace; cat stderr
155050) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155051at_status=$? at_failed=false
155052$at_check_filter
155053at_fn_diff_devnull "$at_stderr" || at_failed=:
155054$at_diff expout "$at_stdout" || at_failed=:
155055at_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#
155077cat >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"
155083at_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>&-
155086at_status=$? at_failed=false
155087$at_check_filter
155088echo stderr:; tee stderr <"$at_stderr"
155089at_fn_diff_devnull "$at_stdout" || at_failed=:
155090at_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.
155098cat >expout <<'_ATEOF'
1550991.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1551001.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1551011.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1551021.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1551031.1-1.27: calc: error: 4444 != 1
155104_ATEOF
155105
155106# 2. If locations are not used, remove them.
155107sed 's/^[-0-9.]*: //' expout >at-expout
155108mv at-expout expout
155109# 3. If error-verbose is not used, strip the`, unexpected....' part.
155110sed 's/syntax error, .*$/syntax error/' expout >at-expout
155111mv at-expout expout
155112# 4. Check
155113{ set +x
155114$as_echo "$at_srcdir/java.at:369: cat stderr"
155115at_fn_check_prepare_trace "java.at:369"
155116( $at_check_trace; cat stderr
155117) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155118at_status=$? at_failed=false
155119$at_check_filter
155120at_fn_diff_devnull "$at_stderr" || at_failed=:
155121$at_diff expout "$at_stdout" || at_failed=:
155122at_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.
155130cat >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"
155136at_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>&-
155139at_status=$? at_failed=false
155140$at_check_filter
155141echo stderr:; tee stderr <"$at_stderr"
155142at_fn_diff_devnull "$at_stdout" || at_failed=:
155143at_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.
155151cat >expout <<'_ATEOF'
1551521.7: syntax error, unexpected number
1551531.1-1.10: calc: error: 2222 != 1
155154_ATEOF
155155
155156# 2. If locations are not used, remove them.
155157sed 's/^[-0-9.]*: //' expout >at-expout
155158mv at-expout expout
155159# 3. If error-verbose is not used, strip the`, unexpected....' part.
155160sed 's/syntax error, .*$/syntax error/' expout >at-expout
155161mv at-expout expout
155162# 4. Check
155163{ set +x
155164$as_echo "$at_srcdir/java.at:369: cat stderr"
155165at_fn_check_prepare_trace "java.at:369"
155166( $at_check_trace; cat stderr
155167) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155168at_status=$? at_failed=false
155169$at_check_filter
155170at_fn_diff_devnull "$at_stderr" || at_failed=:
155171$at_diff expout "$at_stdout" || at_failed=:
155172at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155173$at_failed && at_fn_log_failure
155174$at_traceon; }
155175
155176
155177cat >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"
155183at_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>&-
155186at_status=$? at_failed=false
155187$at_check_filter
155188echo stderr:; tee stderr <"$at_stderr"
155189at_fn_diff_devnull "$at_stdout" || at_failed=:
155190at_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.
155198cat >expout <<'_ATEOF'
1551991.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1552001.8: syntax error, unexpected number
1552011.1-1.11: calc: error: 2222 != 1
155202_ATEOF
155203
155204# 2. If locations are not used, remove them.
155205sed 's/^[-0-9.]*: //' expout >at-expout
155206mv at-expout expout
155207# 3. If error-verbose is not used, strip the`, unexpected....' part.
155208sed 's/syntax error, .*$/syntax error/' expout >at-expout
155209mv at-expout expout
155210# 4. Check
155211{ set +x
155212$as_echo "$at_srcdir/java.at:369: cat stderr"
155213at_fn_check_prepare_trace "java.at:369"
155214( $at_check_trace; cat stderr
155215) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155216at_status=$? at_failed=false
155217$at_check_filter
155218at_fn_diff_devnull "$at_stderr" || at_failed=:
155219$at_diff expout "$at_stdout" || at_failed=:
155220at_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
155230read at_status <"$at_status_file"
155231#AT_STOP_311
155232#AT_START_312
155233at_fn_group_banner 312 'java.at:369' \
155234  "Calculator %error-verbose %lex-param { InputStream is } " "" 19
155235at_xfail=no
155236(
155237  $as_echo "312. $at_setup_line: testing $at_desc ..."
155238  $at_traceon
155239
155240
155241
155242
155243
155244cat >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%%
155281input:
155282  line
155283| input line
155284;
155285
155286line:
155287  '\n'
155288| exp '\n'
155289| error '\n'
155290;
155291
155292exp:
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
155369class 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
155412if 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"
155420at_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>&-
155424at_status=$? at_failed=false
155425$at_check_filter
155426echo stderr:; cat "$at_stderr"
155427echo stdout:; cat "$at_stdout"
155428at_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"
155434at_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>&-
155437at_status=$? at_failed=false
155438$at_check_filter
155439echo stderr:; cat "$at_stderr"
155440echo stdout:; cat "$at_stdout"
155441at_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"
155450at_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>&-
155455at_status=$? at_failed=false
155456$at_check_filter
155457at_fn_diff_devnull "$at_stderr" || at_failed=:
155458$at_diff expout "$at_stdout" || at_failed=:
155459at_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"
155468at_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>&-
155473at_status=$? at_failed=false
155474$at_check_filter
155475at_fn_diff_devnull "$at_stderr" || at_failed=:
155476$at_diff expout "$at_stdout" || at_failed=:
155477at_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
155483fi
155484{ set +x
155485$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
155486at_fn_check_prepare_trace "java.at:369"
155487( $at_check_trace; bison -o Calc.java Calc.y
155488) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155489at_status=$? at_failed=false
155490$at_check_filter
155491at_fn_diff_devnull "$at_stderr" || at_failed=:
155492at_fn_diff_devnull "$at_stdout" || at_failed=:
155493at_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"
155507at_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>&-
155510at_status=$? at_failed=false
155511$at_check_filter
155512echo stderr:; cat "$at_stderr"
155513echo stdout:; cat "$at_stdout"
155514at_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.
155520cat >input <<'_ATEOF'
1555211 + 2 * 3 = 7
1555221 + 2 * -3 = -5
155523
155524-1^2 = -1
155525(-1)^2 = 1
155526
155527---1 = -1
155528
1555291 - 2 - 3 = -4
1555301 - (2 - 3) = 2
155531
1555322^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"
155538at_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>&-
155541at_status=$? at_failed=false
155542$at_check_filter
155543echo stderr:; tee stderr <"$at_stderr"
155544at_fn_diff_devnull "$at_stdout" || at_failed=:
155545at_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.
155552cat >input <<'_ATEOF'
1555530 0
155554_ATEOF
155555
155556{ set +x
155557$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
155558at_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>&-
155561at_status=$? at_failed=false
155562$at_check_filter
155563echo stderr:; tee stderr <"$at_stderr"
155564at_fn_diff_devnull "$at_stdout" || at_failed=:
155565at_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.
155573cat >expout <<'_ATEOF'
1555741.2: syntax error, unexpected number
155575_ATEOF
155576
155577# 2. If locations are not used, remove them.
155578sed 's/^[-0-9.]*: //' expout >at-expout
155579mv 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"
155585at_fn_check_prepare_trace "java.at:369"
155586( $at_check_trace; cat stderr
155587) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155588at_status=$? at_failed=false
155589$at_check_filter
155590at_fn_diff_devnull "$at_stderr" || at_failed=:
155591$at_diff expout "$at_stdout" || at_failed=:
155592at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155593$at_failed && at_fn_log_failure
155594$at_traceon; }
155595
155596
155597cat >input <<'_ATEOF'
1555981//2
155599_ATEOF
155600
155601{ set +x
155602$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
155603at_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>&-
155606at_status=$? at_failed=false
155607$at_check_filter
155608echo stderr:; tee stderr <"$at_stderr"
155609at_fn_diff_devnull "$at_stdout" || at_failed=:
155610at_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.
155618cat >expout <<'_ATEOF'
1556191.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
155620_ATEOF
155621
155622# 2. If locations are not used, remove them.
155623sed 's/^[-0-9.]*: //' expout >at-expout
155624mv 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"
155630at_fn_check_prepare_trace "java.at:369"
155631( $at_check_trace; cat stderr
155632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155633at_status=$? at_failed=false
155634$at_check_filter
155635at_fn_diff_devnull "$at_stderr" || at_failed=:
155636$at_diff expout "$at_stdout" || at_failed=:
155637at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155638$at_failed && at_fn_log_failure
155639$at_traceon; }
155640
155641
155642cat >input <<'_ATEOF'
155643error
155644_ATEOF
155645
155646{ set +x
155647$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
155648at_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>&-
155651at_status=$? at_failed=false
155652$at_check_filter
155653echo stderr:; tee stderr <"$at_stderr"
155654at_fn_diff_devnull "$at_stdout" || at_failed=:
155655at_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.
155663cat >expout <<'_ATEOF'
1556641.1: syntax error, unexpected $undefined
155665_ATEOF
155666
155667# 2. If locations are not used, remove them.
155668sed 's/^[-0-9.]*: //' expout >at-expout
155669mv 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"
155675at_fn_check_prepare_trace "java.at:369"
155676( $at_check_trace; cat stderr
155677) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155678at_status=$? at_failed=false
155679$at_check_filter
155680at_fn_diff_devnull "$at_stderr" || at_failed=:
155681$at_diff expout "$at_stdout" || at_failed=:
155682at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155683$at_failed && at_fn_log_failure
155684$at_traceon; }
155685
155686
155687cat >input <<'_ATEOF'
1556881 = 2 = 3
155689_ATEOF
155690
155691{ set +x
155692$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
155693at_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>&-
155696at_status=$? at_failed=false
155697$at_check_filter
155698echo stderr:; tee stderr <"$at_stderr"
155699at_fn_diff_devnull "$at_stdout" || at_failed=:
155700at_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.
155708cat >expout <<'_ATEOF'
1557091.4: syntax error, unexpected '='
155710_ATEOF
155711
155712# 2. If locations are not used, remove them.
155713sed 's/^[-0-9.]*: //' expout >at-expout
155714mv 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"
155720at_fn_check_prepare_trace "java.at:369"
155721( $at_check_trace; cat stderr
155722) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155723at_status=$? at_failed=false
155724$at_check_filter
155725at_fn_diff_devnull "$at_stderr" || at_failed=:
155726$at_diff expout "$at_stdout" || at_failed=:
155727at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155728$at_failed && at_fn_log_failure
155729$at_traceon; }
155730
155731
155732cat >input <<'_ATEOF'
155733
155734+1
155735_ATEOF
155736
155737{ set +x
155738$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
155739at_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>&-
155742at_status=$? at_failed=false
155743$at_check_filter
155744echo stderr:; tee stderr <"$at_stderr"
155745at_fn_diff_devnull "$at_stdout" || at_failed=:
155746at_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.
155754cat >expout <<'_ATEOF'
1557552.1: syntax error, unexpected '+'
155756_ATEOF
155757
155758# 2. If locations are not used, remove them.
155759sed 's/^[-0-9.]*: //' expout >at-expout
155760mv 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"
155766at_fn_check_prepare_trace "java.at:369"
155767( $at_check_trace; cat stderr
155768) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155769at_status=$? at_failed=false
155770$at_check_filter
155771at_fn_diff_devnull "$at_stderr" || at_failed=:
155772$at_diff expout "$at_stdout" || at_failed=:
155773at_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"
155781at_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>&-
155784at_status=$? at_failed=false
155785$at_check_filter
155786echo stderr:; tee stderr <"$at_stderr"
155787at_fn_diff_devnull "$at_stdout" || at_failed=:
155788at_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.
155796cat >expout <<'_ATEOF'
1557971.1: syntax error, unexpected end of input
155798_ATEOF
155799
155800# 2. If locations are not used, remove them.
155801sed 's/^[-0-9.]*: //' expout >at-expout
155802mv 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"
155808at_fn_check_prepare_trace "java.at:369"
155809( $at_check_trace; cat stderr
155810) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155811at_status=$? at_failed=false
155812$at_check_filter
155813at_fn_diff_devnull "$at_stderr" || at_failed=:
155814$at_diff expout "$at_stdout" || at_failed=:
155815at_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#
155837cat >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"
155843at_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>&-
155846at_status=$? at_failed=false
155847$at_check_filter
155848echo stderr:; tee stderr <"$at_stderr"
155849at_fn_diff_devnull "$at_stdout" || at_failed=:
155850at_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.
155858cat >expout <<'_ATEOF'
1558591.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1558601.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1558611.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1558621.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1558631.1-1.27: calc: error: 4444 != 1
155864_ATEOF
155865
155866# 2. If locations are not used, remove them.
155867sed 's/^[-0-9.]*: //' expout >at-expout
155868mv 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"
155874at_fn_check_prepare_trace "java.at:369"
155875( $at_check_trace; cat stderr
155876) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155877at_status=$? at_failed=false
155878$at_check_filter
155879at_fn_diff_devnull "$at_stderr" || at_failed=:
155880$at_diff expout "$at_stdout" || at_failed=:
155881at_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.
155889cat >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"
155895at_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>&-
155898at_status=$? at_failed=false
155899$at_check_filter
155900echo stderr:; tee stderr <"$at_stderr"
155901at_fn_diff_devnull "$at_stdout" || at_failed=:
155902at_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.
155910cat >expout <<'_ATEOF'
1559111.7: syntax error, unexpected number
1559121.1-1.10: calc: error: 2222 != 1
155913_ATEOF
155914
155915# 2. If locations are not used, remove them.
155916sed 's/^[-0-9.]*: //' expout >at-expout
155917mv 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"
155923at_fn_check_prepare_trace "java.at:369"
155924( $at_check_trace; cat stderr
155925) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155926at_status=$? at_failed=false
155927$at_check_filter
155928at_fn_diff_devnull "$at_stderr" || at_failed=:
155929$at_diff expout "$at_stdout" || at_failed=:
155930at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
155931$at_failed && at_fn_log_failure
155932$at_traceon; }
155933
155934
155935cat >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"
155941at_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>&-
155944at_status=$? at_failed=false
155945$at_check_filter
155946echo stderr:; tee stderr <"$at_stderr"
155947at_fn_diff_devnull "$at_stdout" || at_failed=:
155948at_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.
155956cat >expout <<'_ATEOF'
1559571.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1559581.8: syntax error, unexpected number
1559591.1-1.11: calc: error: 2222 != 1
155960_ATEOF
155961
155962# 2. If locations are not used, remove them.
155963sed 's/^[-0-9.]*: //' expout >at-expout
155964mv 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"
155970at_fn_check_prepare_trace "java.at:369"
155971( $at_check_trace; cat stderr
155972) >>"$at_stdout" 2>>"$at_stderr" 5>&-
155973at_status=$? at_failed=false
155974$at_check_filter
155975at_fn_diff_devnull "$at_stderr" || at_failed=:
155976$at_diff expout "$at_stdout" || at_failed=:
155977at_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
155987read at_status <"$at_status_file"
155988#AT_STOP_312
155989#AT_START_313
155990at_fn_group_banner 313 'java.at:369' \
155991  "Calculator %locations %lex-param { InputStream is } " "" 19
155992at_xfail=no
155993(
155994  $as_echo "313. $at_setup_line: testing $at_desc ..."
155995  $at_traceon
155996
155997
155998
155999
156000
156001cat >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%%
156038input:
156039  line
156040| input line
156041;
156042
156043line:
156044  '\n'
156045| exp '\n'
156046| error '\n'
156047;
156048
156049exp:
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
156140class 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
156183if 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"
156191at_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>&-
156195at_status=$? at_failed=false
156196$at_check_filter
156197echo stderr:; cat "$at_stderr"
156198echo stdout:; cat "$at_stdout"
156199at_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"
156205at_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>&-
156208at_status=$? at_failed=false
156209$at_check_filter
156210echo stderr:; cat "$at_stderr"
156211echo stdout:; cat "$at_stdout"
156212at_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"
156221at_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>&-
156226at_status=$? at_failed=false
156227$at_check_filter
156228at_fn_diff_devnull "$at_stderr" || at_failed=:
156229$at_diff expout "$at_stdout" || at_failed=:
156230at_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"
156239at_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>&-
156244at_status=$? at_failed=false
156245$at_check_filter
156246at_fn_diff_devnull "$at_stderr" || at_failed=:
156247$at_diff expout "$at_stdout" || at_failed=:
156248at_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
156254fi
156255{ set +x
156256$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
156257at_fn_check_prepare_trace "java.at:369"
156258( $at_check_trace; bison -o Calc.java Calc.y
156259) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156260at_status=$? at_failed=false
156261$at_check_filter
156262at_fn_diff_devnull "$at_stderr" || at_failed=:
156263at_fn_diff_devnull "$at_stdout" || at_failed=:
156264at_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"
156278at_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>&-
156281at_status=$? at_failed=false
156282$at_check_filter
156283echo stderr:; cat "$at_stderr"
156284echo stdout:; cat "$at_stdout"
156285at_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.
156291cat >input <<'_ATEOF'
1562921 + 2 * 3 = 7
1562931 + 2 * -3 = -5
156294
156295-1^2 = -1
156296(-1)^2 = 1
156297
156298---1 = -1
156299
1563001 - 2 - 3 = -4
1563011 - (2 - 3) = 2
156302
1563032^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"
156309at_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>&-
156312at_status=$? at_failed=false
156313$at_check_filter
156314echo stderr:; tee stderr <"$at_stderr"
156315at_fn_diff_devnull "$at_stdout" || at_failed=:
156316at_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.
156323cat >input <<'_ATEOF'
1563240 0
156325_ATEOF
156326
156327{ set +x
156328$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
156329at_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>&-
156332at_status=$? at_failed=false
156333$at_check_filter
156334echo stderr:; tee stderr <"$at_stderr"
156335at_fn_diff_devnull "$at_stdout" || at_failed=:
156336at_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.
156344cat >expout <<'_ATEOF'
1563451.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.
156351sed 's/syntax error, .*$/syntax error/' expout >at-expout
156352mv at-expout expout
156353# 4. Check
156354{ set +x
156355$as_echo "$at_srcdir/java.at:369: cat stderr"
156356at_fn_check_prepare_trace "java.at:369"
156357( $at_check_trace; cat stderr
156358) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156359at_status=$? at_failed=false
156360$at_check_filter
156361at_fn_diff_devnull "$at_stderr" || at_failed=:
156362$at_diff expout "$at_stdout" || at_failed=:
156363at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
156364$at_failed && at_fn_log_failure
156365$at_traceon; }
156366
156367
156368cat >input <<'_ATEOF'
1563691//2
156370_ATEOF
156371
156372{ set +x
156373$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
156374at_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>&-
156377at_status=$? at_failed=false
156378$at_check_filter
156379echo stderr:; tee stderr <"$at_stderr"
156380at_fn_diff_devnull "$at_stdout" || at_failed=:
156381at_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.
156389cat >expout <<'_ATEOF'
1563901.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.
156396sed 's/syntax error, .*$/syntax error/' expout >at-expout
156397mv at-expout expout
156398# 4. Check
156399{ set +x
156400$as_echo "$at_srcdir/java.at:369: cat stderr"
156401at_fn_check_prepare_trace "java.at:369"
156402( $at_check_trace; cat stderr
156403) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156404at_status=$? at_failed=false
156405$at_check_filter
156406at_fn_diff_devnull "$at_stderr" || at_failed=:
156407$at_diff expout "$at_stdout" || at_failed=:
156408at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
156409$at_failed && at_fn_log_failure
156410$at_traceon; }
156411
156412
156413cat >input <<'_ATEOF'
156414error
156415_ATEOF
156416
156417{ set +x
156418$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
156419at_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>&-
156422at_status=$? at_failed=false
156423$at_check_filter
156424echo stderr:; tee stderr <"$at_stderr"
156425at_fn_diff_devnull "$at_stdout" || at_failed=:
156426at_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.
156434cat >expout <<'_ATEOF'
1564351.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.
156441sed 's/syntax error, .*$/syntax error/' expout >at-expout
156442mv at-expout expout
156443# 4. Check
156444{ set +x
156445$as_echo "$at_srcdir/java.at:369: cat stderr"
156446at_fn_check_prepare_trace "java.at:369"
156447( $at_check_trace; cat stderr
156448) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156449at_status=$? at_failed=false
156450$at_check_filter
156451at_fn_diff_devnull "$at_stderr" || at_failed=:
156452$at_diff expout "$at_stdout" || at_failed=:
156453at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
156454$at_failed && at_fn_log_failure
156455$at_traceon; }
156456
156457
156458cat >input <<'_ATEOF'
1564591 = 2 = 3
156460_ATEOF
156461
156462{ set +x
156463$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
156464at_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>&-
156467at_status=$? at_failed=false
156468$at_check_filter
156469echo stderr:; tee stderr <"$at_stderr"
156470at_fn_diff_devnull "$at_stdout" || at_failed=:
156471at_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.
156479cat >expout <<'_ATEOF'
1564801.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.
156486sed 's/syntax error, .*$/syntax error/' expout >at-expout
156487mv at-expout expout
156488# 4. Check
156489{ set +x
156490$as_echo "$at_srcdir/java.at:369: cat stderr"
156491at_fn_check_prepare_trace "java.at:369"
156492( $at_check_trace; cat stderr
156493) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156494at_status=$? at_failed=false
156495$at_check_filter
156496at_fn_diff_devnull "$at_stderr" || at_failed=:
156497$at_diff expout "$at_stdout" || at_failed=:
156498at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
156499$at_failed && at_fn_log_failure
156500$at_traceon; }
156501
156502
156503cat >input <<'_ATEOF'
156504
156505+1
156506_ATEOF
156507
156508{ set +x
156509$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
156510at_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>&-
156513at_status=$? at_failed=false
156514$at_check_filter
156515echo stderr:; tee stderr <"$at_stderr"
156516at_fn_diff_devnull "$at_stdout" || at_failed=:
156517at_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.
156525cat >expout <<'_ATEOF'
1565262.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.
156532sed 's/syntax error, .*$/syntax error/' expout >at-expout
156533mv at-expout expout
156534# 4. Check
156535{ set +x
156536$as_echo "$at_srcdir/java.at:369: cat stderr"
156537at_fn_check_prepare_trace "java.at:369"
156538( $at_check_trace; cat stderr
156539) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156540at_status=$? at_failed=false
156541$at_check_filter
156542at_fn_diff_devnull "$at_stderr" || at_failed=:
156543$at_diff expout "$at_stdout" || at_failed=:
156544at_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"
156552at_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>&-
156555at_status=$? at_failed=false
156556$at_check_filter
156557echo stderr:; tee stderr <"$at_stderr"
156558at_fn_diff_devnull "$at_stdout" || at_failed=:
156559at_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.
156567cat >expout <<'_ATEOF'
1565681.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.
156574sed 's/syntax error, .*$/syntax error/' expout >at-expout
156575mv at-expout expout
156576# 4. Check
156577{ set +x
156578$as_echo "$at_srcdir/java.at:369: cat stderr"
156579at_fn_check_prepare_trace "java.at:369"
156580( $at_check_trace; cat stderr
156581) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156582at_status=$? at_failed=false
156583$at_check_filter
156584at_fn_diff_devnull "$at_stderr" || at_failed=:
156585$at_diff expout "$at_stdout" || at_failed=:
156586at_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#
156608cat >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"
156614at_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>&-
156617at_status=$? at_failed=false
156618$at_check_filter
156619echo stderr:; tee stderr <"$at_stderr"
156620at_fn_diff_devnull "$at_stdout" || at_failed=:
156621at_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.
156629cat >expout <<'_ATEOF'
1566301.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1566311.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1566321.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1566331.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1566341.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.
156640sed 's/syntax error, .*$/syntax error/' expout >at-expout
156641mv at-expout expout
156642# 4. Check
156643{ set +x
156644$as_echo "$at_srcdir/java.at:369: cat stderr"
156645at_fn_check_prepare_trace "java.at:369"
156646( $at_check_trace; cat stderr
156647) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156648at_status=$? at_failed=false
156649$at_check_filter
156650at_fn_diff_devnull "$at_stderr" || at_failed=:
156651$at_diff expout "$at_stdout" || at_failed=:
156652at_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.
156660cat >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"
156666at_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>&-
156669at_status=$? at_failed=false
156670$at_check_filter
156671echo stderr:; tee stderr <"$at_stderr"
156672at_fn_diff_devnull "$at_stdout" || at_failed=:
156673at_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.
156681cat >expout <<'_ATEOF'
1566821.7: syntax error, unexpected number
1566831.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.
156689sed 's/syntax error, .*$/syntax error/' expout >at-expout
156690mv at-expout expout
156691# 4. Check
156692{ set +x
156693$as_echo "$at_srcdir/java.at:369: cat stderr"
156694at_fn_check_prepare_trace "java.at:369"
156695( $at_check_trace; cat stderr
156696) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156697at_status=$? at_failed=false
156698$at_check_filter
156699at_fn_diff_devnull "$at_stderr" || at_failed=:
156700$at_diff expout "$at_stdout" || at_failed=:
156701at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
156702$at_failed && at_fn_log_failure
156703$at_traceon; }
156704
156705
156706cat >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"
156712at_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>&-
156715at_status=$? at_failed=false
156716$at_check_filter
156717echo stderr:; tee stderr <"$at_stderr"
156718at_fn_diff_devnull "$at_stdout" || at_failed=:
156719at_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.
156727cat >expout <<'_ATEOF'
1567281.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1567291.8: syntax error, unexpected number
1567301.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.
156736sed 's/syntax error, .*$/syntax error/' expout >at-expout
156737mv at-expout expout
156738# 4. Check
156739{ set +x
156740$as_echo "$at_srcdir/java.at:369: cat stderr"
156741at_fn_check_prepare_trace "java.at:369"
156742( $at_check_trace; cat stderr
156743) >>"$at_stdout" 2>>"$at_stderr" 5>&-
156744at_status=$? at_failed=false
156745$at_check_filter
156746at_fn_diff_devnull "$at_stderr" || at_failed=:
156747$at_diff expout "$at_stdout" || at_failed=:
156748at_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
156758read at_status <"$at_status_file"
156759#AT_STOP_313
156760#AT_START_314
156761at_fn_group_banner 314 'java.at:369' \
156762  "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 19
156763at_xfail=no
156764(
156765  $as_echo "314. $at_setup_line: testing $at_desc ..."
156766  $at_traceon
156767
156768
156769
156770
156771
156772cat >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%%
156809input:
156810  line
156811| input line
156812;
156813
156814line:
156815  '\n'
156816| exp '\n'
156817| error '\n'
156818;
156819
156820exp:
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
156911class 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
156954if 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"
156962at_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>&-
156966at_status=$? at_failed=false
156967$at_check_filter
156968echo stderr:; cat "$at_stderr"
156969echo stdout:; cat "$at_stdout"
156970at_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"
156976at_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>&-
156979at_status=$? at_failed=false
156980$at_check_filter
156981echo stderr:; cat "$at_stderr"
156982echo stdout:; cat "$at_stdout"
156983at_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"
156992at_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>&-
156997at_status=$? at_failed=false
156998$at_check_filter
156999at_fn_diff_devnull "$at_stderr" || at_failed=:
157000$at_diff expout "$at_stdout" || at_failed=:
157001at_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"
157010at_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>&-
157015at_status=$? at_failed=false
157016$at_check_filter
157017at_fn_diff_devnull "$at_stderr" || at_failed=:
157018$at_diff expout "$at_stdout" || at_failed=:
157019at_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
157025fi
157026{ set +x
157027$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
157028at_fn_check_prepare_trace "java.at:369"
157029( $at_check_trace; bison -o Calc.java Calc.y
157030) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157031at_status=$? at_failed=false
157032$at_check_filter
157033at_fn_diff_devnull "$at_stderr" || at_failed=:
157034at_fn_diff_devnull "$at_stdout" || at_failed=:
157035at_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"
157049at_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>&-
157052at_status=$? at_failed=false
157053$at_check_filter
157054echo stderr:; cat "$at_stderr"
157055echo stdout:; cat "$at_stdout"
157056at_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.
157062cat >input <<'_ATEOF'
1570631 + 2 * 3 = 7
1570641 + 2 * -3 = -5
157065
157066-1^2 = -1
157067(-1)^2 = 1
157068
157069---1 = -1
157070
1570711 - 2 - 3 = -4
1570721 - (2 - 3) = 2
157073
1570742^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"
157080at_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>&-
157083at_status=$? at_failed=false
157084$at_check_filter
157085echo stderr:; tee stderr <"$at_stderr"
157086at_fn_diff_devnull "$at_stdout" || at_failed=:
157087at_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.
157094cat >input <<'_ATEOF'
1570950 0
157096_ATEOF
157097
157098{ set +x
157099$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
157100at_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>&-
157103at_status=$? at_failed=false
157104$at_check_filter
157105echo stderr:; tee stderr <"$at_stderr"
157106at_fn_diff_devnull "$at_stdout" || at_failed=:
157107at_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.
157115cat >expout <<'_ATEOF'
1571161.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"
157126at_fn_check_prepare_trace "java.at:369"
157127( $at_check_trace; cat stderr
157128) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157129at_status=$? at_failed=false
157130$at_check_filter
157131at_fn_diff_devnull "$at_stderr" || at_failed=:
157132$at_diff expout "$at_stdout" || at_failed=:
157133at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
157134$at_failed && at_fn_log_failure
157135$at_traceon; }
157136
157137
157138cat >input <<'_ATEOF'
1571391//2
157140_ATEOF
157141
157142{ set +x
157143$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
157144at_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>&-
157147at_status=$? at_failed=false
157148$at_check_filter
157149echo stderr:; tee stderr <"$at_stderr"
157150at_fn_diff_devnull "$at_stdout" || at_failed=:
157151at_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.
157159cat >expout <<'_ATEOF'
1571601.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"
157170at_fn_check_prepare_trace "java.at:369"
157171( $at_check_trace; cat stderr
157172) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157173at_status=$? at_failed=false
157174$at_check_filter
157175at_fn_diff_devnull "$at_stderr" || at_failed=:
157176$at_diff expout "$at_stdout" || at_failed=:
157177at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
157178$at_failed && at_fn_log_failure
157179$at_traceon; }
157180
157181
157182cat >input <<'_ATEOF'
157183error
157184_ATEOF
157185
157186{ set +x
157187$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
157188at_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>&-
157191at_status=$? at_failed=false
157192$at_check_filter
157193echo stderr:; tee stderr <"$at_stderr"
157194at_fn_diff_devnull "$at_stdout" || at_failed=:
157195at_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.
157203cat >expout <<'_ATEOF'
1572041.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"
157214at_fn_check_prepare_trace "java.at:369"
157215( $at_check_trace; cat stderr
157216) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157217at_status=$? at_failed=false
157218$at_check_filter
157219at_fn_diff_devnull "$at_stderr" || at_failed=:
157220$at_diff expout "$at_stdout" || at_failed=:
157221at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
157222$at_failed && at_fn_log_failure
157223$at_traceon; }
157224
157225
157226cat >input <<'_ATEOF'
1572271 = 2 = 3
157228_ATEOF
157229
157230{ set +x
157231$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
157232at_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>&-
157235at_status=$? at_failed=false
157236$at_check_filter
157237echo stderr:; tee stderr <"$at_stderr"
157238at_fn_diff_devnull "$at_stdout" || at_failed=:
157239at_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.
157247cat >expout <<'_ATEOF'
1572481.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"
157258at_fn_check_prepare_trace "java.at:369"
157259( $at_check_trace; cat stderr
157260) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157261at_status=$? at_failed=false
157262$at_check_filter
157263at_fn_diff_devnull "$at_stderr" || at_failed=:
157264$at_diff expout "$at_stdout" || at_failed=:
157265at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
157266$at_failed && at_fn_log_failure
157267$at_traceon; }
157268
157269
157270cat >input <<'_ATEOF'
157271
157272+1
157273_ATEOF
157274
157275{ set +x
157276$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
157277at_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>&-
157280at_status=$? at_failed=false
157281$at_check_filter
157282echo stderr:; tee stderr <"$at_stderr"
157283at_fn_diff_devnull "$at_stdout" || at_failed=:
157284at_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.
157292cat >expout <<'_ATEOF'
1572932.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"
157303at_fn_check_prepare_trace "java.at:369"
157304( $at_check_trace; cat stderr
157305) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157306at_status=$? at_failed=false
157307$at_check_filter
157308at_fn_diff_devnull "$at_stderr" || at_failed=:
157309$at_diff expout "$at_stdout" || at_failed=:
157310at_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"
157318at_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>&-
157321at_status=$? at_failed=false
157322$at_check_filter
157323echo stderr:; tee stderr <"$at_stderr"
157324at_fn_diff_devnull "$at_stdout" || at_failed=:
157325at_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.
157333cat >expout <<'_ATEOF'
1573341.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"
157344at_fn_check_prepare_trace "java.at:369"
157345( $at_check_trace; cat stderr
157346) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157347at_status=$? at_failed=false
157348$at_check_filter
157349at_fn_diff_devnull "$at_stderr" || at_failed=:
157350$at_diff expout "$at_stdout" || at_failed=:
157351at_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#
157373cat >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"
157379at_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>&-
157382at_status=$? at_failed=false
157383$at_check_filter
157384echo stderr:; tee stderr <"$at_stderr"
157385at_fn_diff_devnull "$at_stdout" || at_failed=:
157386at_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.
157394cat >expout <<'_ATEOF'
1573951.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1573961.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1573971.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1573981.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1573991.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"
157409at_fn_check_prepare_trace "java.at:369"
157410( $at_check_trace; cat stderr
157411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157412at_status=$? at_failed=false
157413$at_check_filter
157414at_fn_diff_devnull "$at_stderr" || at_failed=:
157415$at_diff expout "$at_stdout" || at_failed=:
157416at_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.
157424cat >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"
157430at_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>&-
157433at_status=$? at_failed=false
157434$at_check_filter
157435echo stderr:; tee stderr <"$at_stderr"
157436at_fn_diff_devnull "$at_stdout" || at_failed=:
157437at_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.
157445cat >expout <<'_ATEOF'
1574461.7: syntax error, unexpected number
1574471.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"
157457at_fn_check_prepare_trace "java.at:369"
157458( $at_check_trace; cat stderr
157459) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157460at_status=$? at_failed=false
157461$at_check_filter
157462at_fn_diff_devnull "$at_stderr" || at_failed=:
157463$at_diff expout "$at_stdout" || at_failed=:
157464at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
157465$at_failed && at_fn_log_failure
157466$at_traceon; }
157467
157468
157469cat >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"
157475at_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>&-
157478at_status=$? at_failed=false
157479$at_check_filter
157480echo stderr:; tee stderr <"$at_stderr"
157481at_fn_diff_devnull "$at_stdout" || at_failed=:
157482at_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.
157490cat >expout <<'_ATEOF'
1574911.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1574921.8: syntax error, unexpected number
1574931.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"
157503at_fn_check_prepare_trace "java.at:369"
157504( $at_check_trace; cat stderr
157505) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157506at_status=$? at_failed=false
157507$at_check_filter
157508at_fn_diff_devnull "$at_stderr" || at_failed=:
157509$at_diff expout "$at_stdout" || at_failed=:
157510at_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
157520read at_status <"$at_status_file"
157521#AT_STOP_314
157522#AT_START_315
157523at_fn_group_banner 315 'java.at:455' \
157524  "Java parser class and package names" "            " 20
157525at_xfail=no
157526(
157527  $as_echo "315. $at_setup_line: testing $at_desc ..."
157528  $at_traceon
157529
157530
157531
157532cat >YYParser.y <<'_ATEOF'
157533
157534%language "Java"
157535%locations
157536%debug
157537%error-verbose
157538%token-table
157539
157540%%
157541start: "end" {};
157542%%
157543class Position {}
157544_ATEOF
157545
157546if 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"
157554at_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>&-
157558at_status=$? at_failed=false
157559$at_check_filter
157560echo stderr:; cat "$at_stderr"
157561echo stdout:; cat "$at_stdout"
157562at_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"
157568at_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>&-
157571at_status=$? at_failed=false
157572$at_check_filter
157573echo stderr:; cat "$at_stderr"
157574echo stdout:; cat "$at_stdout"
157575at_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"
157584at_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>&-
157589at_status=$? at_failed=false
157590$at_check_filter
157591at_fn_diff_devnull "$at_stderr" || at_failed=:
157592$at_diff expout "$at_stdout" || at_failed=:
157593at_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"
157602at_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>&-
157607at_status=$? at_failed=false
157608$at_check_filter
157609at_fn_diff_devnull "$at_stderr" || at_failed=:
157610$at_diff expout "$at_stdout" || at_failed=:
157611at_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
157617fi
157618{ set +x
157619$as_echo "$at_srcdir/java.at:457: bison YYParser.y"
157620at_fn_check_prepare_trace "java.at:457"
157621( $at_check_trace; bison YYParser.y
157622) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157623at_status=$? at_failed=false
157624$at_check_filter
157625at_fn_diff_devnull "$at_stderr" || at_failed=:
157626at_fn_diff_devnull "$at_stdout" || at_failed=:
157627at_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"
157634at_fn_check_prepare_trace "java.at:457"
157635( $at_check_trace; grep '[mb]4_' YYParser.y
157636) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157637at_status=$? at_failed=false
157638$at_check_filter
157639at_fn_diff_devnull "$at_stderr" || at_failed=:
157640echo stdout:; cat "$at_stdout"
157641at_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"
157654at_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>&-
157657at_status=$? at_failed=false
157658$at_check_filter
157659echo stderr:; cat "$at_stderr"
157660echo stdout:; cat "$at_stdout"
157661at_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"
157668at_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>&-
157671at_status=$? at_failed=false
157672$at_check_filter
157673at_fn_diff_devnull "$at_stderr" || at_failed=:
157674echo >>"$at_stdout"; $as_echo "1
157675" | \
157676  $at_diff - "$at_stdout" || at_failed=:
157677at_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
157684cat >YYParser.y <<'_ATEOF'
157685
157686%language "Java"
157687%locations
157688%debug
157689%error-verbose
157690%token-table
157691%name-prefix "Prefix"
157692%%
157693start: "end" {};
157694%%
157695class Position {}
157696_ATEOF
157697
157698if 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"
157706at_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>&-
157710at_status=$? at_failed=false
157711$at_check_filter
157712echo stderr:; cat "$at_stderr"
157713echo stdout:; cat "$at_stdout"
157714at_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"
157720at_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>&-
157723at_status=$? at_failed=false
157724$at_check_filter
157725echo stderr:; cat "$at_stderr"
157726echo stdout:; cat "$at_stdout"
157727at_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"
157736at_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>&-
157741at_status=$? at_failed=false
157742$at_check_filter
157743at_fn_diff_devnull "$at_stderr" || at_failed=:
157744$at_diff expout "$at_stdout" || at_failed=:
157745at_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"
157754at_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>&-
157759at_status=$? at_failed=false
157760$at_check_filter
157761at_fn_diff_devnull "$at_stderr" || at_failed=:
157762$at_diff expout "$at_stdout" || at_failed=:
157763at_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
157769fi
157770{ set +x
157771$as_echo "$at_srcdir/java.at:460: bison YYParser.y"
157772at_fn_check_prepare_trace "java.at:460"
157773( $at_check_trace; bison YYParser.y
157774) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157775at_status=$? at_failed=false
157776$at_check_filter
157777at_fn_diff_devnull "$at_stderr" || at_failed=:
157778at_fn_diff_devnull "$at_stdout" || at_failed=:
157779at_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"
157786at_fn_check_prepare_trace "java.at:460"
157787( $at_check_trace; grep '[mb]4_' YYParser.y
157788) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157789at_status=$? at_failed=false
157790$at_check_filter
157791at_fn_diff_devnull "$at_stderr" || at_failed=:
157792echo stdout:; cat "$at_stdout"
157793at_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"
157806at_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>&-
157809at_status=$? at_failed=false
157810$at_check_filter
157811echo stderr:; cat "$at_stderr"
157812echo stdout:; cat "$at_stdout"
157813at_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"
157820at_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>&-
157823at_status=$? at_failed=false
157824$at_check_filter
157825at_fn_diff_devnull "$at_stderr" || at_failed=:
157826echo >>"$at_stdout"; $as_echo "1
157827" | \
157828  $at_diff - "$at_stdout" || at_failed=:
157829at_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
157836cat >YYParser.y <<'_ATEOF'
157837
157838%language "Java"
157839%locations
157840%debug
157841%error-verbose
157842%token-table
157843%define parser_class_name "ParserClassName"
157844%%
157845start: "end" {};
157846%%
157847class Position {}
157848_ATEOF
157849
157850if 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"
157858at_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>&-
157862at_status=$? at_failed=false
157863$at_check_filter
157864echo stderr:; cat "$at_stderr"
157865echo stdout:; cat "$at_stdout"
157866at_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"
157872at_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>&-
157875at_status=$? at_failed=false
157876$at_check_filter
157877echo stderr:; cat "$at_stderr"
157878echo stdout:; cat "$at_stdout"
157879at_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"
157888at_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>&-
157893at_status=$? at_failed=false
157894$at_check_filter
157895at_fn_diff_devnull "$at_stderr" || at_failed=:
157896$at_diff expout "$at_stdout" || at_failed=:
157897at_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"
157906at_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>&-
157911at_status=$? at_failed=false
157912$at_check_filter
157913at_fn_diff_devnull "$at_stderr" || at_failed=:
157914$at_diff expout "$at_stdout" || at_failed=:
157915at_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
157921fi
157922{ set +x
157923$as_echo "$at_srcdir/java.at:463: bison YYParser.y"
157924at_fn_check_prepare_trace "java.at:463"
157925( $at_check_trace; bison YYParser.y
157926) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157927at_status=$? at_failed=false
157928$at_check_filter
157929at_fn_diff_devnull "$at_stderr" || at_failed=:
157930at_fn_diff_devnull "$at_stdout" || at_failed=:
157931at_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"
157938at_fn_check_prepare_trace "java.at:463"
157939( $at_check_trace; grep '[mb]4_' YYParser.y
157940) >>"$at_stdout" 2>>"$at_stderr" 5>&-
157941at_status=$? at_failed=false
157942$at_check_filter
157943at_fn_diff_devnull "$at_stderr" || at_failed=:
157944echo stdout:; cat "$at_stdout"
157945at_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"
157958at_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>&-
157961at_status=$? at_failed=false
157962$at_check_filter
157963echo stderr:; cat "$at_stderr"
157964echo stdout:; cat "$at_stdout"
157965at_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"
157972at_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>&-
157975at_status=$? at_failed=false
157976$at_check_filter
157977at_fn_diff_devnull "$at_stderr" || at_failed=:
157978echo >>"$at_stdout"; $as_echo "1
157979" | \
157980  $at_diff - "$at_stdout" || at_failed=:
157981at_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
157988cat >YYParser.y <<'_ATEOF'
157989
157990%language "Java"
157991%locations
157992%debug
157993%error-verbose
157994%token-table
157995%define package "user_java_package"
157996%%
157997start: "end" {};
157998%%
157999class Position {}
158000_ATEOF
158001
158002if 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"
158010at_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>&-
158014at_status=$? at_failed=false
158015$at_check_filter
158016echo stderr:; cat "$at_stderr"
158017echo stdout:; cat "$at_stdout"
158018at_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"
158024at_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>&-
158027at_status=$? at_failed=false
158028$at_check_filter
158029echo stderr:; cat "$at_stderr"
158030echo stdout:; cat "$at_stdout"
158031at_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"
158040at_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>&-
158045at_status=$? at_failed=false
158046$at_check_filter
158047at_fn_diff_devnull "$at_stderr" || at_failed=:
158048$at_diff expout "$at_stdout" || at_failed=:
158049at_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"
158058at_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>&-
158063at_status=$? at_failed=false
158064$at_check_filter
158065at_fn_diff_devnull "$at_stderr" || at_failed=:
158066$at_diff expout "$at_stdout" || at_failed=:
158067at_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
158073fi
158074{ set +x
158075$as_echo "$at_srcdir/java.at:466: bison YYParser.y"
158076at_fn_check_prepare_trace "java.at:466"
158077( $at_check_trace; bison YYParser.y
158078) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158079at_status=$? at_failed=false
158080$at_check_filter
158081at_fn_diff_devnull "$at_stderr" || at_failed=:
158082at_fn_diff_devnull "$at_stdout" || at_failed=:
158083at_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"
158090at_fn_check_prepare_trace "java.at:466"
158091( $at_check_trace; grep '[mb]4_' YYParser.y
158092) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158093at_status=$? at_failed=false
158094$at_check_filter
158095at_fn_diff_devnull "$at_stderr" || at_failed=:
158096echo stdout:; cat "$at_stdout"
158097at_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"
158110at_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>&-
158113at_status=$? at_failed=false
158114$at_check_filter
158115echo stderr:; cat "$at_stderr"
158116echo stdout:; cat "$at_stdout"
158117at_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"
158124at_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>&-
158127at_status=$? at_failed=false
158128$at_check_filter
158129at_fn_diff_devnull "$at_stderr" || at_failed=:
158130echo >>"$at_stdout"; $as_echo "1
158131" | \
158132  $at_diff - "$at_stdout" || at_failed=:
158133at_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
158142read at_status <"$at_status_file"
158143#AT_STOP_315
158144#AT_START_316
158145at_fn_group_banner 316 'java.at:476' \
158146  "Java parser class modifiers" "                    " 20
158147at_xfail=no
158148(
158149  $as_echo "316. $at_setup_line: testing $at_desc ..."
158150  $at_traceon
158151
158152
158153
158154cat >YYParser.y <<'_ATEOF'
158155
158156%language "Java"
158157%locations
158158%debug
158159%error-verbose
158160%token-table
158161%define abstract
158162%%
158163start: "end" {};
158164%%
158165class Position {}
158166_ATEOF
158167
158168if 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"
158176at_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>&-
158180at_status=$? at_failed=false
158181$at_check_filter
158182echo stderr:; cat "$at_stderr"
158183echo stdout:; cat "$at_stdout"
158184at_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"
158190at_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>&-
158193at_status=$? at_failed=false
158194$at_check_filter
158195echo stderr:; cat "$at_stderr"
158196echo stdout:; cat "$at_stdout"
158197at_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"
158206at_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>&-
158211at_status=$? at_failed=false
158212$at_check_filter
158213at_fn_diff_devnull "$at_stderr" || at_failed=:
158214$at_diff expout "$at_stdout" || at_failed=:
158215at_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"
158224at_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>&-
158229at_status=$? at_failed=false
158230$at_check_filter
158231at_fn_diff_devnull "$at_stderr" || at_failed=:
158232$at_diff expout "$at_stdout" || at_failed=:
158233at_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
158239fi
158240{ set +x
158241$as_echo "$at_srcdir/java.at:478: bison YYParser.y"
158242at_fn_check_prepare_trace "java.at:478"
158243( $at_check_trace; bison YYParser.y
158244) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158245at_status=$? at_failed=false
158246$at_check_filter
158247at_fn_diff_devnull "$at_stderr" || at_failed=:
158248at_fn_diff_devnull "$at_stdout" || at_failed=:
158249at_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"
158256at_fn_check_prepare_trace "java.at:478"
158257( $at_check_trace; grep '[mb]4_' YYParser.y
158258) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158259at_status=$? at_failed=false
158260$at_check_filter
158261at_fn_diff_devnull "$at_stderr" || at_failed=:
158262echo stdout:; cat "$at_stdout"
158263at_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"
158276at_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>&-
158279at_status=$? at_failed=false
158280$at_check_filter
158281echo stderr:; cat "$at_stderr"
158282echo stdout:; cat "$at_stdout"
158283at_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"
158290at_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>&-
158293at_status=$? at_failed=false
158294$at_check_filter
158295at_fn_diff_devnull "$at_stderr" || at_failed=:
158296echo >>"$at_stdout"; $as_echo "1
158297" | \
158298  $at_diff - "$at_stdout" || at_failed=:
158299at_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
158306cat >YYParser.y <<'_ATEOF'
158307
158308%language "Java"
158309%locations
158310%debug
158311%error-verbose
158312%token-table
158313%define final
158314%%
158315start: "end" {};
158316%%
158317class Position {}
158318_ATEOF
158319
158320if 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"
158328at_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>&-
158332at_status=$? at_failed=false
158333$at_check_filter
158334echo stderr:; cat "$at_stderr"
158335echo stdout:; cat "$at_stdout"
158336at_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"
158342at_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>&-
158345at_status=$? at_failed=false
158346$at_check_filter
158347echo stderr:; cat "$at_stderr"
158348echo stdout:; cat "$at_stdout"
158349at_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"
158358at_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>&-
158363at_status=$? at_failed=false
158364$at_check_filter
158365at_fn_diff_devnull "$at_stderr" || at_failed=:
158366$at_diff expout "$at_stdout" || at_failed=:
158367at_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"
158376at_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>&-
158381at_status=$? at_failed=false
158382$at_check_filter
158383at_fn_diff_devnull "$at_stderr" || at_failed=:
158384$at_diff expout "$at_stdout" || at_failed=:
158385at_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
158391fi
158392{ set +x
158393$as_echo "$at_srcdir/java.at:481: bison YYParser.y"
158394at_fn_check_prepare_trace "java.at:481"
158395( $at_check_trace; bison YYParser.y
158396) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158397at_status=$? at_failed=false
158398$at_check_filter
158399at_fn_diff_devnull "$at_stderr" || at_failed=:
158400at_fn_diff_devnull "$at_stdout" || at_failed=:
158401at_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"
158408at_fn_check_prepare_trace "java.at:481"
158409( $at_check_trace; grep '[mb]4_' YYParser.y
158410) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158411at_status=$? at_failed=false
158412$at_check_filter
158413at_fn_diff_devnull "$at_stderr" || at_failed=:
158414echo stdout:; cat "$at_stdout"
158415at_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"
158428at_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>&-
158431at_status=$? at_failed=false
158432$at_check_filter
158433echo stderr:; cat "$at_stderr"
158434echo stdout:; cat "$at_stdout"
158435at_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"
158442at_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>&-
158445at_status=$? at_failed=false
158446$at_check_filter
158447at_fn_diff_devnull "$at_stderr" || at_failed=:
158448echo >>"$at_stdout"; $as_echo "1
158449" | \
158450  $at_diff - "$at_stdout" || at_failed=:
158451at_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
158458cat >YYParser.y <<'_ATEOF'
158459
158460%language "Java"
158461%locations
158462%debug
158463%error-verbose
158464%token-table
158465%define strictfp
158466%%
158467start: "end" {};
158468%%
158469class Position {}
158470_ATEOF
158471
158472if 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"
158480at_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>&-
158484at_status=$? at_failed=false
158485$at_check_filter
158486echo stderr:; cat "$at_stderr"
158487echo stdout:; cat "$at_stdout"
158488at_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"
158494at_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>&-
158497at_status=$? at_failed=false
158498$at_check_filter
158499echo stderr:; cat "$at_stderr"
158500echo stdout:; cat "$at_stdout"
158501at_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"
158510at_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>&-
158515at_status=$? at_failed=false
158516$at_check_filter
158517at_fn_diff_devnull "$at_stderr" || at_failed=:
158518$at_diff expout "$at_stdout" || at_failed=:
158519at_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"
158528at_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>&-
158533at_status=$? at_failed=false
158534$at_check_filter
158535at_fn_diff_devnull "$at_stderr" || at_failed=:
158536$at_diff expout "$at_stdout" || at_failed=:
158537at_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
158543fi
158544{ set +x
158545$as_echo "$at_srcdir/java.at:484: bison YYParser.y"
158546at_fn_check_prepare_trace "java.at:484"
158547( $at_check_trace; bison YYParser.y
158548) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158549at_status=$? at_failed=false
158550$at_check_filter
158551at_fn_diff_devnull "$at_stderr" || at_failed=:
158552at_fn_diff_devnull "$at_stdout" || at_failed=:
158553at_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"
158560at_fn_check_prepare_trace "java.at:484"
158561( $at_check_trace; grep '[mb]4_' YYParser.y
158562) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158563at_status=$? at_failed=false
158564$at_check_filter
158565at_fn_diff_devnull "$at_stderr" || at_failed=:
158566echo stdout:; cat "$at_stdout"
158567at_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"
158580at_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>&-
158583at_status=$? at_failed=false
158584$at_check_filter
158585echo stderr:; cat "$at_stderr"
158586echo stdout:; cat "$at_stdout"
158587at_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"
158594at_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>&-
158597at_status=$? at_failed=false
158598$at_check_filter
158599at_fn_diff_devnull "$at_stderr" || at_failed=:
158600echo >>"$at_stdout"; $as_echo "1
158601" | \
158602  $at_diff - "$at_stdout" || at_failed=:
158603at_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
158610cat >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%%
158621start: "end" {};
158622%%
158623class Position {}
158624_ATEOF
158625
158626if 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"
158634at_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>&-
158638at_status=$? at_failed=false
158639$at_check_filter
158640echo stderr:; cat "$at_stderr"
158641echo stdout:; cat "$at_stdout"
158642at_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"
158648at_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>&-
158651at_status=$? at_failed=false
158652$at_check_filter
158653echo stderr:; cat "$at_stderr"
158654echo stdout:; cat "$at_stdout"
158655at_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"
158664at_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>&-
158669at_status=$? at_failed=false
158670$at_check_filter
158671at_fn_diff_devnull "$at_stderr" || at_failed=:
158672$at_diff expout "$at_stdout" || at_failed=:
158673at_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"
158682at_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>&-
158687at_status=$? at_failed=false
158688$at_check_filter
158689at_fn_diff_devnull "$at_stderr" || at_failed=:
158690$at_diff expout "$at_stdout" || at_failed=:
158691at_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
158697fi
158698{ set +x
158699$as_echo "$at_srcdir/java.at:487: bison YYParser.y"
158700at_fn_check_prepare_trace "java.at:487"
158701( $at_check_trace; bison YYParser.y
158702) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158703at_status=$? at_failed=false
158704$at_check_filter
158705at_fn_diff_devnull "$at_stderr" || at_failed=:
158706at_fn_diff_devnull "$at_stdout" || at_failed=:
158707at_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"
158714at_fn_check_prepare_trace "java.at:487"
158715( $at_check_trace; grep '[mb]4_' YYParser.y
158716) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158717at_status=$? at_failed=false
158718$at_check_filter
158719at_fn_diff_devnull "$at_stderr" || at_failed=:
158720echo stdout:; cat "$at_stdout"
158721at_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"
158734at_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>&-
158737at_status=$? at_failed=false
158738$at_check_filter
158739echo stderr:; cat "$at_stderr"
158740echo stdout:; cat "$at_stdout"
158741at_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"
158748at_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>&-
158751at_status=$? at_failed=false
158752$at_check_filter
158753at_fn_diff_devnull "$at_stderr" || at_failed=:
158754echo >>"$at_stdout"; $as_echo "1
158755" | \
158756  $at_diff - "$at_stdout" || at_failed=:
158757at_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
158764cat >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%%
158775start: "end" {};
158776%%
158777class Position {}
158778_ATEOF
158779
158780if 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"
158788at_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>&-
158792at_status=$? at_failed=false
158793$at_check_filter
158794echo stderr:; cat "$at_stderr"
158795echo stdout:; cat "$at_stdout"
158796at_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"
158802at_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>&-
158805at_status=$? at_failed=false
158806$at_check_filter
158807echo stderr:; cat "$at_stderr"
158808echo stdout:; cat "$at_stdout"
158809at_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"
158818at_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>&-
158823at_status=$? at_failed=false
158824$at_check_filter
158825at_fn_diff_devnull "$at_stderr" || at_failed=:
158826$at_diff expout "$at_stdout" || at_failed=:
158827at_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"
158836at_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>&-
158841at_status=$? at_failed=false
158842$at_check_filter
158843at_fn_diff_devnull "$at_stderr" || at_failed=:
158844$at_diff expout "$at_stdout" || at_failed=:
158845at_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
158851fi
158852{ set +x
158853$as_echo "$at_srcdir/java.at:492: bison YYParser.y"
158854at_fn_check_prepare_trace "java.at:492"
158855( $at_check_trace; bison YYParser.y
158856) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158857at_status=$? at_failed=false
158858$at_check_filter
158859at_fn_diff_devnull "$at_stderr" || at_failed=:
158860at_fn_diff_devnull "$at_stdout" || at_failed=:
158861at_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"
158868at_fn_check_prepare_trace "java.at:492"
158869( $at_check_trace; grep '[mb]4_' YYParser.y
158870) >>"$at_stdout" 2>>"$at_stderr" 5>&-
158871at_status=$? at_failed=false
158872$at_check_filter
158873at_fn_diff_devnull "$at_stderr" || at_failed=:
158874echo stdout:; cat "$at_stdout"
158875at_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"
158888at_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>&-
158891at_status=$? at_failed=false
158892$at_check_filter
158893echo stderr:; cat "$at_stderr"
158894echo stdout:; cat "$at_stdout"
158895at_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"
158902at_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>&-
158905at_status=$? at_failed=false
158906$at_check_filter
158907at_fn_diff_devnull "$at_stderr" || at_failed=:
158908echo >>"$at_stdout"; $as_echo "1
158909" | \
158910  $at_diff - "$at_stdout" || at_failed=:
158911at_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
158918cat >YYParser.y <<'_ATEOF'
158919
158920%language "Java"
158921%locations
158922%debug
158923%error-verbose
158924%token-table
158925%define public
158926%%
158927start: "end" {};
158928%%
158929class Position {}
158930_ATEOF
158931
158932if 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"
158940at_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>&-
158944at_status=$? at_failed=false
158945$at_check_filter
158946echo stderr:; cat "$at_stderr"
158947echo stdout:; cat "$at_stdout"
158948at_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"
158954at_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>&-
158957at_status=$? at_failed=false
158958$at_check_filter
158959echo stderr:; cat "$at_stderr"
158960echo stdout:; cat "$at_stdout"
158961at_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"
158970at_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>&-
158975at_status=$? at_failed=false
158976$at_check_filter
158977at_fn_diff_devnull "$at_stderr" || at_failed=:
158978$at_diff expout "$at_stdout" || at_failed=:
158979at_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"
158988at_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>&-
158993at_status=$? at_failed=false
158994$at_check_filter
158995at_fn_diff_devnull "$at_stderr" || at_failed=:
158996$at_diff expout "$at_stdout" || at_failed=:
158997at_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
159003fi
159004{ set +x
159005$as_echo "$at_srcdir/java.at:497: bison YYParser.y"
159006at_fn_check_prepare_trace "java.at:497"
159007( $at_check_trace; bison YYParser.y
159008) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159009at_status=$? at_failed=false
159010$at_check_filter
159011at_fn_diff_devnull "$at_stderr" || at_failed=:
159012at_fn_diff_devnull "$at_stdout" || at_failed=:
159013at_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"
159020at_fn_check_prepare_trace "java.at:497"
159021( $at_check_trace; grep '[mb]4_' YYParser.y
159022) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159023at_status=$? at_failed=false
159024$at_check_filter
159025at_fn_diff_devnull "$at_stderr" || at_failed=:
159026echo stdout:; cat "$at_stdout"
159027at_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"
159040at_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>&-
159043at_status=$? at_failed=false
159044$at_check_filter
159045echo stderr:; cat "$at_stderr"
159046echo stdout:; cat "$at_stdout"
159047at_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"
159054at_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>&-
159057at_status=$? at_failed=false
159058$at_check_filter
159059at_fn_diff_devnull "$at_stderr" || at_failed=:
159060echo >>"$at_stdout"; $as_echo "1
159061" | \
159062  $at_diff - "$at_stdout" || at_failed=:
159063at_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
159070cat >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%%
159081start: "end" {};
159082%%
159083class Position {}
159084_ATEOF
159085
159086if 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"
159094at_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>&-
159098at_status=$? at_failed=false
159099$at_check_filter
159100echo stderr:; cat "$at_stderr"
159101echo stdout:; cat "$at_stdout"
159102at_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"
159108at_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>&-
159111at_status=$? at_failed=false
159112$at_check_filter
159113echo stderr:; cat "$at_stderr"
159114echo stdout:; cat "$at_stdout"
159115at_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"
159124at_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>&-
159129at_status=$? at_failed=false
159130$at_check_filter
159131at_fn_diff_devnull "$at_stderr" || at_failed=:
159132$at_diff expout "$at_stdout" || at_failed=:
159133at_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"
159142at_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>&-
159147at_status=$? at_failed=false
159148$at_check_filter
159149at_fn_diff_devnull "$at_stderr" || at_failed=:
159150$at_diff expout "$at_stdout" || at_failed=:
159151at_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
159157fi
159158{ set +x
159159$as_echo "$at_srcdir/java.at:500: bison YYParser.y"
159160at_fn_check_prepare_trace "java.at:500"
159161( $at_check_trace; bison YYParser.y
159162) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159163at_status=$? at_failed=false
159164$at_check_filter
159165at_fn_diff_devnull "$at_stderr" || at_failed=:
159166at_fn_diff_devnull "$at_stdout" || at_failed=:
159167at_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"
159174at_fn_check_prepare_trace "java.at:500"
159175( $at_check_trace; grep '[mb]4_' YYParser.y
159176) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159177at_status=$? at_failed=false
159178$at_check_filter
159179at_fn_diff_devnull "$at_stderr" || at_failed=:
159180echo stdout:; cat "$at_stdout"
159181at_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"
159194at_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>&-
159197at_status=$? at_failed=false
159198$at_check_filter
159199echo stderr:; cat "$at_stderr"
159200echo stdout:; cat "$at_stdout"
159201at_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"
159208at_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>&-
159211at_status=$? at_failed=false
159212$at_check_filter
159213at_fn_diff_devnull "$at_stderr" || at_failed=:
159214echo >>"$at_stdout"; $as_echo "1
159215" | \
159216  $at_diff - "$at_stdout" || at_failed=:
159217at_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
159224cat >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%%
159235start: "end" {};
159236%%
159237class Position {}
159238_ATEOF
159239
159240if 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"
159248at_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>&-
159252at_status=$? at_failed=false
159253$at_check_filter
159254echo stderr:; cat "$at_stderr"
159255echo stdout:; cat "$at_stdout"
159256at_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"
159262at_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>&-
159265at_status=$? at_failed=false
159266$at_check_filter
159267echo stderr:; cat "$at_stderr"
159268echo stdout:; cat "$at_stdout"
159269at_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"
159278at_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>&-
159283at_status=$? at_failed=false
159284$at_check_filter
159285at_fn_diff_devnull "$at_stderr" || at_failed=:
159286$at_diff expout "$at_stdout" || at_failed=:
159287at_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"
159296at_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>&-
159301at_status=$? at_failed=false
159302$at_check_filter
159303at_fn_diff_devnull "$at_stderr" || at_failed=:
159304$at_diff expout "$at_stdout" || at_failed=:
159305at_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
159311fi
159312{ set +x
159313$as_echo "$at_srcdir/java.at:505: bison YYParser.y"
159314at_fn_check_prepare_trace "java.at:505"
159315( $at_check_trace; bison YYParser.y
159316) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159317at_status=$? at_failed=false
159318$at_check_filter
159319at_fn_diff_devnull "$at_stderr" || at_failed=:
159320at_fn_diff_devnull "$at_stdout" || at_failed=:
159321at_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"
159328at_fn_check_prepare_trace "java.at:505"
159329( $at_check_trace; grep '[mb]4_' YYParser.y
159330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159331at_status=$? at_failed=false
159332$at_check_filter
159333at_fn_diff_devnull "$at_stderr" || at_failed=:
159334echo stdout:; cat "$at_stdout"
159335at_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"
159348at_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>&-
159351at_status=$? at_failed=false
159352$at_check_filter
159353echo stderr:; cat "$at_stderr"
159354echo stdout:; cat "$at_stdout"
159355at_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"
159362at_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>&-
159365at_status=$? at_failed=false
159366$at_check_filter
159367at_fn_diff_devnull "$at_stderr" || at_failed=:
159368echo >>"$at_stdout"; $as_echo "1
159369" | \
159370  $at_diff - "$at_stdout" || at_failed=:
159371at_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
159378cat >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%%
159389start: "end" {};
159390%%
159391class Position {}
159392_ATEOF
159393
159394if 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"
159402at_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>&-
159406at_status=$? at_failed=false
159407$at_check_filter
159408echo stderr:; cat "$at_stderr"
159409echo stdout:; cat "$at_stdout"
159410at_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"
159416at_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>&-
159419at_status=$? at_failed=false
159420$at_check_filter
159421echo stderr:; cat "$at_stderr"
159422echo stdout:; cat "$at_stdout"
159423at_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"
159432at_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>&-
159437at_status=$? at_failed=false
159438$at_check_filter
159439at_fn_diff_devnull "$at_stderr" || at_failed=:
159440$at_diff expout "$at_stdout" || at_failed=:
159441at_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"
159450at_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>&-
159455at_status=$? at_failed=false
159456$at_check_filter
159457at_fn_diff_devnull "$at_stderr" || at_failed=:
159458$at_diff expout "$at_stdout" || at_failed=:
159459at_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
159465fi
159466{ set +x
159467$as_echo "$at_srcdir/java.at:510: bison YYParser.y"
159468at_fn_check_prepare_trace "java.at:510"
159469( $at_check_trace; bison YYParser.y
159470) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159471at_status=$? at_failed=false
159472$at_check_filter
159473at_fn_diff_devnull "$at_stderr" || at_failed=:
159474at_fn_diff_devnull "$at_stdout" || at_failed=:
159475at_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"
159482at_fn_check_prepare_trace "java.at:510"
159483( $at_check_trace; grep '[mb]4_' YYParser.y
159484) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159485at_status=$? at_failed=false
159486$at_check_filter
159487at_fn_diff_devnull "$at_stderr" || at_failed=:
159488echo stdout:; cat "$at_stdout"
159489at_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"
159502at_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>&-
159505at_status=$? at_failed=false
159506$at_check_filter
159507echo stderr:; cat "$at_stderr"
159508echo stdout:; cat "$at_stdout"
159509at_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"
159516at_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>&-
159519at_status=$? at_failed=false
159520$at_check_filter
159521at_fn_diff_devnull "$at_stderr" || at_failed=:
159522echo >>"$at_stdout"; $as_echo "1
159523" | \
159524  $at_diff - "$at_stdout" || at_failed=:
159525at_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
159532cat >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%%
159544start: "end" {};
159545%%
159546class Position {}
159547_ATEOF
159548
159549if 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"
159557at_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>&-
159561at_status=$? at_failed=false
159562$at_check_filter
159563echo stderr:; cat "$at_stderr"
159564echo stdout:; cat "$at_stdout"
159565at_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"
159571at_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>&-
159574at_status=$? at_failed=false
159575$at_check_filter
159576echo stderr:; cat "$at_stderr"
159577echo stdout:; cat "$at_stdout"
159578at_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"
159587at_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>&-
159592at_status=$? at_failed=false
159593$at_check_filter
159594at_fn_diff_devnull "$at_stderr" || at_failed=:
159595$at_diff expout "$at_stdout" || at_failed=:
159596at_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"
159605at_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>&-
159610at_status=$? at_failed=false
159611$at_check_filter
159612at_fn_diff_devnull "$at_stderr" || at_failed=:
159613$at_diff expout "$at_stdout" || at_failed=:
159614at_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
159620fi
159621{ set +x
159622$as_echo "$at_srcdir/java.at:515: bison YYParser.y"
159623at_fn_check_prepare_trace "java.at:515"
159624( $at_check_trace; bison YYParser.y
159625) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159626at_status=$? at_failed=false
159627$at_check_filter
159628at_fn_diff_devnull "$at_stderr" || at_failed=:
159629at_fn_diff_devnull "$at_stdout" || at_failed=:
159630at_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"
159637at_fn_check_prepare_trace "java.at:515"
159638( $at_check_trace; grep '[mb]4_' YYParser.y
159639) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159640at_status=$? at_failed=false
159641$at_check_filter
159642at_fn_diff_devnull "$at_stderr" || at_failed=:
159643echo stdout:; cat "$at_stdout"
159644at_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"
159657at_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>&-
159660at_status=$? at_failed=false
159661$at_check_filter
159662echo stderr:; cat "$at_stderr"
159663echo stdout:; cat "$at_stdout"
159664at_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"
159671at_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>&-
159674at_status=$? at_failed=false
159675$at_check_filter
159676at_fn_diff_devnull "$at_stderr" || at_failed=:
159677echo >>"$at_stdout"; $as_echo "1
159678" | \
159679  $at_diff - "$at_stdout" || at_failed=:
159680at_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
159687cat >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%%
159699start: "end" {};
159700%%
159701class Position {}
159702_ATEOF
159703
159704if 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"
159712at_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>&-
159716at_status=$? at_failed=false
159717$at_check_filter
159718echo stderr:; cat "$at_stderr"
159719echo stdout:; cat "$at_stdout"
159720at_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"
159726at_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>&-
159729at_status=$? at_failed=false
159730$at_check_filter
159731echo stderr:; cat "$at_stderr"
159732echo stdout:; cat "$at_stdout"
159733at_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"
159742at_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>&-
159747at_status=$? at_failed=false
159748$at_check_filter
159749at_fn_diff_devnull "$at_stderr" || at_failed=:
159750$at_diff expout "$at_stdout" || at_failed=:
159751at_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"
159760at_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>&-
159765at_status=$? at_failed=false
159766$at_check_filter
159767at_fn_diff_devnull "$at_stderr" || at_failed=:
159768$at_diff expout "$at_stdout" || at_failed=:
159769at_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
159775fi
159776{ set +x
159777$as_echo "$at_srcdir/java.at:521: bison YYParser.y"
159778at_fn_check_prepare_trace "java.at:521"
159779( $at_check_trace; bison YYParser.y
159780) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159781at_status=$? at_failed=false
159782$at_check_filter
159783at_fn_diff_devnull "$at_stderr" || at_failed=:
159784at_fn_diff_devnull "$at_stdout" || at_failed=:
159785at_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"
159792at_fn_check_prepare_trace "java.at:521"
159793( $at_check_trace; grep '[mb]4_' YYParser.y
159794) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159795at_status=$? at_failed=false
159796$at_check_filter
159797at_fn_diff_devnull "$at_stderr" || at_failed=:
159798echo stdout:; cat "$at_stdout"
159799at_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"
159812at_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>&-
159815at_status=$? at_failed=false
159816$at_check_filter
159817echo stderr:; cat "$at_stderr"
159818echo stdout:; cat "$at_stdout"
159819at_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"
159826at_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>&-
159829at_status=$? at_failed=false
159830$at_check_filter
159831at_fn_diff_devnull "$at_stderr" || at_failed=:
159832echo >>"$at_stdout"; $as_echo "1
159833" | \
159834  $at_diff - "$at_stdout" || at_failed=:
159835at_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
159844read at_status <"$at_status_file"
159845#AT_STOP_316
159846#AT_START_317
159847at_fn_group_banner 317 'java.at:534' \
159848  "Java parser class extends and implements" "       " 20
159849at_xfail=no
159850(
159851  $as_echo "317. $at_setup_line: testing $at_desc ..."
159852  $at_traceon
159853
159854
159855
159856cat >YYParser.y <<'_ATEOF'
159857
159858%language "Java"
159859%locations
159860%debug
159861%error-verbose
159862%token-table
159863%define extends "Thread"
159864%%
159865start: "end" {};
159866%%
159867class Position {}
159868_ATEOF
159869
159870if 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"
159878at_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>&-
159882at_status=$? at_failed=false
159883$at_check_filter
159884echo stderr:; cat "$at_stderr"
159885echo stdout:; cat "$at_stdout"
159886at_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"
159892at_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>&-
159895at_status=$? at_failed=false
159896$at_check_filter
159897echo stderr:; cat "$at_stderr"
159898echo stdout:; cat "$at_stdout"
159899at_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"
159908at_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>&-
159913at_status=$? at_failed=false
159914$at_check_filter
159915at_fn_diff_devnull "$at_stderr" || at_failed=:
159916$at_diff expout "$at_stdout" || at_failed=:
159917at_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"
159926at_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>&-
159931at_status=$? at_failed=false
159932$at_check_filter
159933at_fn_diff_devnull "$at_stderr" || at_failed=:
159934$at_diff expout "$at_stdout" || at_failed=:
159935at_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
159941fi
159942{ set +x
159943$as_echo "$at_srcdir/java.at:536: bison YYParser.y"
159944at_fn_check_prepare_trace "java.at:536"
159945( $at_check_trace; bison YYParser.y
159946) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159947at_status=$? at_failed=false
159948$at_check_filter
159949at_fn_diff_devnull "$at_stderr" || at_failed=:
159950at_fn_diff_devnull "$at_stdout" || at_failed=:
159951at_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"
159958at_fn_check_prepare_trace "java.at:536"
159959( $at_check_trace; grep '[mb]4_' YYParser.y
159960) >>"$at_stdout" 2>>"$at_stderr" 5>&-
159961at_status=$? at_failed=false
159962$at_check_filter
159963at_fn_diff_devnull "$at_stderr" || at_failed=:
159964echo stdout:; cat "$at_stdout"
159965at_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"
159978at_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>&-
159981at_status=$? at_failed=false
159982$at_check_filter
159983echo stderr:; cat "$at_stderr"
159984echo stdout:; cat "$at_stdout"
159985at_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"
159992at_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>&-
159995at_status=$? at_failed=false
159996$at_check_filter
159997at_fn_diff_devnull "$at_stderr" || at_failed=:
159998echo >>"$at_stdout"; $as_echo "1
159999" | \
160000  $at_diff - "$at_stdout" || at_failed=:
160001at_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
160008cat >YYParser.y <<'_ATEOF'
160009
160010%language "Java"
160011%locations
160012%debug
160013%error-verbose
160014%token-table
160015%define implements "Cloneable"
160016%%
160017start: "end" {};
160018%%
160019class Position {}
160020_ATEOF
160021
160022if 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"
160030at_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>&-
160034at_status=$? at_failed=false
160035$at_check_filter
160036echo stderr:; cat "$at_stderr"
160037echo stdout:; cat "$at_stdout"
160038at_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"
160044at_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>&-
160047at_status=$? at_failed=false
160048$at_check_filter
160049echo stderr:; cat "$at_stderr"
160050echo stdout:; cat "$at_stdout"
160051at_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"
160060at_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>&-
160065at_status=$? at_failed=false
160066$at_check_filter
160067at_fn_diff_devnull "$at_stderr" || at_failed=:
160068$at_diff expout "$at_stdout" || at_failed=:
160069at_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"
160078at_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>&-
160083at_status=$? at_failed=false
160084$at_check_filter
160085at_fn_diff_devnull "$at_stderr" || at_failed=:
160086$at_diff expout "$at_stdout" || at_failed=:
160087at_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
160093fi
160094{ set +x
160095$as_echo "$at_srcdir/java.at:539: bison YYParser.y"
160096at_fn_check_prepare_trace "java.at:539"
160097( $at_check_trace; bison YYParser.y
160098) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160099at_status=$? at_failed=false
160100$at_check_filter
160101at_fn_diff_devnull "$at_stderr" || at_failed=:
160102at_fn_diff_devnull "$at_stdout" || at_failed=:
160103at_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"
160110at_fn_check_prepare_trace "java.at:539"
160111( $at_check_trace; grep '[mb]4_' YYParser.y
160112) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160113at_status=$? at_failed=false
160114$at_check_filter
160115at_fn_diff_devnull "$at_stderr" || at_failed=:
160116echo stdout:; cat "$at_stdout"
160117at_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"
160130at_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>&-
160133at_status=$? at_failed=false
160134$at_check_filter
160135echo stderr:; cat "$at_stderr"
160136echo stdout:; cat "$at_stdout"
160137at_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"
160144at_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>&-
160147at_status=$? at_failed=false
160148$at_check_filter
160149at_fn_diff_devnull "$at_stderr" || at_failed=:
160150echo >>"$at_stdout"; $as_echo "1
160151" | \
160152  $at_diff - "$at_stdout" || at_failed=:
160153at_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
160160cat >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%%
160171start: "end" {};
160172%%
160173class Position {}
160174_ATEOF
160175
160176if 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"
160184at_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>&-
160188at_status=$? at_failed=false
160189$at_check_filter
160190echo stderr:; cat "$at_stderr"
160191echo stdout:; cat "$at_stdout"
160192at_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"
160198at_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>&-
160201at_status=$? at_failed=false
160202$at_check_filter
160203echo stderr:; cat "$at_stderr"
160204echo stdout:; cat "$at_stdout"
160205at_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"
160214at_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>&-
160219at_status=$? at_failed=false
160220$at_check_filter
160221at_fn_diff_devnull "$at_stderr" || at_failed=:
160222$at_diff expout "$at_stdout" || at_failed=:
160223at_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"
160232at_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>&-
160237at_status=$? at_failed=false
160238$at_check_filter
160239at_fn_diff_devnull "$at_stderr" || at_failed=:
160240$at_diff expout "$at_stdout" || at_failed=:
160241at_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
160247fi
160248{ set +x
160249$as_echo "$at_srcdir/java.at:542: bison YYParser.y"
160250at_fn_check_prepare_trace "java.at:542"
160251( $at_check_trace; bison YYParser.y
160252) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160253at_status=$? at_failed=false
160254$at_check_filter
160255at_fn_diff_devnull "$at_stderr" || at_failed=:
160256at_fn_diff_devnull "$at_stdout" || at_failed=:
160257at_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"
160264at_fn_check_prepare_trace "java.at:542"
160265( $at_check_trace; grep '[mb]4_' YYParser.y
160266) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160267at_status=$? at_failed=false
160268$at_check_filter
160269at_fn_diff_devnull "$at_stderr" || at_failed=:
160270echo stdout:; cat "$at_stdout"
160271at_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"
160284at_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>&-
160287at_status=$? at_failed=false
160288$at_check_filter
160289echo stderr:; cat "$at_stderr"
160290echo stdout:; cat "$at_stdout"
160291at_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"
160298at_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>&-
160301at_status=$? at_failed=false
160302$at_check_filter
160303at_fn_diff_devnull "$at_stderr" || at_failed=:
160304echo >>"$at_stdout"; $as_echo "1
160305" | \
160306  $at_diff - "$at_stdout" || at_failed=:
160307at_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
160316read at_status <"$at_status_file"
160317#AT_STOP_317
160318#AT_START_318
160319at_fn_group_banner 318 'java.at:554' \
160320  "Java %parse-param and %lex-param" "               " 20
160321at_xfail=no
160322(
160323  $as_echo "318. $at_setup_line: testing $at_desc ..."
160324  $at_traceon
160325
160326
160327
160328cat >YYParser.y <<'_ATEOF'
160329
160330%language "Java"
160331%locations
160332%debug
160333%error-verbose
160334%token-table
160335
160336%%
160337start: "end" {};
160338%%
160339class Position {}
160340_ATEOF
160341
160342if 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"
160350at_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>&-
160354at_status=$? at_failed=false
160355$at_check_filter
160356echo stderr:; cat "$at_stderr"
160357echo stdout:; cat "$at_stdout"
160358at_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"
160364at_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>&-
160367at_status=$? at_failed=false
160368$at_check_filter
160369echo stderr:; cat "$at_stderr"
160370echo stdout:; cat "$at_stdout"
160371at_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"
160380at_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>&-
160385at_status=$? at_failed=false
160386$at_check_filter
160387at_fn_diff_devnull "$at_stderr" || at_failed=:
160388$at_diff expout "$at_stdout" || at_failed=:
160389at_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"
160398at_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>&-
160403at_status=$? at_failed=false
160404$at_check_filter
160405at_fn_diff_devnull "$at_stderr" || at_failed=:
160406$at_diff expout "$at_stdout" || at_failed=:
160407at_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
160413fi
160414{ set +x
160415$as_echo "$at_srcdir/java.at:556: bison YYParser.y"
160416at_fn_check_prepare_trace "java.at:556"
160417( $at_check_trace; bison YYParser.y
160418) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160419at_status=$? at_failed=false
160420$at_check_filter
160421at_fn_diff_devnull "$at_stderr" || at_failed=:
160422at_fn_diff_devnull "$at_stdout" || at_failed=:
160423at_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"
160430at_fn_check_prepare_trace "java.at:556"
160431( $at_check_trace; grep '[mb]4_' YYParser.y
160432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160433at_status=$? at_failed=false
160434$at_check_filter
160435at_fn_diff_devnull "$at_stderr" || at_failed=:
160436echo stdout:; cat "$at_stdout"
160437at_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"
160450at_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>&-
160453at_status=$? at_failed=false
160454$at_check_filter
160455echo stderr:; cat "$at_stderr"
160456echo stdout:; cat "$at_stdout"
160457at_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"
160464at_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>&-
160467at_status=$? at_failed=false
160468$at_check_filter
160469at_fn_diff_devnull "$at_stderr" || at_failed=:
160470echo >>"$at_stdout"; $as_echo "1
160471" | \
160472  $at_diff - "$at_stdout" || at_failed=:
160473at_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
160480cat >YYParser.y <<'_ATEOF'
160481
160482%language "Java"
160483%locations
160484%debug
160485%error-verbose
160486%token-table
160487%parse-param {int parse_param1}
160488%%
160489start: "end" {};
160490%%
160491class Position {}
160492_ATEOF
160493
160494if 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"
160502at_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>&-
160506at_status=$? at_failed=false
160507$at_check_filter
160508echo stderr:; cat "$at_stderr"
160509echo stdout:; cat "$at_stdout"
160510at_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"
160516at_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>&-
160519at_status=$? at_failed=false
160520$at_check_filter
160521echo stderr:; cat "$at_stderr"
160522echo stdout:; cat "$at_stdout"
160523at_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"
160532at_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>&-
160537at_status=$? at_failed=false
160538$at_check_filter
160539at_fn_diff_devnull "$at_stderr" || at_failed=:
160540$at_diff expout "$at_stdout" || at_failed=:
160541at_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"
160550at_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>&-
160555at_status=$? at_failed=false
160556$at_check_filter
160557at_fn_diff_devnull "$at_stderr" || at_failed=:
160558$at_diff expout "$at_stdout" || at_failed=:
160559at_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
160565fi
160566{ set +x
160567$as_echo "$at_srcdir/java.at:559: bison YYParser.y"
160568at_fn_check_prepare_trace "java.at:559"
160569( $at_check_trace; bison YYParser.y
160570) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160571at_status=$? at_failed=false
160572$at_check_filter
160573at_fn_diff_devnull "$at_stderr" || at_failed=:
160574at_fn_diff_devnull "$at_stdout" || at_failed=:
160575at_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"
160582at_fn_check_prepare_trace "java.at:559"
160583( $at_check_trace; grep '[mb]4_' YYParser.y
160584) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160585at_status=$? at_failed=false
160586$at_check_filter
160587at_fn_diff_devnull "$at_stderr" || at_failed=:
160588echo stdout:; cat "$at_stdout"
160589at_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"
160602at_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>&-
160605at_status=$? at_failed=false
160606$at_check_filter
160607echo stderr:; cat "$at_stderr"
160608echo stdout:; cat "$at_stdout"
160609at_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"
160616at_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>&-
160619at_status=$? at_failed=false
160620$at_check_filter
160621at_fn_diff_devnull "$at_stderr" || at_failed=:
160622echo >>"$at_stdout"; $as_echo "1
160623" | \
160624  $at_diff - "$at_stdout" || at_failed=:
160625at_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"
160632at_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>&-
160635at_status=$? at_failed=false
160636$at_check_filter
160637at_fn_diff_devnull "$at_stderr" || at_failed=:
160638echo >>"$at_stdout"; $as_echo "1
160639" | \
160640  $at_diff - "$at_stdout" || at_failed=:
160641at_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"
160648at_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>&-
160651at_status=$? at_failed=false
160652$at_check_filter
160653at_fn_diff_devnull "$at_stderr" || at_failed=:
160654echo >>"$at_stdout"; $as_echo "1
160655" | \
160656  $at_diff - "$at_stdout" || at_failed=:
160657at_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
160664cat >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%%
160675start: "end" {};
160676%%
160677class Position {}
160678_ATEOF
160679
160680if 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"
160688at_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>&-
160692at_status=$? at_failed=false
160693$at_check_filter
160694echo stderr:; cat "$at_stderr"
160695echo stdout:; cat "$at_stdout"
160696at_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"
160702at_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>&-
160705at_status=$? at_failed=false
160706$at_check_filter
160707echo stderr:; cat "$at_stderr"
160708echo stdout:; cat "$at_stdout"
160709at_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"
160718at_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>&-
160723at_status=$? at_failed=false
160724$at_check_filter
160725at_fn_diff_devnull "$at_stderr" || at_failed=:
160726$at_diff expout "$at_stdout" || at_failed=:
160727at_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"
160736at_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>&-
160741at_status=$? at_failed=false
160742$at_check_filter
160743at_fn_diff_devnull "$at_stderr" || at_failed=:
160744$at_diff expout "$at_stdout" || at_failed=:
160745at_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
160751fi
160752{ set +x
160753$as_echo "$at_srcdir/java.at:564: bison YYParser.y"
160754at_fn_check_prepare_trace "java.at:564"
160755( $at_check_trace; bison YYParser.y
160756) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160757at_status=$? at_failed=false
160758$at_check_filter
160759at_fn_diff_devnull "$at_stderr" || at_failed=:
160760at_fn_diff_devnull "$at_stdout" || at_failed=:
160761at_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"
160768at_fn_check_prepare_trace "java.at:564"
160769( $at_check_trace; grep '[mb]4_' YYParser.y
160770) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160771at_status=$? at_failed=false
160772$at_check_filter
160773at_fn_diff_devnull "$at_stderr" || at_failed=:
160774echo stdout:; cat "$at_stdout"
160775at_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"
160788at_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>&-
160791at_status=$? at_failed=false
160792$at_check_filter
160793echo stderr:; cat "$at_stderr"
160794echo stdout:; cat "$at_stdout"
160795at_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"
160802at_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>&-
160805at_status=$? at_failed=false
160806$at_check_filter
160807at_fn_diff_devnull "$at_stderr" || at_failed=:
160808echo >>"$at_stdout"; $as_echo "1
160809" | \
160810  $at_diff - "$at_stdout" || at_failed=:
160811at_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"
160818at_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>&-
160821at_status=$? at_failed=false
160822$at_check_filter
160823at_fn_diff_devnull "$at_stderr" || at_failed=:
160824echo >>"$at_stdout"; $as_echo "1
160825" | \
160826  $at_diff - "$at_stdout" || at_failed=:
160827at_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"
160834at_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>&-
160837at_status=$? at_failed=false
160838$at_check_filter
160839at_fn_diff_devnull "$at_stderr" || at_failed=:
160840echo >>"$at_stdout"; $as_echo "1
160841" | \
160842  $at_diff - "$at_stdout" || at_failed=:
160843at_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"
160850at_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>&-
160853at_status=$? at_failed=false
160854$at_check_filter
160855at_fn_diff_devnull "$at_stderr" || at_failed=:
160856echo >>"$at_stdout"; $as_echo "1
160857" | \
160858  $at_diff - "$at_stdout" || at_failed=:
160859at_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"
160866at_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>&-
160869at_status=$? at_failed=false
160870$at_check_filter
160871at_fn_diff_devnull "$at_stderr" || at_failed=:
160872echo >>"$at_stdout"; $as_echo "1
160873" | \
160874  $at_diff - "$at_stdout" || at_failed=:
160875at_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
160882cat >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%%
160912start: "end" {};
160913%%
160914class Position {}
160915_ATEOF
160916
160917if 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"
160925at_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>&-
160929at_status=$? at_failed=false
160930$at_check_filter
160931echo stderr:; cat "$at_stderr"
160932echo stdout:; cat "$at_stdout"
160933at_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"
160939at_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>&-
160942at_status=$? at_failed=false
160943$at_check_filter
160944echo stderr:; cat "$at_stderr"
160945echo stdout:; cat "$at_stdout"
160946at_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"
160955at_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>&-
160960at_status=$? at_failed=false
160961$at_check_filter
160962at_fn_diff_devnull "$at_stderr" || at_failed=:
160963$at_diff expout "$at_stdout" || at_failed=:
160964at_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"
160973at_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>&-
160978at_status=$? at_failed=false
160979$at_check_filter
160980at_fn_diff_devnull "$at_stderr" || at_failed=:
160981$at_diff expout "$at_stdout" || at_failed=:
160982at_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
160988fi
160989{ set +x
160990$as_echo "$at_srcdir/java.at:573: bison YYParser.y"
160991at_fn_check_prepare_trace "java.at:573"
160992( $at_check_trace; bison YYParser.y
160993) >>"$at_stdout" 2>>"$at_stderr" 5>&-
160994at_status=$? at_failed=false
160995$at_check_filter
160996at_fn_diff_devnull "$at_stderr" || at_failed=:
160997at_fn_diff_devnull "$at_stdout" || at_failed=:
160998at_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"
161005at_fn_check_prepare_trace "java.at:573"
161006( $at_check_trace; grep '[mb]4_' YYParser.y
161007) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161008at_status=$? at_failed=false
161009$at_check_filter
161010at_fn_diff_devnull "$at_stderr" || at_failed=:
161011echo stdout:; cat "$at_stdout"
161012at_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"
161025at_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>&-
161028at_status=$? at_failed=false
161029$at_check_filter
161030echo stderr:; cat "$at_stderr"
161031echo stdout:; cat "$at_stdout"
161032at_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"
161039at_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>&-
161042at_status=$? at_failed=false
161043$at_check_filter
161044at_fn_diff_devnull "$at_stderr" || at_failed=:
161045echo >>"$at_stdout"; $as_echo "1
161046" | \
161047  $at_diff - "$at_stdout" || at_failed=:
161048at_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"
161055at_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>&-
161058at_status=$? at_failed=false
161059$at_check_filter
161060at_fn_diff_devnull "$at_stderr" || at_failed=:
161061echo >>"$at_stdout"; $as_echo "1
161062" | \
161063  $at_diff - "$at_stdout" || at_failed=:
161064at_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
161071cat >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%%
161101start: "end" {};
161102%%
161103class Position {}
161104_ATEOF
161105
161106if 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"
161114at_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>&-
161118at_status=$? at_failed=false
161119$at_check_filter
161120echo stderr:; cat "$at_stderr"
161121echo stdout:; cat "$at_stdout"
161122at_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"
161128at_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>&-
161131at_status=$? at_failed=false
161132$at_check_filter
161133echo stderr:; cat "$at_stderr"
161134echo stdout:; cat "$at_stdout"
161135at_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"
161144at_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>&-
161149at_status=$? at_failed=false
161150$at_check_filter
161151at_fn_diff_devnull "$at_stderr" || at_failed=:
161152$at_diff expout "$at_stdout" || at_failed=:
161153at_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"
161162at_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>&-
161167at_status=$? at_failed=false
161168$at_check_filter
161169at_fn_diff_devnull "$at_stderr" || at_failed=:
161170$at_diff expout "$at_stdout" || at_failed=:
161171at_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
161177fi
161178{ set +x
161179$as_echo "$at_srcdir/java.at:577: bison YYParser.y"
161180at_fn_check_prepare_trace "java.at:577"
161181( $at_check_trace; bison YYParser.y
161182) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161183at_status=$? at_failed=false
161184$at_check_filter
161185at_fn_diff_devnull "$at_stderr" || at_failed=:
161186at_fn_diff_devnull "$at_stdout" || at_failed=:
161187at_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"
161194at_fn_check_prepare_trace "java.at:577"
161195( $at_check_trace; grep '[mb]4_' YYParser.y
161196) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161197at_status=$? at_failed=false
161198$at_check_filter
161199at_fn_diff_devnull "$at_stderr" || at_failed=:
161200echo stdout:; cat "$at_stdout"
161201at_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"
161214at_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>&-
161217at_status=$? at_failed=false
161218$at_check_filter
161219echo stderr:; cat "$at_stderr"
161220echo stdout:; cat "$at_stdout"
161221at_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"
161228at_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>&-
161231at_status=$? at_failed=false
161232$at_check_filter
161233at_fn_diff_devnull "$at_stderr" || at_failed=:
161234echo >>"$at_stdout"; $as_echo "1
161235" | \
161236  $at_diff - "$at_stdout" || at_failed=:
161237at_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"
161244at_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>&-
161247at_status=$? at_failed=false
161248$at_check_filter
161249at_fn_diff_devnull "$at_stderr" || at_failed=:
161250echo >>"$at_stdout"; $as_echo "1
161251" | \
161252  $at_diff - "$at_stdout" || at_failed=:
161253at_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"
161260at_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>&-
161263at_status=$? at_failed=false
161264$at_check_filter
161265at_fn_diff_devnull "$at_stderr" || at_failed=:
161266echo >>"$at_stdout"; $as_echo "1
161267" | \
161268  $at_diff - "$at_stdout" || at_failed=:
161269at_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"
161276at_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>&-
161279at_status=$? at_failed=false
161280$at_check_filter
161281at_fn_diff_devnull "$at_stderr" || at_failed=:
161282echo >>"$at_stdout"; $as_echo "2
161283" | \
161284  $at_diff - "$at_stdout" || at_failed=:
161285at_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
161292cat >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%%
161324start: "end" {};
161325%%
161326class Position {}
161327_ATEOF
161328
161329if 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"
161337at_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>&-
161341at_status=$? at_failed=false
161342$at_check_filter
161343echo stderr:; cat "$at_stderr"
161344echo stdout:; cat "$at_stdout"
161345at_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"
161351at_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>&-
161354at_status=$? at_failed=false
161355$at_check_filter
161356echo stderr:; cat "$at_stderr"
161357echo stdout:; cat "$at_stdout"
161358at_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"
161367at_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>&-
161372at_status=$? at_failed=false
161373$at_check_filter
161374at_fn_diff_devnull "$at_stderr" || at_failed=:
161375$at_diff expout "$at_stdout" || at_failed=:
161376at_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"
161385at_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>&-
161390at_status=$? at_failed=false
161391$at_check_filter
161392at_fn_diff_devnull "$at_stderr" || at_failed=:
161393$at_diff expout "$at_stdout" || at_failed=:
161394at_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
161400fi
161401{ set +x
161402$as_echo "$at_srcdir/java.at:584: bison YYParser.y"
161403at_fn_check_prepare_trace "java.at:584"
161404( $at_check_trace; bison YYParser.y
161405) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161406at_status=$? at_failed=false
161407$at_check_filter
161408at_fn_diff_devnull "$at_stderr" || at_failed=:
161409at_fn_diff_devnull "$at_stdout" || at_failed=:
161410at_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"
161417at_fn_check_prepare_trace "java.at:584"
161418( $at_check_trace; grep '[mb]4_' YYParser.y
161419) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161420at_status=$? at_failed=false
161421$at_check_filter
161422at_fn_diff_devnull "$at_stderr" || at_failed=:
161423echo stdout:; cat "$at_stdout"
161424at_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"
161437at_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>&-
161440at_status=$? at_failed=false
161441$at_check_filter
161442echo stderr:; cat "$at_stderr"
161443echo stdout:; cat "$at_stdout"
161444at_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"
161451at_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>&-
161454at_status=$? at_failed=false
161455$at_check_filter
161456at_fn_diff_devnull "$at_stderr" || at_failed=:
161457echo >>"$at_stdout"; $as_echo "1
161458" | \
161459  $at_diff - "$at_stdout" || at_failed=:
161460at_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"
161467at_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>&-
161470at_status=$? at_failed=false
161471$at_check_filter
161472at_fn_diff_devnull "$at_stderr" || at_failed=:
161473echo >>"$at_stdout"; $as_echo "1
161474" | \
161475  $at_diff - "$at_stdout" || at_failed=:
161476at_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"
161483at_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>&-
161486at_status=$? at_failed=false
161487$at_check_filter
161488at_fn_diff_devnull "$at_stderr" || at_failed=:
161489echo >>"$at_stdout"; $as_echo "1
161490" | \
161491  $at_diff - "$at_stdout" || at_failed=:
161492at_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"
161499at_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>&-
161502at_status=$? at_failed=false
161503$at_check_filter
161504at_fn_diff_devnull "$at_stderr" || at_failed=:
161505echo >>"$at_stdout"; $as_echo "1
161506" | \
161507  $at_diff - "$at_stdout" || at_failed=:
161508at_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"
161515at_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>&-
161518at_status=$? at_failed=false
161519$at_check_filter
161520at_fn_diff_devnull "$at_stderr" || at_failed=:
161521echo >>"$at_stdout"; $as_echo "2
161522" | \
161523  $at_diff - "$at_stdout" || at_failed=:
161524at_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"
161531at_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>&-
161534at_status=$? at_failed=false
161535$at_check_filter
161536at_fn_diff_devnull "$at_stderr" || at_failed=:
161537echo >>"$at_stdout"; $as_echo "2
161538" | \
161539  $at_diff - "$at_stdout" || at_failed=:
161540at_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
161547cat >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%%
161577start: "end" {};
161578%%
161579class Position {}
161580_ATEOF
161581
161582if 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"
161590at_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>&-
161594at_status=$? at_failed=false
161595$at_check_filter
161596echo stderr:; cat "$at_stderr"
161597echo stdout:; cat "$at_stdout"
161598at_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"
161604at_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>&-
161607at_status=$? at_failed=false
161608$at_check_filter
161609echo stderr:; cat "$at_stderr"
161610echo stdout:; cat "$at_stdout"
161611at_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"
161620at_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>&-
161625at_status=$? at_failed=false
161626$at_check_filter
161627at_fn_diff_devnull "$at_stderr" || at_failed=:
161628$at_diff expout "$at_stdout" || at_failed=:
161629at_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"
161638at_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>&-
161643at_status=$? at_failed=false
161644$at_check_filter
161645at_fn_diff_devnull "$at_stderr" || at_failed=:
161646$at_diff expout "$at_stdout" || at_failed=:
161647at_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
161653fi
161654{ set +x
161655$as_echo "$at_srcdir/java.at:595: bison YYParser.y"
161656at_fn_check_prepare_trace "java.at:595"
161657( $at_check_trace; bison YYParser.y
161658) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161659at_status=$? at_failed=false
161660$at_check_filter
161661at_fn_diff_devnull "$at_stderr" || at_failed=:
161662at_fn_diff_devnull "$at_stdout" || at_failed=:
161663at_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"
161670at_fn_check_prepare_trace "java.at:595"
161671( $at_check_trace; grep '[mb]4_' YYParser.y
161672) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161673at_status=$? at_failed=false
161674$at_check_filter
161675at_fn_diff_devnull "$at_stderr" || at_failed=:
161676echo stdout:; cat "$at_stdout"
161677at_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"
161690at_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>&-
161693at_status=$? at_failed=false
161694$at_check_filter
161695echo stderr:; cat "$at_stderr"
161696echo stdout:; cat "$at_stdout"
161697at_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"
161704at_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>&-
161707at_status=$? at_failed=false
161708$at_check_filter
161709at_fn_diff_devnull "$at_stderr" || at_failed=:
161710echo >>"$at_stdout"; $as_echo "1
161711" | \
161712  $at_diff - "$at_stdout" || at_failed=:
161713at_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"
161720at_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>&-
161723at_status=$? at_failed=false
161724$at_check_filter
161725at_fn_diff_devnull "$at_stderr" || at_failed=:
161726echo >>"$at_stdout"; $as_echo "1
161727" | \
161728  $at_diff - "$at_stdout" || at_failed=:
161729at_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
161736cat >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%%
161768start: "end" {};
161769%%
161770class Position {}
161771_ATEOF
161772
161773if 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"
161781at_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>&-
161785at_status=$? at_failed=false
161786$at_check_filter
161787echo stderr:; cat "$at_stderr"
161788echo stdout:; cat "$at_stdout"
161789at_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"
161795at_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>&-
161798at_status=$? at_failed=false
161799$at_check_filter
161800echo stderr:; cat "$at_stderr"
161801echo stdout:; cat "$at_stdout"
161802at_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"
161811at_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>&-
161816at_status=$? at_failed=false
161817$at_check_filter
161818at_fn_diff_devnull "$at_stderr" || at_failed=:
161819$at_diff expout "$at_stdout" || at_failed=:
161820at_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"
161829at_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>&-
161834at_status=$? at_failed=false
161835$at_check_filter
161836at_fn_diff_devnull "$at_stderr" || at_failed=:
161837$at_diff expout "$at_stdout" || at_failed=:
161838at_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
161844fi
161845{ set +x
161846$as_echo "$at_srcdir/java.at:600: bison YYParser.y"
161847at_fn_check_prepare_trace "java.at:600"
161848( $at_check_trace; bison YYParser.y
161849) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161850at_status=$? at_failed=false
161851$at_check_filter
161852at_fn_diff_devnull "$at_stderr" || at_failed=:
161853at_fn_diff_devnull "$at_stdout" || at_failed=:
161854at_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"
161861at_fn_check_prepare_trace "java.at:600"
161862( $at_check_trace; grep '[mb]4_' YYParser.y
161863) >>"$at_stdout" 2>>"$at_stderr" 5>&-
161864at_status=$? at_failed=false
161865$at_check_filter
161866at_fn_diff_devnull "$at_stderr" || at_failed=:
161867echo stdout:; cat "$at_stdout"
161868at_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"
161881at_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>&-
161884at_status=$? at_failed=false
161885$at_check_filter
161886echo stderr:; cat "$at_stderr"
161887echo stdout:; cat "$at_stdout"
161888at_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"
161895at_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>&-
161898at_status=$? at_failed=false
161899$at_check_filter
161900at_fn_diff_devnull "$at_stderr" || at_failed=:
161901echo >>"$at_stdout"; $as_echo "1
161902" | \
161903  $at_diff - "$at_stdout" || at_failed=:
161904at_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"
161911at_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>&-
161914at_status=$? at_failed=false
161915$at_check_filter
161916at_fn_diff_devnull "$at_stderr" || at_failed=:
161917echo >>"$at_stdout"; $as_echo "1
161918" | \
161919  $at_diff - "$at_stdout" || at_failed=:
161920at_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
161927cat >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%%
161961start: "end" {};
161962%%
161963class Position {}
161964_ATEOF
161965
161966if 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"
161974at_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>&-
161978at_status=$? at_failed=false
161979$at_check_filter
161980echo stderr:; cat "$at_stderr"
161981echo stdout:; cat "$at_stdout"
161982at_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"
161988at_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>&-
161991at_status=$? at_failed=false
161992$at_check_filter
161993echo stderr:; cat "$at_stderr"
161994echo stdout:; cat "$at_stdout"
161995at_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"
162004at_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>&-
162009at_status=$? at_failed=false
162010$at_check_filter
162011at_fn_diff_devnull "$at_stderr" || at_failed=:
162012$at_diff expout "$at_stdout" || at_failed=:
162013at_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"
162022at_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>&-
162027at_status=$? at_failed=false
162028$at_check_filter
162029at_fn_diff_devnull "$at_stderr" || at_failed=:
162030$at_diff expout "$at_stdout" || at_failed=:
162031at_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
162037fi
162038{ set +x
162039$as_echo "$at_srcdir/java.at:607: bison YYParser.y"
162040at_fn_check_prepare_trace "java.at:607"
162041( $at_check_trace; bison YYParser.y
162042) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162043at_status=$? at_failed=false
162044$at_check_filter
162045at_fn_diff_devnull "$at_stderr" || at_failed=:
162046at_fn_diff_devnull "$at_stdout" || at_failed=:
162047at_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"
162054at_fn_check_prepare_trace "java.at:607"
162055( $at_check_trace; grep '[mb]4_' YYParser.y
162056) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162057at_status=$? at_failed=false
162058$at_check_filter
162059at_fn_diff_devnull "$at_stderr" || at_failed=:
162060echo stdout:; cat "$at_stdout"
162061at_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"
162074at_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>&-
162077at_status=$? at_failed=false
162078$at_check_filter
162079echo stderr:; cat "$at_stderr"
162080echo stdout:; cat "$at_stdout"
162081at_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"
162088at_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>&-
162091at_status=$? at_failed=false
162092$at_check_filter
162093at_fn_diff_devnull "$at_stderr" || at_failed=:
162094echo >>"$at_stdout"; $as_echo "1
162095" | \
162096  $at_diff - "$at_stdout" || at_failed=:
162097at_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"
162104at_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>&-
162107at_status=$? at_failed=false
162108$at_check_filter
162109at_fn_diff_devnull "$at_stderr" || at_failed=:
162110echo >>"$at_stdout"; $as_echo "1
162111" | \
162112  $at_diff - "$at_stdout" || at_failed=:
162113at_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"
162120at_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>&-
162123at_status=$? at_failed=false
162124$at_check_filter
162125at_fn_diff_devnull "$at_stderr" || at_failed=:
162126echo >>"$at_stdout"; $as_echo "1
162127" | \
162128  $at_diff - "$at_stdout" || at_failed=:
162129at_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"
162136at_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>&-
162139at_status=$? at_failed=false
162140$at_check_filter
162141at_fn_diff_devnull "$at_stderr" || at_failed=:
162142echo >>"$at_stdout"; $as_echo "1
162143" | \
162144  $at_diff - "$at_stdout" || at_failed=:
162145at_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"
162152at_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>&-
162155at_status=$? at_failed=false
162156$at_check_filter
162157at_fn_diff_devnull "$at_stderr" || at_failed=:
162158echo >>"$at_stdout"; $as_echo "1
162159" | \
162160  $at_diff - "$at_stdout" || at_failed=:
162161at_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"
162168at_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>&-
162171at_status=$? at_failed=false
162172$at_check_filter
162173at_fn_diff_devnull "$at_stderr" || at_failed=:
162174echo >>"$at_stdout"; $as_echo "2
162175" | \
162176  $at_diff - "$at_stdout" || at_failed=:
162177at_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"
162184at_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>&-
162187at_status=$? at_failed=false
162188$at_check_filter
162189at_fn_diff_devnull "$at_stderr" || at_failed=:
162190echo >>"$at_stdout"; $as_echo "2
162191" | \
162192  $at_diff - "$at_stdout" || at_failed=:
162193at_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
162202read at_status <"$at_status_file"
162203#AT_STOP_318
162204#AT_START_319
162205at_fn_group_banner 319 'java.at:628' \
162206  "Java throws specifications" "                     " 20
162207at_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
162237cat >YYParser.y <<'_ATEOF'
162238
162239%language "Java"
162240%locations
162241%debug
162242%error-verbose
162243%token-table
162244
162245
162246
162247
162248%%
162249start: "end" {};
162250%%
162251class Position {}
162252_ATEOF
162253
162254if 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"
162262at_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>&-
162266at_status=$? at_failed=false
162267$at_check_filter
162268echo stderr:; cat "$at_stderr"
162269echo stdout:; cat "$at_stdout"
162270at_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"
162276at_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>&-
162279at_status=$? at_failed=false
162280$at_check_filter
162281echo stderr:; cat "$at_stderr"
162282echo stdout:; cat "$at_stdout"
162283at_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"
162292at_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>&-
162297at_status=$? at_failed=false
162298$at_check_filter
162299at_fn_diff_devnull "$at_stderr" || at_failed=:
162300$at_diff expout "$at_stdout" || at_failed=:
162301at_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"
162310at_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>&-
162315at_status=$? at_failed=false
162316$at_check_filter
162317at_fn_diff_devnull "$at_stderr" || at_failed=:
162318$at_diff expout "$at_stdout" || at_failed=:
162319at_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
162325fi
162326{ set +x
162327$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
162328at_fn_check_prepare_trace "java.at:688"
162329( $at_check_trace; bison YYParser.y
162330) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162331at_status=$? at_failed=false
162332$at_check_filter
162333at_fn_diff_devnull "$at_stderr" || at_failed=:
162334at_fn_diff_devnull "$at_stdout" || at_failed=:
162335at_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"
162342at_fn_check_prepare_trace "java.at:688"
162343( $at_check_trace; grep '[mb]4_' YYParser.y
162344) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162345at_status=$? at_failed=false
162346$at_check_filter
162347at_fn_diff_devnull "$at_stderr" || at_failed=:
162348echo stdout:; cat "$at_stdout"
162349at_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"
162362at_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>&-
162365at_status=$? at_failed=false
162366$at_check_filter
162367echo stderr:; cat "$at_stderr"
162368echo stdout:; cat "$at_stdout"
162369at_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"
162376at_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>&-
162379at_status=$? at_failed=false
162380$at_check_filter
162381at_fn_diff_devnull "$at_stderr" || at_failed=:
162382echo >>"$at_stdout"; $as_echo "1
162383" | \
162384  $at_diff - "$at_stdout" || at_failed=:
162385at_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"
162392at_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>&-
162395at_status=$? at_failed=false
162396$at_check_filter
162397at_fn_diff_devnull "$at_stderr" || at_failed=:
162398echo >>"$at_stdout"; $as_echo "1
162399" | \
162400  $at_diff - "$at_stdout" || at_failed=:
162401at_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"
162408at_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>&-
162411at_status=$? at_failed=false
162412$at_check_filter
162413at_fn_diff_devnull "$at_stderr" || at_failed=:
162414echo >>"$at_stdout"; $as_echo "1
162415" | \
162416  $at_diff - "$at_stdout" || at_failed=:
162417at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
162418$at_failed && at_fn_log_failure
162419$at_traceon; }
162420
162421
162422
162423cat >YYParser.y <<'_ATEOF'
162424
162425%language "Java"
162426%locations
162427%debug
162428%error-verbose
162429%token-table
162430
162431%define throws ""
162432
162433
162434%%
162435start: "end" {};
162436%%
162437class Position {}
162438_ATEOF
162439
162440if 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"
162448at_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>&-
162452at_status=$? at_failed=false
162453$at_check_filter
162454echo stderr:; cat "$at_stderr"
162455echo stdout:; cat "$at_stdout"
162456at_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"
162462at_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>&-
162465at_status=$? at_failed=false
162466$at_check_filter
162467echo stderr:; cat "$at_stderr"
162468echo stdout:; cat "$at_stdout"
162469at_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"
162478at_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>&-
162483at_status=$? at_failed=false
162484$at_check_filter
162485at_fn_diff_devnull "$at_stderr" || at_failed=:
162486$at_diff expout "$at_stdout" || at_failed=:
162487at_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"
162496at_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>&-
162501at_status=$? at_failed=false
162502$at_check_filter
162503at_fn_diff_devnull "$at_stderr" || at_failed=:
162504$at_diff expout "$at_stdout" || at_failed=:
162505at_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
162511fi
162512{ set +x
162513$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
162514at_fn_check_prepare_trace "java.at:688"
162515( $at_check_trace; bison YYParser.y
162516) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162517at_status=$? at_failed=false
162518$at_check_filter
162519at_fn_diff_devnull "$at_stderr" || at_failed=:
162520at_fn_diff_devnull "$at_stdout" || at_failed=:
162521at_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"
162528at_fn_check_prepare_trace "java.at:688"
162529( $at_check_trace; grep '[mb]4_' YYParser.y
162530) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162531at_status=$? at_failed=false
162532$at_check_filter
162533at_fn_diff_devnull "$at_stderr" || at_failed=:
162534echo stdout:; cat "$at_stdout"
162535at_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"
162548at_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>&-
162551at_status=$? at_failed=false
162552$at_check_filter
162553echo stderr:; cat "$at_stderr"
162554echo stdout:; cat "$at_stdout"
162555at_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"
162562at_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>&-
162565at_status=$? at_failed=false
162566$at_check_filter
162567at_fn_diff_devnull "$at_stderr" || at_failed=:
162568echo >>"$at_stdout"; $as_echo "1
162569" | \
162570  $at_diff - "$at_stdout" || at_failed=:
162571at_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"
162578at_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>&-
162581at_status=$? at_failed=false
162582$at_check_filter
162583at_fn_diff_devnull "$at_stderr" || at_failed=:
162584echo >>"$at_stdout"; $as_echo "1
162585" | \
162586  $at_diff - "$at_stdout" || at_failed=:
162587at_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"
162594at_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>&-
162597at_status=$? at_failed=false
162598$at_check_filter
162599at_fn_diff_devnull "$at_stderr" || at_failed=:
162600echo >>"$at_stdout"; $as_echo "1
162601" | \
162602  $at_diff - "$at_stdout" || at_failed=:
162603at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
162604$at_failed && at_fn_log_failure
162605$at_traceon; }
162606
162607
162608
162609cat >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%%
162621start: "end" {throw new ClassNotFoundException();};
162622%%
162623class Position {}
162624_ATEOF
162625
162626if 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"
162634at_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>&-
162638at_status=$? at_failed=false
162639$at_check_filter
162640echo stderr:; cat "$at_stderr"
162641echo stdout:; cat "$at_stdout"
162642at_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"
162648at_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>&-
162651at_status=$? at_failed=false
162652$at_check_filter
162653echo stderr:; cat "$at_stderr"
162654echo stdout:; cat "$at_stdout"
162655at_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"
162664at_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>&-
162669at_status=$? at_failed=false
162670$at_check_filter
162671at_fn_diff_devnull "$at_stderr" || at_failed=:
162672$at_diff expout "$at_stdout" || at_failed=:
162673at_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"
162682at_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>&-
162687at_status=$? at_failed=false
162688$at_check_filter
162689at_fn_diff_devnull "$at_stderr" || at_failed=:
162690$at_diff expout "$at_stdout" || at_failed=:
162691at_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
162697fi
162698{ set +x
162699$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
162700at_fn_check_prepare_trace "java.at:688"
162701( $at_check_trace; bison YYParser.y
162702) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162703at_status=$? at_failed=false
162704$at_check_filter
162705at_fn_diff_devnull "$at_stderr" || at_failed=:
162706at_fn_diff_devnull "$at_stdout" || at_failed=:
162707at_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"
162714at_fn_check_prepare_trace "java.at:688"
162715( $at_check_trace; grep '[mb]4_' YYParser.y
162716) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162717at_status=$? at_failed=false
162718$at_check_filter
162719at_fn_diff_devnull "$at_stderr" || at_failed=:
162720echo stdout:; cat "$at_stdout"
162721at_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"
162734at_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>&-
162737at_status=$? at_failed=false
162738$at_check_filter
162739echo stderr:; cat "$at_stderr"
162740echo stdout:; cat "$at_stdout"
162741at_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"
162748at_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>&-
162751at_status=$? at_failed=false
162752$at_check_filter
162753at_fn_diff_devnull "$at_stderr" || at_failed=:
162754echo >>"$at_stdout"; $as_echo "1
162755" | \
162756  $at_diff - "$at_stdout" || at_failed=:
162757at_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"
162764at_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>&-
162767at_status=$? at_failed=false
162768$at_check_filter
162769at_fn_diff_devnull "$at_stderr" || at_failed=:
162770echo >>"$at_stdout"; $as_echo "1
162771" | \
162772  $at_diff - "$at_stdout" || at_failed=:
162773at_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"
162780at_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>&-
162783at_status=$? at_failed=false
162784$at_check_filter
162785at_fn_diff_devnull "$at_stderr" || at_failed=:
162786echo >>"$at_stdout"; $as_echo "1
162787" | \
162788  $at_diff - "$at_stdout" || at_failed=:
162789at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
162790$at_failed && at_fn_log_failure
162791$at_traceon; }
162792
162793
162794
162795cat >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%%
162807start: "end" {throw new ClassNotFoundException();};
162808%%
162809class Position {}
162810_ATEOF
162811
162812if 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"
162820at_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>&-
162824at_status=$? at_failed=false
162825$at_check_filter
162826echo stderr:; cat "$at_stderr"
162827echo stdout:; cat "$at_stdout"
162828at_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"
162834at_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>&-
162837at_status=$? at_failed=false
162838$at_check_filter
162839echo stderr:; cat "$at_stderr"
162840echo stdout:; cat "$at_stdout"
162841at_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"
162850at_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>&-
162855at_status=$? at_failed=false
162856$at_check_filter
162857at_fn_diff_devnull "$at_stderr" || at_failed=:
162858$at_diff expout "$at_stdout" || at_failed=:
162859at_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"
162868at_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>&-
162873at_status=$? at_failed=false
162874$at_check_filter
162875at_fn_diff_devnull "$at_stderr" || at_failed=:
162876$at_diff expout "$at_stdout" || at_failed=:
162877at_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
162883fi
162884{ set +x
162885$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
162886at_fn_check_prepare_trace "java.at:688"
162887( $at_check_trace; bison YYParser.y
162888) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162889at_status=$? at_failed=false
162890$at_check_filter
162891at_fn_diff_devnull "$at_stderr" || at_failed=:
162892at_fn_diff_devnull "$at_stdout" || at_failed=:
162893at_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"
162900at_fn_check_prepare_trace "java.at:688"
162901( $at_check_trace; grep '[mb]4_' YYParser.y
162902) >>"$at_stdout" 2>>"$at_stderr" 5>&-
162903at_status=$? at_failed=false
162904$at_check_filter
162905at_fn_diff_devnull "$at_stderr" || at_failed=:
162906echo stdout:; cat "$at_stdout"
162907at_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"
162920at_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>&-
162923at_status=$? at_failed=false
162924$at_check_filter
162925echo stderr:; cat "$at_stderr"
162926echo stdout:; cat "$at_stdout"
162927at_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"
162934at_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>&-
162937at_status=$? at_failed=false
162938$at_check_filter
162939at_fn_diff_devnull "$at_stderr" || at_failed=:
162940echo >>"$at_stdout"; $as_echo "1
162941" | \
162942  $at_diff - "$at_stdout" || at_failed=:
162943at_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"
162950at_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>&-
162953at_status=$? at_failed=false
162954$at_check_filter
162955at_fn_diff_devnull "$at_stderr" || at_failed=:
162956echo >>"$at_stdout"; $as_echo "1
162957" | \
162958  $at_diff - "$at_stdout" || at_failed=:
162959at_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"
162966at_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>&-
162969at_status=$? at_failed=false
162970$at_check_filter
162971at_fn_diff_devnull "$at_stderr" || at_failed=:
162972echo >>"$at_stdout"; $as_echo "1
162973" | \
162974  $at_diff - "$at_stdout" || at_failed=:
162975at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
162976$at_failed && at_fn_log_failure
162977$at_traceon; }
162978
162979
162980
162981cat >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%%
162993start: "end" {};
162994%%
162995class Position {}
162996_ATEOF
162997
162998if 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"
163006at_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>&-
163010at_status=$? at_failed=false
163011$at_check_filter
163012echo stderr:; cat "$at_stderr"
163013echo stdout:; cat "$at_stdout"
163014at_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"
163020at_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>&-
163023at_status=$? at_failed=false
163024$at_check_filter
163025echo stderr:; cat "$at_stderr"
163026echo stdout:; cat "$at_stdout"
163027at_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"
163036at_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>&-
163041at_status=$? at_failed=false
163042$at_check_filter
163043at_fn_diff_devnull "$at_stderr" || at_failed=:
163044$at_diff expout "$at_stdout" || at_failed=:
163045at_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"
163054at_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>&-
163059at_status=$? at_failed=false
163060$at_check_filter
163061at_fn_diff_devnull "$at_stderr" || at_failed=:
163062$at_diff expout "$at_stdout" || at_failed=:
163063at_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
163069fi
163070{ set +x
163071$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
163072at_fn_check_prepare_trace "java.at:688"
163073( $at_check_trace; bison YYParser.y
163074) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163075at_status=$? at_failed=false
163076$at_check_filter
163077at_fn_diff_devnull "$at_stderr" || at_failed=:
163078at_fn_diff_devnull "$at_stdout" || at_failed=:
163079at_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"
163086at_fn_check_prepare_trace "java.at:688"
163087( $at_check_trace; grep '[mb]4_' YYParser.y
163088) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163089at_status=$? at_failed=false
163090$at_check_filter
163091at_fn_diff_devnull "$at_stderr" || at_failed=:
163092echo stdout:; cat "$at_stdout"
163093at_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"
163106at_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>&-
163109at_status=$? at_failed=false
163110$at_check_filter
163111echo stderr:; cat "$at_stderr"
163112echo stdout:; cat "$at_stdout"
163113at_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"
163120at_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>&-
163123at_status=$? at_failed=false
163124$at_check_filter
163125at_fn_diff_devnull "$at_stderr" || at_failed=:
163126echo >>"$at_stdout"; $as_echo "1
163127" | \
163128  $at_diff - "$at_stdout" || at_failed=:
163129at_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"
163136at_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>&-
163139at_status=$? at_failed=false
163140$at_check_filter
163141at_fn_diff_devnull "$at_stderr" || at_failed=:
163142echo >>"$at_stdout"; $as_echo "1
163143" | \
163144  $at_diff - "$at_stdout" || at_failed=:
163145at_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"
163152at_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>&-
163155at_status=$? at_failed=false
163156$at_check_filter
163157at_fn_diff_devnull "$at_stderr" || at_failed=:
163158echo >>"$at_stdout"; $as_echo "1
163159" | \
163160  $at_diff - "$at_stdout" || at_failed=:
163161at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
163162$at_failed && at_fn_log_failure
163163$at_traceon; }
163164
163165
163166
163167cat >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%%
163179start: "end" {};
163180%%
163181class Position {}
163182_ATEOF
163183
163184if 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"
163192at_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>&-
163196at_status=$? at_failed=false
163197$at_check_filter
163198echo stderr:; cat "$at_stderr"
163199echo stdout:; cat "$at_stdout"
163200at_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"
163206at_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>&-
163209at_status=$? at_failed=false
163210$at_check_filter
163211echo stderr:; cat "$at_stderr"
163212echo stdout:; cat "$at_stdout"
163213at_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"
163222at_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>&-
163227at_status=$? at_failed=false
163228$at_check_filter
163229at_fn_diff_devnull "$at_stderr" || at_failed=:
163230$at_diff expout "$at_stdout" || at_failed=:
163231at_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"
163240at_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>&-
163245at_status=$? at_failed=false
163246$at_check_filter
163247at_fn_diff_devnull "$at_stderr" || at_failed=:
163248$at_diff expout "$at_stdout" || at_failed=:
163249at_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
163255fi
163256{ set +x
163257$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
163258at_fn_check_prepare_trace "java.at:688"
163259( $at_check_trace; bison YYParser.y
163260) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163261at_status=$? at_failed=false
163262$at_check_filter
163263at_fn_diff_devnull "$at_stderr" || at_failed=:
163264at_fn_diff_devnull "$at_stdout" || at_failed=:
163265at_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"
163272at_fn_check_prepare_trace "java.at:688"
163273( $at_check_trace; grep '[mb]4_' YYParser.y
163274) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163275at_status=$? at_failed=false
163276$at_check_filter
163277at_fn_diff_devnull "$at_stderr" || at_failed=:
163278echo stdout:; cat "$at_stdout"
163279at_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"
163292at_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>&-
163295at_status=$? at_failed=false
163296$at_check_filter
163297echo stderr:; cat "$at_stderr"
163298echo stdout:; cat "$at_stdout"
163299at_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"
163306at_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>&-
163309at_status=$? at_failed=false
163310$at_check_filter
163311at_fn_diff_devnull "$at_stderr" || at_failed=:
163312echo >>"$at_stdout"; $as_echo "1
163313" | \
163314  $at_diff - "$at_stdout" || at_failed=:
163315at_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"
163322at_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>&-
163325at_status=$? at_failed=false
163326$at_check_filter
163327at_fn_diff_devnull "$at_stderr" || at_failed=:
163328echo >>"$at_stdout"; $as_echo "1
163329" | \
163330  $at_diff - "$at_stdout" || at_failed=:
163331at_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"
163338at_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>&-
163341at_status=$? at_failed=false
163342$at_check_filter
163343at_fn_diff_devnull "$at_stderr" || at_failed=:
163344echo >>"$at_stdout"; $as_echo "1
163345" | \
163346  $at_diff - "$at_stdout" || at_failed=:
163347at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
163348$at_failed && at_fn_log_failure
163349$at_traceon; }
163350
163351
163352
163353cat >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%%
163365start: "end" {throw new ClassNotFoundException();};
163366%%
163367class Position {}
163368_ATEOF
163369
163370if 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"
163378at_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>&-
163382at_status=$? at_failed=false
163383$at_check_filter
163384echo stderr:; cat "$at_stderr"
163385echo stdout:; cat "$at_stdout"
163386at_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"
163392at_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>&-
163395at_status=$? at_failed=false
163396$at_check_filter
163397echo stderr:; cat "$at_stderr"
163398echo stdout:; cat "$at_stdout"
163399at_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"
163408at_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>&-
163413at_status=$? at_failed=false
163414$at_check_filter
163415at_fn_diff_devnull "$at_stderr" || at_failed=:
163416$at_diff expout "$at_stdout" || at_failed=:
163417at_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"
163426at_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>&-
163431at_status=$? at_failed=false
163432$at_check_filter
163433at_fn_diff_devnull "$at_stderr" || at_failed=:
163434$at_diff expout "$at_stdout" || at_failed=:
163435at_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
163441fi
163442{ set +x
163443$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
163444at_fn_check_prepare_trace "java.at:688"
163445( $at_check_trace; bison YYParser.y
163446) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163447at_status=$? at_failed=false
163448$at_check_filter
163449at_fn_diff_devnull "$at_stderr" || at_failed=:
163450at_fn_diff_devnull "$at_stdout" || at_failed=:
163451at_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"
163458at_fn_check_prepare_trace "java.at:688"
163459( $at_check_trace; grep '[mb]4_' YYParser.y
163460) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163461at_status=$? at_failed=false
163462$at_check_filter
163463at_fn_diff_devnull "$at_stderr" || at_failed=:
163464echo stdout:; cat "$at_stdout"
163465at_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"
163478at_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>&-
163481at_status=$? at_failed=false
163482$at_check_filter
163483echo stderr:; cat "$at_stderr"
163484echo stdout:; cat "$at_stdout"
163485at_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"
163492at_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>&-
163495at_status=$? at_failed=false
163496$at_check_filter
163497at_fn_diff_devnull "$at_stderr" || at_failed=:
163498echo >>"$at_stdout"; $as_echo "1
163499" | \
163500  $at_diff - "$at_stdout" || at_failed=:
163501at_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"
163508at_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>&-
163511at_status=$? at_failed=false
163512$at_check_filter
163513at_fn_diff_devnull "$at_stderr" || at_failed=:
163514echo >>"$at_stdout"; $as_echo "1
163515" | \
163516  $at_diff - "$at_stdout" || at_failed=:
163517at_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"
163524at_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>&-
163527at_status=$? at_failed=false
163528$at_check_filter
163529at_fn_diff_devnull "$at_stderr" || at_failed=:
163530echo >>"$at_stdout"; $as_echo "1
163531" | \
163532  $at_diff - "$at_stdout" || at_failed=:
163533at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
163534$at_failed && at_fn_log_failure
163535$at_traceon; }
163536
163537
163538
163539cat >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%%
163551start: "end" {throw new ClassNotFoundException();};
163552%%
163553class Position {}
163554_ATEOF
163555
163556if 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"
163564at_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>&-
163568at_status=$? at_failed=false
163569$at_check_filter
163570echo stderr:; cat "$at_stderr"
163571echo stdout:; cat "$at_stdout"
163572at_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"
163578at_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>&-
163581at_status=$? at_failed=false
163582$at_check_filter
163583echo stderr:; cat "$at_stderr"
163584echo stdout:; cat "$at_stdout"
163585at_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"
163594at_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>&-
163599at_status=$? at_failed=false
163600$at_check_filter
163601at_fn_diff_devnull "$at_stderr" || at_failed=:
163602$at_diff expout "$at_stdout" || at_failed=:
163603at_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"
163612at_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>&-
163617at_status=$? at_failed=false
163618$at_check_filter
163619at_fn_diff_devnull "$at_stderr" || at_failed=:
163620$at_diff expout "$at_stdout" || at_failed=:
163621at_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
163627fi
163628{ set +x
163629$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
163630at_fn_check_prepare_trace "java.at:688"
163631( $at_check_trace; bison YYParser.y
163632) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163633at_status=$? at_failed=false
163634$at_check_filter
163635at_fn_diff_devnull "$at_stderr" || at_failed=:
163636at_fn_diff_devnull "$at_stdout" || at_failed=:
163637at_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"
163644at_fn_check_prepare_trace "java.at:688"
163645( $at_check_trace; grep '[mb]4_' YYParser.y
163646) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163647at_status=$? at_failed=false
163648$at_check_filter
163649at_fn_diff_devnull "$at_stderr" || at_failed=:
163650echo stdout:; cat "$at_stdout"
163651at_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"
163664at_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>&-
163667at_status=$? at_failed=false
163668$at_check_filter
163669echo stderr:; cat "$at_stderr"
163670echo stdout:; cat "$at_stdout"
163671at_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"
163678at_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>&-
163681at_status=$? at_failed=false
163682$at_check_filter
163683at_fn_diff_devnull "$at_stderr" || at_failed=:
163684echo >>"$at_stdout"; $as_echo "1
163685" | \
163686  $at_diff - "$at_stdout" || at_failed=:
163687at_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"
163694at_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>&-
163697at_status=$? at_failed=false
163698$at_check_filter
163699at_fn_diff_devnull "$at_stderr" || at_failed=:
163700echo >>"$at_stdout"; $as_echo "1
163701" | \
163702  $at_diff - "$at_stdout" || at_failed=:
163703at_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"
163710at_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>&-
163713at_status=$? at_failed=false
163714$at_check_filter
163715at_fn_diff_devnull "$at_stderr" || at_failed=:
163716echo >>"$at_stdout"; $as_echo "1
163717" | \
163718  $at_diff - "$at_stdout" || at_failed=:
163719at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
163720$at_failed && at_fn_log_failure
163721$at_traceon; }
163722
163723
163724
163725cat >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%%
163737start: "end" {};
163738%%
163739class Position {}
163740_ATEOF
163741
163742if 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"
163750at_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>&-
163754at_status=$? at_failed=false
163755$at_check_filter
163756echo stderr:; cat "$at_stderr"
163757echo stdout:; cat "$at_stdout"
163758at_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"
163764at_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>&-
163767at_status=$? at_failed=false
163768$at_check_filter
163769echo stderr:; cat "$at_stderr"
163770echo stdout:; cat "$at_stdout"
163771at_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"
163780at_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>&-
163785at_status=$? at_failed=false
163786$at_check_filter
163787at_fn_diff_devnull "$at_stderr" || at_failed=:
163788$at_diff expout "$at_stdout" || at_failed=:
163789at_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"
163798at_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>&-
163803at_status=$? at_failed=false
163804$at_check_filter
163805at_fn_diff_devnull "$at_stderr" || at_failed=:
163806$at_diff expout "$at_stdout" || at_failed=:
163807at_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
163813fi
163814{ set +x
163815$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
163816at_fn_check_prepare_trace "java.at:688"
163817( $at_check_trace; bison YYParser.y
163818) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163819at_status=$? at_failed=false
163820$at_check_filter
163821at_fn_diff_devnull "$at_stderr" || at_failed=:
163822at_fn_diff_devnull "$at_stdout" || at_failed=:
163823at_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"
163830at_fn_check_prepare_trace "java.at:688"
163831( $at_check_trace; grep '[mb]4_' YYParser.y
163832) >>"$at_stdout" 2>>"$at_stderr" 5>&-
163833at_status=$? at_failed=false
163834$at_check_filter
163835at_fn_diff_devnull "$at_stderr" || at_failed=:
163836echo stdout:; cat "$at_stdout"
163837at_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"
163850at_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>&-
163853at_status=$? at_failed=false
163854$at_check_filter
163855echo stderr:; cat "$at_stderr"
163856echo stdout:; cat "$at_stdout"
163857at_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"
163864at_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>&-
163867at_status=$? at_failed=false
163868$at_check_filter
163869at_fn_diff_devnull "$at_stderr" || at_failed=:
163870echo >>"$at_stdout"; $as_echo "1
163871" | \
163872  $at_diff - "$at_stdout" || at_failed=:
163873at_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"
163880at_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>&-
163883at_status=$? at_failed=false
163884$at_check_filter
163885at_fn_diff_devnull "$at_stderr" || at_failed=:
163886echo >>"$at_stdout"; $as_echo "1
163887" | \
163888  $at_diff - "$at_stdout" || at_failed=:
163889at_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"
163896at_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>&-
163899at_status=$? at_failed=false
163900$at_check_filter
163901at_fn_diff_devnull "$at_stderr" || at_failed=:
163902echo >>"$at_stdout"; $as_echo "1
163903" | \
163904  $at_diff - "$at_stdout" || at_failed=:
163905at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
163906$at_failed && at_fn_log_failure
163907$at_traceon; }
163908
163909
163910
163911cat >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%%
163923start: "end" {};
163924%%
163925class Position {}
163926_ATEOF
163927
163928if 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"
163936at_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>&-
163940at_status=$? at_failed=false
163941$at_check_filter
163942echo stderr:; cat "$at_stderr"
163943echo stdout:; cat "$at_stdout"
163944at_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"
163950at_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>&-
163953at_status=$? at_failed=false
163954$at_check_filter
163955echo stderr:; cat "$at_stderr"
163956echo stdout:; cat "$at_stdout"
163957at_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"
163966at_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>&-
163971at_status=$? at_failed=false
163972$at_check_filter
163973at_fn_diff_devnull "$at_stderr" || at_failed=:
163974$at_diff expout "$at_stdout" || at_failed=:
163975at_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"
163984at_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>&-
163989at_status=$? at_failed=false
163990$at_check_filter
163991at_fn_diff_devnull "$at_stderr" || at_failed=:
163992$at_diff expout "$at_stdout" || at_failed=:
163993at_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
163999fi
164000{ set +x
164001$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164002at_fn_check_prepare_trace "java.at:688"
164003( $at_check_trace; bison YYParser.y
164004) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164005at_status=$? at_failed=false
164006$at_check_filter
164007at_fn_diff_devnull "$at_stderr" || at_failed=:
164008at_fn_diff_devnull "$at_stdout" || at_failed=:
164009at_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"
164016at_fn_check_prepare_trace "java.at:688"
164017( $at_check_trace; grep '[mb]4_' YYParser.y
164018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164019at_status=$? at_failed=false
164020$at_check_filter
164021at_fn_diff_devnull "$at_stderr" || at_failed=:
164022echo stdout:; cat "$at_stdout"
164023at_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"
164036at_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>&-
164039at_status=$? at_failed=false
164040$at_check_filter
164041echo stderr:; cat "$at_stderr"
164042echo stdout:; cat "$at_stdout"
164043at_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"
164050at_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>&-
164053at_status=$? at_failed=false
164054$at_check_filter
164055at_fn_diff_devnull "$at_stderr" || at_failed=:
164056echo >>"$at_stdout"; $as_echo "1
164057" | \
164058  $at_diff - "$at_stdout" || at_failed=:
164059at_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"
164066at_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>&-
164069at_status=$? at_failed=false
164070$at_check_filter
164071at_fn_diff_devnull "$at_stderr" || at_failed=:
164072echo >>"$at_stdout"; $as_echo "1
164073" | \
164074  $at_diff - "$at_stdout" || at_failed=:
164075at_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"
164082at_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>&-
164085at_status=$? at_failed=false
164086$at_check_filter
164087at_fn_diff_devnull "$at_stderr" || at_failed=:
164088echo >>"$at_stdout"; $as_echo "1
164089" | \
164090  $at_diff - "$at_stdout" || at_failed=:
164091at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
164092$at_failed && at_fn_log_failure
164093$at_traceon; }
164094
164095
164096
164097cat >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%%
164109start: "end" {throw new ClassNotFoundException();};
164110%%
164111class Position {}
164112_ATEOF
164113
164114if 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"
164122at_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>&-
164126at_status=$? at_failed=false
164127$at_check_filter
164128echo stderr:; cat "$at_stderr"
164129echo stdout:; cat "$at_stdout"
164130at_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"
164136at_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>&-
164139at_status=$? at_failed=false
164140$at_check_filter
164141echo stderr:; cat "$at_stderr"
164142echo stdout:; cat "$at_stdout"
164143at_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"
164152at_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>&-
164157at_status=$? at_failed=false
164158$at_check_filter
164159at_fn_diff_devnull "$at_stderr" || at_failed=:
164160$at_diff expout "$at_stdout" || at_failed=:
164161at_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"
164170at_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>&-
164175at_status=$? at_failed=false
164176$at_check_filter
164177at_fn_diff_devnull "$at_stderr" || at_failed=:
164178$at_diff expout "$at_stdout" || at_failed=:
164179at_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
164185fi
164186{ set +x
164187$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164188at_fn_check_prepare_trace "java.at:688"
164189( $at_check_trace; bison YYParser.y
164190) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164191at_status=$? at_failed=false
164192$at_check_filter
164193at_fn_diff_devnull "$at_stderr" || at_failed=:
164194at_fn_diff_devnull "$at_stdout" || at_failed=:
164195at_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"
164202at_fn_check_prepare_trace "java.at:688"
164203( $at_check_trace; grep '[mb]4_' YYParser.y
164204) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164205at_status=$? at_failed=false
164206$at_check_filter
164207at_fn_diff_devnull "$at_stderr" || at_failed=:
164208echo stdout:; cat "$at_stdout"
164209at_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"
164222at_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>&-
164225at_status=$? at_failed=false
164226$at_check_filter
164227echo stderr:; cat "$at_stderr"
164228echo stdout:; cat "$at_stdout"
164229at_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"
164236at_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>&-
164239at_status=$? at_failed=false
164240$at_check_filter
164241at_fn_diff_devnull "$at_stderr" || at_failed=:
164242echo >>"$at_stdout"; $as_echo "1
164243" | \
164244  $at_diff - "$at_stdout" || at_failed=:
164245at_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"
164252at_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>&-
164255at_status=$? at_failed=false
164256$at_check_filter
164257at_fn_diff_devnull "$at_stderr" || at_failed=:
164258echo >>"$at_stdout"; $as_echo "1
164259" | \
164260  $at_diff - "$at_stdout" || at_failed=:
164261at_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"
164268at_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>&-
164271at_status=$? at_failed=false
164272$at_check_filter
164273at_fn_diff_devnull "$at_stderr" || at_failed=:
164274echo >>"$at_stdout"; $as_echo "1
164275" | \
164276  $at_diff - "$at_stdout" || at_failed=:
164277at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
164278$at_failed && at_fn_log_failure
164279$at_traceon; }
164280
164281
164282
164283cat >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%%
164295start: "end" {throw new ClassNotFoundException();};
164296%%
164297class Position {}
164298_ATEOF
164299
164300if 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"
164308at_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>&-
164312at_status=$? at_failed=false
164313$at_check_filter
164314echo stderr:; cat "$at_stderr"
164315echo stdout:; cat "$at_stdout"
164316at_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"
164322at_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>&-
164325at_status=$? at_failed=false
164326$at_check_filter
164327echo stderr:; cat "$at_stderr"
164328echo stdout:; cat "$at_stdout"
164329at_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"
164338at_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>&-
164343at_status=$? at_failed=false
164344$at_check_filter
164345at_fn_diff_devnull "$at_stderr" || at_failed=:
164346$at_diff expout "$at_stdout" || at_failed=:
164347at_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"
164356at_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>&-
164361at_status=$? at_failed=false
164362$at_check_filter
164363at_fn_diff_devnull "$at_stderr" || at_failed=:
164364$at_diff expout "$at_stdout" || at_failed=:
164365at_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
164371fi
164372{ set +x
164373$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164374at_fn_check_prepare_trace "java.at:688"
164375( $at_check_trace; bison YYParser.y
164376) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164377at_status=$? at_failed=false
164378$at_check_filter
164379at_fn_diff_devnull "$at_stderr" || at_failed=:
164380at_fn_diff_devnull "$at_stdout" || at_failed=:
164381at_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"
164388at_fn_check_prepare_trace "java.at:688"
164389( $at_check_trace; grep '[mb]4_' YYParser.y
164390) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164391at_status=$? at_failed=false
164392$at_check_filter
164393at_fn_diff_devnull "$at_stderr" || at_failed=:
164394echo stdout:; cat "$at_stdout"
164395at_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"
164408at_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>&-
164411at_status=$? at_failed=false
164412$at_check_filter
164413echo stderr:; cat "$at_stderr"
164414echo stdout:; cat "$at_stdout"
164415at_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"
164422at_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>&-
164425at_status=$? at_failed=false
164426$at_check_filter
164427at_fn_diff_devnull "$at_stderr" || at_failed=:
164428echo >>"$at_stdout"; $as_echo "1
164429" | \
164430  $at_diff - "$at_stdout" || at_failed=:
164431at_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"
164438at_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>&-
164441at_status=$? at_failed=false
164442$at_check_filter
164443at_fn_diff_devnull "$at_stderr" || at_failed=:
164444echo >>"$at_stdout"; $as_echo "1
164445" | \
164446  $at_diff - "$at_stdout" || at_failed=:
164447at_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"
164454at_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>&-
164457at_status=$? at_failed=false
164458$at_check_filter
164459at_fn_diff_devnull "$at_stderr" || at_failed=:
164460echo >>"$at_stdout"; $as_echo "1
164461" | \
164462  $at_diff - "$at_stdout" || at_failed=:
164463at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
164464$at_failed && at_fn_log_failure
164465$at_traceon; }
164466
164467
164468
164469cat >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%%
164481start: "end" {};
164482%%
164483class Position {}
164484_ATEOF
164485
164486if 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"
164494at_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>&-
164498at_status=$? at_failed=false
164499$at_check_filter
164500echo stderr:; cat "$at_stderr"
164501echo stdout:; cat "$at_stdout"
164502at_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"
164508at_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>&-
164511at_status=$? at_failed=false
164512$at_check_filter
164513echo stderr:; cat "$at_stderr"
164514echo stdout:; cat "$at_stdout"
164515at_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"
164524at_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>&-
164529at_status=$? at_failed=false
164530$at_check_filter
164531at_fn_diff_devnull "$at_stderr" || at_failed=:
164532$at_diff expout "$at_stdout" || at_failed=:
164533at_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"
164542at_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>&-
164547at_status=$? at_failed=false
164548$at_check_filter
164549at_fn_diff_devnull "$at_stderr" || at_failed=:
164550$at_diff expout "$at_stdout" || at_failed=:
164551at_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
164557fi
164558{ set +x
164559$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164560at_fn_check_prepare_trace "java.at:688"
164561( $at_check_trace; bison YYParser.y
164562) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164563at_status=$? at_failed=false
164564$at_check_filter
164565at_fn_diff_devnull "$at_stderr" || at_failed=:
164566at_fn_diff_devnull "$at_stdout" || at_failed=:
164567at_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"
164574at_fn_check_prepare_trace "java.at:688"
164575( $at_check_trace; grep '[mb]4_' YYParser.y
164576) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164577at_status=$? at_failed=false
164578$at_check_filter
164579at_fn_diff_devnull "$at_stderr" || at_failed=:
164580echo stdout:; cat "$at_stdout"
164581at_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"
164594at_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>&-
164597at_status=$? at_failed=false
164598$at_check_filter
164599echo stderr:; cat "$at_stderr"
164600echo stdout:; cat "$at_stdout"
164601at_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"
164608at_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>&-
164611at_status=$? at_failed=false
164612$at_check_filter
164613at_fn_diff_devnull "$at_stderr" || at_failed=:
164614echo >>"$at_stdout"; $as_echo "1
164615" | \
164616  $at_diff - "$at_stdout" || at_failed=:
164617at_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"
164624at_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>&-
164627at_status=$? at_failed=false
164628$at_check_filter
164629at_fn_diff_devnull "$at_stderr" || at_failed=:
164630echo >>"$at_stdout"; $as_echo "1
164631" | \
164632  $at_diff - "$at_stdout" || at_failed=:
164633at_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"
164640at_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>&-
164643at_status=$? at_failed=false
164644$at_check_filter
164645at_fn_diff_devnull "$at_stderr" || at_failed=:
164646echo >>"$at_stdout"; $as_echo "1
164647" | \
164648  $at_diff - "$at_stdout" || at_failed=:
164649at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
164650$at_failed && at_fn_log_failure
164651$at_traceon; }
164652
164653
164654
164655cat >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%%
164667start: "end" {};
164668%%
164669class Position {}
164670_ATEOF
164671
164672if 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"
164680at_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>&-
164684at_status=$? at_failed=false
164685$at_check_filter
164686echo stderr:; cat "$at_stderr"
164687echo stdout:; cat "$at_stdout"
164688at_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"
164694at_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>&-
164697at_status=$? at_failed=false
164698$at_check_filter
164699echo stderr:; cat "$at_stderr"
164700echo stdout:; cat "$at_stdout"
164701at_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"
164710at_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>&-
164715at_status=$? at_failed=false
164716$at_check_filter
164717at_fn_diff_devnull "$at_stderr" || at_failed=:
164718$at_diff expout "$at_stdout" || at_failed=:
164719at_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"
164728at_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>&-
164733at_status=$? at_failed=false
164734$at_check_filter
164735at_fn_diff_devnull "$at_stderr" || at_failed=:
164736$at_diff expout "$at_stdout" || at_failed=:
164737at_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
164743fi
164744{ set +x
164745$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164746at_fn_check_prepare_trace "java.at:688"
164747( $at_check_trace; bison YYParser.y
164748) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164749at_status=$? at_failed=false
164750$at_check_filter
164751at_fn_diff_devnull "$at_stderr" || at_failed=:
164752at_fn_diff_devnull "$at_stdout" || at_failed=:
164753at_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"
164760at_fn_check_prepare_trace "java.at:688"
164761( $at_check_trace; grep '[mb]4_' YYParser.y
164762) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164763at_status=$? at_failed=false
164764$at_check_filter
164765at_fn_diff_devnull "$at_stderr" || at_failed=:
164766echo stdout:; cat "$at_stdout"
164767at_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"
164780at_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>&-
164783at_status=$? at_failed=false
164784$at_check_filter
164785echo stderr:; cat "$at_stderr"
164786echo stdout:; cat "$at_stdout"
164787at_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"
164794at_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>&-
164797at_status=$? at_failed=false
164798$at_check_filter
164799at_fn_diff_devnull "$at_stderr" || at_failed=:
164800echo >>"$at_stdout"; $as_echo "1
164801" | \
164802  $at_diff - "$at_stdout" || at_failed=:
164803at_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"
164810at_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>&-
164813at_status=$? at_failed=false
164814$at_check_filter
164815at_fn_diff_devnull "$at_stderr" || at_failed=:
164816echo >>"$at_stdout"; $as_echo "1
164817" | \
164818  $at_diff - "$at_stdout" || at_failed=:
164819at_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"
164826at_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>&-
164829at_status=$? at_failed=false
164830$at_check_filter
164831at_fn_diff_devnull "$at_stderr" || at_failed=:
164832echo >>"$at_stdout"; $as_echo "1
164833" | \
164834  $at_diff - "$at_stdout" || at_failed=:
164835at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
164836$at_failed && at_fn_log_failure
164837$at_traceon; }
164838
164839
164840
164841cat >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%%
164853start: "end" {throw new ClassNotFoundException();};
164854%%
164855class Position {}
164856_ATEOF
164857
164858if 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"
164866at_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>&-
164870at_status=$? at_failed=false
164871$at_check_filter
164872echo stderr:; cat "$at_stderr"
164873echo stdout:; cat "$at_stdout"
164874at_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"
164880at_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>&-
164883at_status=$? at_failed=false
164884$at_check_filter
164885echo stderr:; cat "$at_stderr"
164886echo stdout:; cat "$at_stdout"
164887at_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"
164896at_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>&-
164901at_status=$? at_failed=false
164902$at_check_filter
164903at_fn_diff_devnull "$at_stderr" || at_failed=:
164904$at_diff expout "$at_stdout" || at_failed=:
164905at_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"
164914at_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>&-
164919at_status=$? at_failed=false
164920$at_check_filter
164921at_fn_diff_devnull "$at_stderr" || at_failed=:
164922$at_diff expout "$at_stdout" || at_failed=:
164923at_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
164929fi
164930{ set +x
164931$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
164932at_fn_check_prepare_trace "java.at:688"
164933( $at_check_trace; bison YYParser.y
164934) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164935at_status=$? at_failed=false
164936$at_check_filter
164937at_fn_diff_devnull "$at_stderr" || at_failed=:
164938at_fn_diff_devnull "$at_stdout" || at_failed=:
164939at_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"
164946at_fn_check_prepare_trace "java.at:688"
164947( $at_check_trace; grep '[mb]4_' YYParser.y
164948) >>"$at_stdout" 2>>"$at_stderr" 5>&-
164949at_status=$? at_failed=false
164950$at_check_filter
164951at_fn_diff_devnull "$at_stderr" || at_failed=:
164952echo stdout:; cat "$at_stdout"
164953at_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"
164966at_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>&-
164969at_status=$? at_failed=false
164970$at_check_filter
164971echo stderr:; cat "$at_stderr"
164972echo stdout:; cat "$at_stdout"
164973at_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"
164980at_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>&-
164983at_status=$? at_failed=false
164984$at_check_filter
164985at_fn_diff_devnull "$at_stderr" || at_failed=:
164986echo >>"$at_stdout"; $as_echo "1
164987" | \
164988  $at_diff - "$at_stdout" || at_failed=:
164989at_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"
164996at_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>&-
164999at_status=$? at_failed=false
165000$at_check_filter
165001at_fn_diff_devnull "$at_stderr" || at_failed=:
165002echo >>"$at_stdout"; $as_echo "1
165003" | \
165004  $at_diff - "$at_stdout" || at_failed=:
165005at_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"
165012at_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>&-
165015at_status=$? at_failed=false
165016$at_check_filter
165017at_fn_diff_devnull "$at_stderr" || at_failed=:
165018echo >>"$at_stdout"; $as_echo "1
165019" | \
165020  $at_diff - "$at_stdout" || at_failed=:
165021at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
165022$at_failed && at_fn_log_failure
165023$at_traceon; }
165024
165025
165026
165027cat >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%%
165039start: "end" {throw new ClassNotFoundException();};
165040%%
165041class Position {}
165042_ATEOF
165043
165044if 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"
165052at_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>&-
165056at_status=$? at_failed=false
165057$at_check_filter
165058echo stderr:; cat "$at_stderr"
165059echo stdout:; cat "$at_stdout"
165060at_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"
165066at_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>&-
165069at_status=$? at_failed=false
165070$at_check_filter
165071echo stderr:; cat "$at_stderr"
165072echo stdout:; cat "$at_stdout"
165073at_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"
165082at_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>&-
165087at_status=$? at_failed=false
165088$at_check_filter
165089at_fn_diff_devnull "$at_stderr" || at_failed=:
165090$at_diff expout "$at_stdout" || at_failed=:
165091at_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"
165100at_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>&-
165105at_status=$? at_failed=false
165106$at_check_filter
165107at_fn_diff_devnull "$at_stderr" || at_failed=:
165108$at_diff expout "$at_stdout" || at_failed=:
165109at_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
165115fi
165116{ set +x
165117$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
165118at_fn_check_prepare_trace "java.at:688"
165119( $at_check_trace; bison YYParser.y
165120) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165121at_status=$? at_failed=false
165122$at_check_filter
165123at_fn_diff_devnull "$at_stderr" || at_failed=:
165124at_fn_diff_devnull "$at_stdout" || at_failed=:
165125at_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"
165132at_fn_check_prepare_trace "java.at:688"
165133( $at_check_trace; grep '[mb]4_' YYParser.y
165134) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165135at_status=$? at_failed=false
165136$at_check_filter
165137at_fn_diff_devnull "$at_stderr" || at_failed=:
165138echo stdout:; cat "$at_stdout"
165139at_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"
165152at_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>&-
165155at_status=$? at_failed=false
165156$at_check_filter
165157echo stderr:; cat "$at_stderr"
165158echo stdout:; cat "$at_stdout"
165159at_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"
165166at_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>&-
165169at_status=$? at_failed=false
165170$at_check_filter
165171at_fn_diff_devnull "$at_stderr" || at_failed=:
165172echo >>"$at_stdout"; $as_echo "1
165173" | \
165174  $at_diff - "$at_stdout" || at_failed=:
165175at_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"
165182at_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>&-
165185at_status=$? at_failed=false
165186$at_check_filter
165187at_fn_diff_devnull "$at_stderr" || at_failed=:
165188echo >>"$at_stdout"; $as_echo "1
165189" | \
165190  $at_diff - "$at_stdout" || at_failed=:
165191at_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"
165198at_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>&-
165201at_status=$? at_failed=false
165202$at_check_filter
165203at_fn_diff_devnull "$at_stderr" || at_failed=:
165204echo >>"$at_stdout"; $as_echo "1
165205" | \
165206  $at_diff - "$at_stdout" || at_failed=:
165207at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
165208$at_failed && at_fn_log_failure
165209$at_traceon; }
165210
165211
165212
165213cat >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%%
165246start: "end" {};
165247%%
165248class Position {}
165249_ATEOF
165250
165251if 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"
165259at_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>&-
165263at_status=$? at_failed=false
165264$at_check_filter
165265echo stderr:; cat "$at_stderr"
165266echo stdout:; cat "$at_stdout"
165267at_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"
165273at_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>&-
165276at_status=$? at_failed=false
165277$at_check_filter
165278echo stderr:; cat "$at_stderr"
165279echo stdout:; cat "$at_stdout"
165280at_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"
165289at_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>&-
165294at_status=$? at_failed=false
165295$at_check_filter
165296at_fn_diff_devnull "$at_stderr" || at_failed=:
165297$at_diff expout "$at_stdout" || at_failed=:
165298at_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"
165307at_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>&-
165312at_status=$? at_failed=false
165313$at_check_filter
165314at_fn_diff_devnull "$at_stderr" || at_failed=:
165315$at_diff expout "$at_stdout" || at_failed=:
165316at_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
165322fi
165323{ set +x
165324$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
165325at_fn_check_prepare_trace "java.at:688"
165326( $at_check_trace; bison YYParser.y
165327) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165328at_status=$? at_failed=false
165329$at_check_filter
165330at_fn_diff_devnull "$at_stderr" || at_failed=:
165331at_fn_diff_devnull "$at_stdout" || at_failed=:
165332at_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"
165339at_fn_check_prepare_trace "java.at:688"
165340( $at_check_trace; grep '[mb]4_' YYParser.y
165341) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165342at_status=$? at_failed=false
165343$at_check_filter
165344at_fn_diff_devnull "$at_stderr" || at_failed=:
165345echo stdout:; cat "$at_stdout"
165346at_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"
165359at_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>&-
165362at_status=$? at_failed=false
165363$at_check_filter
165364echo stderr:; cat "$at_stderr"
165365echo stdout:; cat "$at_stdout"
165366at_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"
165373at_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>&-
165376at_status=$? at_failed=false
165377$at_check_filter
165378at_fn_diff_devnull "$at_stderr" || at_failed=:
165379echo >>"$at_stdout"; $as_echo "1
165380" | \
165381  $at_diff - "$at_stdout" || at_failed=:
165382at_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"
165389at_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>&-
165392at_status=$? at_failed=false
165393$at_check_filter
165394at_fn_diff_devnull "$at_stderr" || at_failed=:
165395echo >>"$at_stdout"; $as_echo "1
165396" | \
165397  $at_diff - "$at_stdout" || at_failed=:
165398at_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"
165405at_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>&-
165408at_status=$? at_failed=false
165409$at_check_filter
165410at_fn_diff_devnull "$at_stderr" || at_failed=:
165411echo >>"$at_stdout"; $as_echo "1
165412" | \
165413  $at_diff - "$at_stdout" || at_failed=:
165414at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
165415$at_failed && at_fn_log_failure
165416$at_traceon; }
165417
165418
165419
165420cat >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%%
165453start: "end" {};
165454%%
165455class Position {}
165456_ATEOF
165457
165458if 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"
165466at_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>&-
165470at_status=$? at_failed=false
165471$at_check_filter
165472echo stderr:; cat "$at_stderr"
165473echo stdout:; cat "$at_stdout"
165474at_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"
165480at_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>&-
165483at_status=$? at_failed=false
165484$at_check_filter
165485echo stderr:; cat "$at_stderr"
165486echo stdout:; cat "$at_stdout"
165487at_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"
165496at_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>&-
165501at_status=$? at_failed=false
165502$at_check_filter
165503at_fn_diff_devnull "$at_stderr" || at_failed=:
165504$at_diff expout "$at_stdout" || at_failed=:
165505at_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"
165514at_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>&-
165519at_status=$? at_failed=false
165520$at_check_filter
165521at_fn_diff_devnull "$at_stderr" || at_failed=:
165522$at_diff expout "$at_stdout" || at_failed=:
165523at_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
165529fi
165530{ set +x
165531$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
165532at_fn_check_prepare_trace "java.at:688"
165533( $at_check_trace; bison YYParser.y
165534) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165535at_status=$? at_failed=false
165536$at_check_filter
165537at_fn_diff_devnull "$at_stderr" || at_failed=:
165538at_fn_diff_devnull "$at_stdout" || at_failed=:
165539at_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"
165546at_fn_check_prepare_trace "java.at:688"
165547( $at_check_trace; grep '[mb]4_' YYParser.y
165548) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165549at_status=$? at_failed=false
165550$at_check_filter
165551at_fn_diff_devnull "$at_stderr" || at_failed=:
165552echo stdout:; cat "$at_stdout"
165553at_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"
165566at_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>&-
165569at_status=$? at_failed=false
165570$at_check_filter
165571echo stderr:; cat "$at_stderr"
165572echo stdout:; cat "$at_stdout"
165573at_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"
165580at_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>&-
165583at_status=$? at_failed=false
165584$at_check_filter
165585at_fn_diff_devnull "$at_stderr" || at_failed=:
165586echo >>"$at_stdout"; $as_echo "1
165587" | \
165588  $at_diff - "$at_stdout" || at_failed=:
165589at_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"
165596at_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>&-
165599at_status=$? at_failed=false
165600$at_check_filter
165601at_fn_diff_devnull "$at_stderr" || at_failed=:
165602echo >>"$at_stdout"; $as_echo "1
165603" | \
165604  $at_diff - "$at_stdout" || at_failed=:
165605at_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"
165612at_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>&-
165615at_status=$? at_failed=false
165616$at_check_filter
165617at_fn_diff_devnull "$at_stderr" || at_failed=:
165618echo >>"$at_stdout"; $as_echo "1
165619" | \
165620  $at_diff - "$at_stdout" || at_failed=:
165621at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
165622$at_failed && at_fn_log_failure
165623$at_traceon; }
165624
165625
165626
165627cat >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%%
165660start: "end" {throw new ClassNotFoundException();};
165661%%
165662class Position {}
165663_ATEOF
165664
165665if 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"
165673at_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>&-
165677at_status=$? at_failed=false
165678$at_check_filter
165679echo stderr:; cat "$at_stderr"
165680echo stdout:; cat "$at_stdout"
165681at_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"
165687at_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>&-
165690at_status=$? at_failed=false
165691$at_check_filter
165692echo stderr:; cat "$at_stderr"
165693echo stdout:; cat "$at_stdout"
165694at_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"
165703at_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>&-
165708at_status=$? at_failed=false
165709$at_check_filter
165710at_fn_diff_devnull "$at_stderr" || at_failed=:
165711$at_diff expout "$at_stdout" || at_failed=:
165712at_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"
165721at_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>&-
165726at_status=$? at_failed=false
165727$at_check_filter
165728at_fn_diff_devnull "$at_stderr" || at_failed=:
165729$at_diff expout "$at_stdout" || at_failed=:
165730at_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
165736fi
165737{ set +x
165738$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
165739at_fn_check_prepare_trace "java.at:688"
165740( $at_check_trace; bison YYParser.y
165741) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165742at_status=$? at_failed=false
165743$at_check_filter
165744at_fn_diff_devnull "$at_stderr" || at_failed=:
165745at_fn_diff_devnull "$at_stdout" || at_failed=:
165746at_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"
165753at_fn_check_prepare_trace "java.at:688"
165754( $at_check_trace; grep '[mb]4_' YYParser.y
165755) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165756at_status=$? at_failed=false
165757$at_check_filter
165758at_fn_diff_devnull "$at_stderr" || at_failed=:
165759echo stdout:; cat "$at_stdout"
165760at_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"
165773at_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>&-
165776at_status=$? at_failed=false
165777$at_check_filter
165778echo stderr:; cat "$at_stderr"
165779echo stdout:; cat "$at_stdout"
165780at_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"
165787at_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>&-
165790at_status=$? at_failed=false
165791$at_check_filter
165792at_fn_diff_devnull "$at_stderr" || at_failed=:
165793echo >>"$at_stdout"; $as_echo "1
165794" | \
165795  $at_diff - "$at_stdout" || at_failed=:
165796at_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"
165803at_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>&-
165806at_status=$? at_failed=false
165807$at_check_filter
165808at_fn_diff_devnull "$at_stderr" || at_failed=:
165809echo >>"$at_stdout"; $as_echo "1
165810" | \
165811  $at_diff - "$at_stdout" || at_failed=:
165812at_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"
165819at_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>&-
165822at_status=$? at_failed=false
165823$at_check_filter
165824at_fn_diff_devnull "$at_stderr" || at_failed=:
165825echo >>"$at_stdout"; $as_echo "1
165826" | \
165827  $at_diff - "$at_stdout" || at_failed=:
165828at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
165829$at_failed && at_fn_log_failure
165830$at_traceon; }
165831
165832
165833
165834cat >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%%
165867start: "end" {throw new ClassNotFoundException();};
165868%%
165869class Position {}
165870_ATEOF
165871
165872if 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"
165880at_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>&-
165884at_status=$? at_failed=false
165885$at_check_filter
165886echo stderr:; cat "$at_stderr"
165887echo stdout:; cat "$at_stdout"
165888at_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"
165894at_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>&-
165897at_status=$? at_failed=false
165898$at_check_filter
165899echo stderr:; cat "$at_stderr"
165900echo stdout:; cat "$at_stdout"
165901at_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"
165910at_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>&-
165915at_status=$? at_failed=false
165916$at_check_filter
165917at_fn_diff_devnull "$at_stderr" || at_failed=:
165918$at_diff expout "$at_stdout" || at_failed=:
165919at_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"
165928at_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>&-
165933at_status=$? at_failed=false
165934$at_check_filter
165935at_fn_diff_devnull "$at_stderr" || at_failed=:
165936$at_diff expout "$at_stdout" || at_failed=:
165937at_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
165943fi
165944{ set +x
165945$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
165946at_fn_check_prepare_trace "java.at:688"
165947( $at_check_trace; bison YYParser.y
165948) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165949at_status=$? at_failed=false
165950$at_check_filter
165951at_fn_diff_devnull "$at_stderr" || at_failed=:
165952at_fn_diff_devnull "$at_stdout" || at_failed=:
165953at_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"
165960at_fn_check_prepare_trace "java.at:688"
165961( $at_check_trace; grep '[mb]4_' YYParser.y
165962) >>"$at_stdout" 2>>"$at_stderr" 5>&-
165963at_status=$? at_failed=false
165964$at_check_filter
165965at_fn_diff_devnull "$at_stderr" || at_failed=:
165966echo stdout:; cat "$at_stdout"
165967at_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"
165980at_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>&-
165983at_status=$? at_failed=false
165984$at_check_filter
165985echo stderr:; cat "$at_stderr"
165986echo stdout:; cat "$at_stdout"
165987at_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"
165994at_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>&-
165997at_status=$? at_failed=false
165998$at_check_filter
165999at_fn_diff_devnull "$at_stderr" || at_failed=:
166000echo >>"$at_stdout"; $as_echo "1
166001" | \
166002  $at_diff - "$at_stdout" || at_failed=:
166003at_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"
166010at_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>&-
166013at_status=$? at_failed=false
166014$at_check_filter
166015at_fn_diff_devnull "$at_stderr" || at_failed=:
166016echo >>"$at_stdout"; $as_echo "1
166017" | \
166018  $at_diff - "$at_stdout" || at_failed=:
166019at_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"
166026at_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>&-
166029at_status=$? at_failed=false
166030$at_check_filter
166031at_fn_diff_devnull "$at_stderr" || at_failed=:
166032echo >>"$at_stdout"; $as_echo "1
166033" | \
166034  $at_diff - "$at_stdout" || at_failed=:
166035at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
166036$at_failed && at_fn_log_failure
166037$at_traceon; }
166038
166039
166040
166041cat >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%%
166074start: "end" {};
166075%%
166076class Position {}
166077_ATEOF
166078
166079if 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"
166087at_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>&-
166091at_status=$? at_failed=false
166092$at_check_filter
166093echo stderr:; cat "$at_stderr"
166094echo stdout:; cat "$at_stdout"
166095at_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"
166101at_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>&-
166104at_status=$? at_failed=false
166105$at_check_filter
166106echo stderr:; cat "$at_stderr"
166107echo stdout:; cat "$at_stdout"
166108at_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"
166117at_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>&-
166122at_status=$? at_failed=false
166123$at_check_filter
166124at_fn_diff_devnull "$at_stderr" || at_failed=:
166125$at_diff expout "$at_stdout" || at_failed=:
166126at_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"
166135at_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>&-
166140at_status=$? at_failed=false
166141$at_check_filter
166142at_fn_diff_devnull "$at_stderr" || at_failed=:
166143$at_diff expout "$at_stdout" || at_failed=:
166144at_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
166150fi
166151{ set +x
166152$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
166153at_fn_check_prepare_trace "java.at:688"
166154( $at_check_trace; bison YYParser.y
166155) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166156at_status=$? at_failed=false
166157$at_check_filter
166158at_fn_diff_devnull "$at_stderr" || at_failed=:
166159at_fn_diff_devnull "$at_stdout" || at_failed=:
166160at_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"
166167at_fn_check_prepare_trace "java.at:688"
166168( $at_check_trace; grep '[mb]4_' YYParser.y
166169) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166170at_status=$? at_failed=false
166171$at_check_filter
166172at_fn_diff_devnull "$at_stderr" || at_failed=:
166173echo stdout:; cat "$at_stdout"
166174at_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"
166187at_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>&-
166190at_status=$? at_failed=false
166191$at_check_filter
166192echo stderr:; cat "$at_stderr"
166193echo stdout:; cat "$at_stdout"
166194at_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"
166201at_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>&-
166204at_status=$? at_failed=false
166205$at_check_filter
166206at_fn_diff_devnull "$at_stderr" || at_failed=:
166207echo >>"$at_stdout"; $as_echo "1
166208" | \
166209  $at_diff - "$at_stdout" || at_failed=:
166210at_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"
166217at_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>&-
166220at_status=$? at_failed=false
166221$at_check_filter
166222at_fn_diff_devnull "$at_stderr" || at_failed=:
166223echo >>"$at_stdout"; $as_echo "1
166224" | \
166225  $at_diff - "$at_stdout" || at_failed=:
166226at_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"
166233at_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>&-
166236at_status=$? at_failed=false
166237$at_check_filter
166238at_fn_diff_devnull "$at_stderr" || at_failed=:
166239echo >>"$at_stdout"; $as_echo "1
166240" | \
166241  $at_diff - "$at_stdout" || at_failed=:
166242at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
166243$at_failed && at_fn_log_failure
166244$at_traceon; }
166245
166246
166247
166248cat >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%%
166281start: "end" {};
166282%%
166283class Position {}
166284_ATEOF
166285
166286if 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"
166294at_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>&-
166298at_status=$? at_failed=false
166299$at_check_filter
166300echo stderr:; cat "$at_stderr"
166301echo stdout:; cat "$at_stdout"
166302at_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"
166308at_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>&-
166311at_status=$? at_failed=false
166312$at_check_filter
166313echo stderr:; cat "$at_stderr"
166314echo stdout:; cat "$at_stdout"
166315at_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"
166324at_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>&-
166329at_status=$? at_failed=false
166330$at_check_filter
166331at_fn_diff_devnull "$at_stderr" || at_failed=:
166332$at_diff expout "$at_stdout" || at_failed=:
166333at_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"
166342at_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>&-
166347at_status=$? at_failed=false
166348$at_check_filter
166349at_fn_diff_devnull "$at_stderr" || at_failed=:
166350$at_diff expout "$at_stdout" || at_failed=:
166351at_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
166357fi
166358{ set +x
166359$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
166360at_fn_check_prepare_trace "java.at:688"
166361( $at_check_trace; bison YYParser.y
166362) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166363at_status=$? at_failed=false
166364$at_check_filter
166365at_fn_diff_devnull "$at_stderr" || at_failed=:
166366at_fn_diff_devnull "$at_stdout" || at_failed=:
166367at_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"
166374at_fn_check_prepare_trace "java.at:688"
166375( $at_check_trace; grep '[mb]4_' YYParser.y
166376) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166377at_status=$? at_failed=false
166378$at_check_filter
166379at_fn_diff_devnull "$at_stderr" || at_failed=:
166380echo stdout:; cat "$at_stdout"
166381at_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"
166394at_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>&-
166397at_status=$? at_failed=false
166398$at_check_filter
166399echo stderr:; cat "$at_stderr"
166400echo stdout:; cat "$at_stdout"
166401at_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"
166408at_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>&-
166411at_status=$? at_failed=false
166412$at_check_filter
166413at_fn_diff_devnull "$at_stderr" || at_failed=:
166414echo >>"$at_stdout"; $as_echo "1
166415" | \
166416  $at_diff - "$at_stdout" || at_failed=:
166417at_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"
166424at_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>&-
166427at_status=$? at_failed=false
166428$at_check_filter
166429at_fn_diff_devnull "$at_stderr" || at_failed=:
166430echo >>"$at_stdout"; $as_echo "1
166431" | \
166432  $at_diff - "$at_stdout" || at_failed=:
166433at_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"
166440at_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>&-
166443at_status=$? at_failed=false
166444$at_check_filter
166445at_fn_diff_devnull "$at_stderr" || at_failed=:
166446echo >>"$at_stdout"; $as_echo "1
166447" | \
166448  $at_diff - "$at_stdout" || at_failed=:
166449at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
166450$at_failed && at_fn_log_failure
166451$at_traceon; }
166452
166453
166454
166455cat >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%%
166488start: "end" {throw new ClassNotFoundException();};
166489%%
166490class Position {}
166491_ATEOF
166492
166493if 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"
166501at_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>&-
166505at_status=$? at_failed=false
166506$at_check_filter
166507echo stderr:; cat "$at_stderr"
166508echo stdout:; cat "$at_stdout"
166509at_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"
166515at_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>&-
166518at_status=$? at_failed=false
166519$at_check_filter
166520echo stderr:; cat "$at_stderr"
166521echo stdout:; cat "$at_stdout"
166522at_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"
166531at_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>&-
166536at_status=$? at_failed=false
166537$at_check_filter
166538at_fn_diff_devnull "$at_stderr" || at_failed=:
166539$at_diff expout "$at_stdout" || at_failed=:
166540at_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"
166549at_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>&-
166554at_status=$? at_failed=false
166555$at_check_filter
166556at_fn_diff_devnull "$at_stderr" || at_failed=:
166557$at_diff expout "$at_stdout" || at_failed=:
166558at_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
166564fi
166565{ set +x
166566$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
166567at_fn_check_prepare_trace "java.at:688"
166568( $at_check_trace; bison YYParser.y
166569) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166570at_status=$? at_failed=false
166571$at_check_filter
166572at_fn_diff_devnull "$at_stderr" || at_failed=:
166573at_fn_diff_devnull "$at_stdout" || at_failed=:
166574at_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"
166581at_fn_check_prepare_trace "java.at:688"
166582( $at_check_trace; grep '[mb]4_' YYParser.y
166583) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166584at_status=$? at_failed=false
166585$at_check_filter
166586at_fn_diff_devnull "$at_stderr" || at_failed=:
166587echo stdout:; cat "$at_stdout"
166588at_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"
166601at_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>&-
166604at_status=$? at_failed=false
166605$at_check_filter
166606echo stderr:; cat "$at_stderr"
166607echo stdout:; cat "$at_stdout"
166608at_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"
166615at_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>&-
166618at_status=$? at_failed=false
166619$at_check_filter
166620at_fn_diff_devnull "$at_stderr" || at_failed=:
166621echo >>"$at_stdout"; $as_echo "1
166622" | \
166623  $at_diff - "$at_stdout" || at_failed=:
166624at_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"
166631at_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>&-
166634at_status=$? at_failed=false
166635$at_check_filter
166636at_fn_diff_devnull "$at_stderr" || at_failed=:
166637echo >>"$at_stdout"; $as_echo "1
166638" | \
166639  $at_diff - "$at_stdout" || at_failed=:
166640at_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"
166647at_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>&-
166650at_status=$? at_failed=false
166651$at_check_filter
166652at_fn_diff_devnull "$at_stderr" || at_failed=:
166653echo >>"$at_stdout"; $as_echo "1
166654" | \
166655  $at_diff - "$at_stdout" || at_failed=:
166656at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
166657$at_failed && at_fn_log_failure
166658$at_traceon; }
166659
166660
166661
166662cat >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%%
166695start: "end" {throw new ClassNotFoundException();};
166696%%
166697class Position {}
166698_ATEOF
166699
166700if 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"
166708at_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>&-
166712at_status=$? at_failed=false
166713$at_check_filter
166714echo stderr:; cat "$at_stderr"
166715echo stdout:; cat "$at_stdout"
166716at_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"
166722at_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>&-
166725at_status=$? at_failed=false
166726$at_check_filter
166727echo stderr:; cat "$at_stderr"
166728echo stdout:; cat "$at_stdout"
166729at_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"
166738at_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>&-
166743at_status=$? at_failed=false
166744$at_check_filter
166745at_fn_diff_devnull "$at_stderr" || at_failed=:
166746$at_diff expout "$at_stdout" || at_failed=:
166747at_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"
166756at_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>&-
166761at_status=$? at_failed=false
166762$at_check_filter
166763at_fn_diff_devnull "$at_stderr" || at_failed=:
166764$at_diff expout "$at_stdout" || at_failed=:
166765at_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
166771fi
166772{ set +x
166773$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
166774at_fn_check_prepare_trace "java.at:688"
166775( $at_check_trace; bison YYParser.y
166776) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166777at_status=$? at_failed=false
166778$at_check_filter
166779at_fn_diff_devnull "$at_stderr" || at_failed=:
166780at_fn_diff_devnull "$at_stdout" || at_failed=:
166781at_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"
166788at_fn_check_prepare_trace "java.at:688"
166789( $at_check_trace; grep '[mb]4_' YYParser.y
166790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166791at_status=$? at_failed=false
166792$at_check_filter
166793at_fn_diff_devnull "$at_stderr" || at_failed=:
166794echo stdout:; cat "$at_stdout"
166795at_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"
166808at_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>&-
166811at_status=$? at_failed=false
166812$at_check_filter
166813echo stderr:; cat "$at_stderr"
166814echo stdout:; cat "$at_stdout"
166815at_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"
166822at_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>&-
166825at_status=$? at_failed=false
166826$at_check_filter
166827at_fn_diff_devnull "$at_stderr" || at_failed=:
166828echo >>"$at_stdout"; $as_echo "1
166829" | \
166830  $at_diff - "$at_stdout" || at_failed=:
166831at_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"
166838at_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>&-
166841at_status=$? at_failed=false
166842$at_check_filter
166843at_fn_diff_devnull "$at_stderr" || at_failed=:
166844echo >>"$at_stdout"; $as_echo "1
166845" | \
166846  $at_diff - "$at_stdout" || at_failed=:
166847at_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"
166854at_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>&-
166857at_status=$? at_failed=false
166858$at_check_filter
166859at_fn_diff_devnull "$at_stderr" || at_failed=:
166860echo >>"$at_stdout"; $as_echo "1
166861" | \
166862  $at_diff - "$at_stdout" || at_failed=:
166863at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
166864$at_failed && at_fn_log_failure
166865$at_traceon; }
166866
166867
166868
166869cat >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%%
166902start: "end" {};
166903%%
166904class Position {}
166905_ATEOF
166906
166907if 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"
166915at_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>&-
166919at_status=$? at_failed=false
166920$at_check_filter
166921echo stderr:; cat "$at_stderr"
166922echo stdout:; cat "$at_stdout"
166923at_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"
166929at_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>&-
166932at_status=$? at_failed=false
166933$at_check_filter
166934echo stderr:; cat "$at_stderr"
166935echo stdout:; cat "$at_stdout"
166936at_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"
166945at_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>&-
166950at_status=$? at_failed=false
166951$at_check_filter
166952at_fn_diff_devnull "$at_stderr" || at_failed=:
166953$at_diff expout "$at_stdout" || at_failed=:
166954at_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"
166963at_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>&-
166968at_status=$? at_failed=false
166969$at_check_filter
166970at_fn_diff_devnull "$at_stderr" || at_failed=:
166971$at_diff expout "$at_stdout" || at_failed=:
166972at_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
166978fi
166979{ set +x
166980$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
166981at_fn_check_prepare_trace "java.at:688"
166982( $at_check_trace; bison YYParser.y
166983) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166984at_status=$? at_failed=false
166985$at_check_filter
166986at_fn_diff_devnull "$at_stderr" || at_failed=:
166987at_fn_diff_devnull "$at_stdout" || at_failed=:
166988at_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"
166995at_fn_check_prepare_trace "java.at:688"
166996( $at_check_trace; grep '[mb]4_' YYParser.y
166997) >>"$at_stdout" 2>>"$at_stderr" 5>&-
166998at_status=$? at_failed=false
166999$at_check_filter
167000at_fn_diff_devnull "$at_stderr" || at_failed=:
167001echo stdout:; cat "$at_stdout"
167002at_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"
167015at_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>&-
167018at_status=$? at_failed=false
167019$at_check_filter
167020echo stderr:; cat "$at_stderr"
167021echo stdout:; cat "$at_stdout"
167022at_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"
167029at_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>&-
167032at_status=$? at_failed=false
167033$at_check_filter
167034at_fn_diff_devnull "$at_stderr" || at_failed=:
167035echo >>"$at_stdout"; $as_echo "1
167036" | \
167037  $at_diff - "$at_stdout" || at_failed=:
167038at_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"
167045at_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>&-
167048at_status=$? at_failed=false
167049$at_check_filter
167050at_fn_diff_devnull "$at_stderr" || at_failed=:
167051echo >>"$at_stdout"; $as_echo "1
167052" | \
167053  $at_diff - "$at_stdout" || at_failed=:
167054at_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"
167061at_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>&-
167064at_status=$? at_failed=false
167065$at_check_filter
167066at_fn_diff_devnull "$at_stderr" || at_failed=:
167067echo >>"$at_stdout"; $as_echo "1
167068" | \
167069  $at_diff - "$at_stdout" || at_failed=:
167070at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
167071$at_failed && at_fn_log_failure
167072$at_traceon; }
167073
167074
167075
167076cat >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%%
167109start: "end" {};
167110%%
167111class Position {}
167112_ATEOF
167113
167114if 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"
167122at_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>&-
167126at_status=$? at_failed=false
167127$at_check_filter
167128echo stderr:; cat "$at_stderr"
167129echo stdout:; cat "$at_stdout"
167130at_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"
167136at_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>&-
167139at_status=$? at_failed=false
167140$at_check_filter
167141echo stderr:; cat "$at_stderr"
167142echo stdout:; cat "$at_stdout"
167143at_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"
167152at_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>&-
167157at_status=$? at_failed=false
167158$at_check_filter
167159at_fn_diff_devnull "$at_stderr" || at_failed=:
167160$at_diff expout "$at_stdout" || at_failed=:
167161at_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"
167170at_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>&-
167175at_status=$? at_failed=false
167176$at_check_filter
167177at_fn_diff_devnull "$at_stderr" || at_failed=:
167178$at_diff expout "$at_stdout" || at_failed=:
167179at_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
167185fi
167186{ set +x
167187$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
167188at_fn_check_prepare_trace "java.at:688"
167189( $at_check_trace; bison YYParser.y
167190) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167191at_status=$? at_failed=false
167192$at_check_filter
167193at_fn_diff_devnull "$at_stderr" || at_failed=:
167194at_fn_diff_devnull "$at_stdout" || at_failed=:
167195at_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"
167202at_fn_check_prepare_trace "java.at:688"
167203( $at_check_trace; grep '[mb]4_' YYParser.y
167204) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167205at_status=$? at_failed=false
167206$at_check_filter
167207at_fn_diff_devnull "$at_stderr" || at_failed=:
167208echo stdout:; cat "$at_stdout"
167209at_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"
167222at_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>&-
167225at_status=$? at_failed=false
167226$at_check_filter
167227echo stderr:; cat "$at_stderr"
167228echo stdout:; cat "$at_stdout"
167229at_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"
167236at_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>&-
167239at_status=$? at_failed=false
167240$at_check_filter
167241at_fn_diff_devnull "$at_stderr" || at_failed=:
167242echo >>"$at_stdout"; $as_echo "1
167243" | \
167244  $at_diff - "$at_stdout" || at_failed=:
167245at_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"
167252at_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>&-
167255at_status=$? at_failed=false
167256$at_check_filter
167257at_fn_diff_devnull "$at_stderr" || at_failed=:
167258echo >>"$at_stdout"; $as_echo "1
167259" | \
167260  $at_diff - "$at_stdout" || at_failed=:
167261at_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"
167268at_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>&-
167271at_status=$? at_failed=false
167272$at_check_filter
167273at_fn_diff_devnull "$at_stderr" || at_failed=:
167274echo >>"$at_stdout"; $as_echo "1
167275" | \
167276  $at_diff - "$at_stdout" || at_failed=:
167277at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
167278$at_failed && at_fn_log_failure
167279$at_traceon; }
167280
167281
167282
167283cat >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%%
167316start: "end" {throw new ClassNotFoundException();};
167317%%
167318class Position {}
167319_ATEOF
167320
167321if 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"
167329at_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>&-
167333at_status=$? at_failed=false
167334$at_check_filter
167335echo stderr:; cat "$at_stderr"
167336echo stdout:; cat "$at_stdout"
167337at_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"
167343at_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>&-
167346at_status=$? at_failed=false
167347$at_check_filter
167348echo stderr:; cat "$at_stderr"
167349echo stdout:; cat "$at_stdout"
167350at_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"
167359at_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>&-
167364at_status=$? at_failed=false
167365$at_check_filter
167366at_fn_diff_devnull "$at_stderr" || at_failed=:
167367$at_diff expout "$at_stdout" || at_failed=:
167368at_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"
167377at_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>&-
167382at_status=$? at_failed=false
167383$at_check_filter
167384at_fn_diff_devnull "$at_stderr" || at_failed=:
167385$at_diff expout "$at_stdout" || at_failed=:
167386at_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
167392fi
167393{ set +x
167394$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
167395at_fn_check_prepare_trace "java.at:688"
167396( $at_check_trace; bison YYParser.y
167397) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167398at_status=$? at_failed=false
167399$at_check_filter
167400at_fn_diff_devnull "$at_stderr" || at_failed=:
167401at_fn_diff_devnull "$at_stdout" || at_failed=:
167402at_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"
167409at_fn_check_prepare_trace "java.at:688"
167410( $at_check_trace; grep '[mb]4_' YYParser.y
167411) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167412at_status=$? at_failed=false
167413$at_check_filter
167414at_fn_diff_devnull "$at_stderr" || at_failed=:
167415echo stdout:; cat "$at_stdout"
167416at_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"
167429at_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>&-
167432at_status=$? at_failed=false
167433$at_check_filter
167434echo stderr:; cat "$at_stderr"
167435echo stdout:; cat "$at_stdout"
167436at_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"
167443at_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>&-
167446at_status=$? at_failed=false
167447$at_check_filter
167448at_fn_diff_devnull "$at_stderr" || at_failed=:
167449echo >>"$at_stdout"; $as_echo "1
167450" | \
167451  $at_diff - "$at_stdout" || at_failed=:
167452at_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"
167459at_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>&-
167462at_status=$? at_failed=false
167463$at_check_filter
167464at_fn_diff_devnull "$at_stderr" || at_failed=:
167465echo >>"$at_stdout"; $as_echo "1
167466" | \
167467  $at_diff - "$at_stdout" || at_failed=:
167468at_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"
167475at_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>&-
167478at_status=$? at_failed=false
167479$at_check_filter
167480at_fn_diff_devnull "$at_stderr" || at_failed=:
167481echo >>"$at_stdout"; $as_echo "1
167482" | \
167483  $at_diff - "$at_stdout" || at_failed=:
167484at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
167485$at_failed && at_fn_log_failure
167486$at_traceon; }
167487
167488
167489
167490cat >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%%
167523start: "end" {throw new ClassNotFoundException();};
167524%%
167525class Position {}
167526_ATEOF
167527
167528if 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"
167536at_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>&-
167540at_status=$? at_failed=false
167541$at_check_filter
167542echo stderr:; cat "$at_stderr"
167543echo stdout:; cat "$at_stdout"
167544at_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"
167550at_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>&-
167553at_status=$? at_failed=false
167554$at_check_filter
167555echo stderr:; cat "$at_stderr"
167556echo stdout:; cat "$at_stdout"
167557at_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"
167566at_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>&-
167571at_status=$? at_failed=false
167572$at_check_filter
167573at_fn_diff_devnull "$at_stderr" || at_failed=:
167574$at_diff expout "$at_stdout" || at_failed=:
167575at_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"
167584at_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>&-
167589at_status=$? at_failed=false
167590$at_check_filter
167591at_fn_diff_devnull "$at_stderr" || at_failed=:
167592$at_diff expout "$at_stdout" || at_failed=:
167593at_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
167599fi
167600{ set +x
167601$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
167602at_fn_check_prepare_trace "java.at:688"
167603( $at_check_trace; bison YYParser.y
167604) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167605at_status=$? at_failed=false
167606$at_check_filter
167607at_fn_diff_devnull "$at_stderr" || at_failed=:
167608at_fn_diff_devnull "$at_stdout" || at_failed=:
167609at_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"
167616at_fn_check_prepare_trace "java.at:688"
167617( $at_check_trace; grep '[mb]4_' YYParser.y
167618) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167619at_status=$? at_failed=false
167620$at_check_filter
167621at_fn_diff_devnull "$at_stderr" || at_failed=:
167622echo stdout:; cat "$at_stdout"
167623at_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"
167636at_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>&-
167639at_status=$? at_failed=false
167640$at_check_filter
167641echo stderr:; cat "$at_stderr"
167642echo stdout:; cat "$at_stdout"
167643at_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"
167650at_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>&-
167653at_status=$? at_failed=false
167654$at_check_filter
167655at_fn_diff_devnull "$at_stderr" || at_failed=:
167656echo >>"$at_stdout"; $as_echo "1
167657" | \
167658  $at_diff - "$at_stdout" || at_failed=:
167659at_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"
167666at_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>&-
167669at_status=$? at_failed=false
167670$at_check_filter
167671at_fn_diff_devnull "$at_stderr" || at_failed=:
167672echo >>"$at_stdout"; $as_echo "1
167673" | \
167674  $at_diff - "$at_stdout" || at_failed=:
167675at_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"
167682at_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>&-
167685at_status=$? at_failed=false
167686$at_check_filter
167687at_fn_diff_devnull "$at_stderr" || at_failed=:
167688echo >>"$at_stdout"; $as_echo "1
167689" | \
167690  $at_diff - "$at_stdout" || at_failed=:
167691at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
167692$at_failed && at_fn_log_failure
167693$at_traceon; }
167694
167695
167696
167697cat >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%%
167730start: "end" {};
167731%%
167732class Position {}
167733_ATEOF
167734
167735if 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"
167743at_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>&-
167747at_status=$? at_failed=false
167748$at_check_filter
167749echo stderr:; cat "$at_stderr"
167750echo stdout:; cat "$at_stdout"
167751at_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"
167757at_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>&-
167760at_status=$? at_failed=false
167761$at_check_filter
167762echo stderr:; cat "$at_stderr"
167763echo stdout:; cat "$at_stdout"
167764at_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"
167773at_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>&-
167778at_status=$? at_failed=false
167779$at_check_filter
167780at_fn_diff_devnull "$at_stderr" || at_failed=:
167781$at_diff expout "$at_stdout" || at_failed=:
167782at_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"
167791at_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>&-
167796at_status=$? at_failed=false
167797$at_check_filter
167798at_fn_diff_devnull "$at_stderr" || at_failed=:
167799$at_diff expout "$at_stdout" || at_failed=:
167800at_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
167806fi
167807{ set +x
167808$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
167809at_fn_check_prepare_trace "java.at:688"
167810( $at_check_trace; bison YYParser.y
167811) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167812at_status=$? at_failed=false
167813$at_check_filter
167814at_fn_diff_devnull "$at_stderr" || at_failed=:
167815at_fn_diff_devnull "$at_stdout" || at_failed=:
167816at_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"
167823at_fn_check_prepare_trace "java.at:688"
167824( $at_check_trace; grep '[mb]4_' YYParser.y
167825) >>"$at_stdout" 2>>"$at_stderr" 5>&-
167826at_status=$? at_failed=false
167827$at_check_filter
167828at_fn_diff_devnull "$at_stderr" || at_failed=:
167829echo stdout:; cat "$at_stdout"
167830at_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"
167843at_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>&-
167846at_status=$? at_failed=false
167847$at_check_filter
167848echo stderr:; cat "$at_stderr"
167849echo stdout:; cat "$at_stdout"
167850at_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"
167857at_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>&-
167860at_status=$? at_failed=false
167861$at_check_filter
167862at_fn_diff_devnull "$at_stderr" || at_failed=:
167863echo >>"$at_stdout"; $as_echo "1
167864" | \
167865  $at_diff - "$at_stdout" || at_failed=:
167866at_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"
167873at_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>&-
167876at_status=$? at_failed=false
167877$at_check_filter
167878at_fn_diff_devnull "$at_stderr" || at_failed=:
167879echo >>"$at_stdout"; $as_echo "1
167880" | \
167881  $at_diff - "$at_stdout" || at_failed=:
167882at_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"
167889at_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>&-
167892at_status=$? at_failed=false
167893$at_check_filter
167894at_fn_diff_devnull "$at_stderr" || at_failed=:
167895echo >>"$at_stdout"; $as_echo "1
167896" | \
167897  $at_diff - "$at_stdout" || at_failed=:
167898at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
167899$at_failed && at_fn_log_failure
167900$at_traceon; }
167901
167902
167903
167904cat >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%%
167937start: "end" {};
167938%%
167939class Position {}
167940_ATEOF
167941
167942if 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"
167950at_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>&-
167954at_status=$? at_failed=false
167955$at_check_filter
167956echo stderr:; cat "$at_stderr"
167957echo stdout:; cat "$at_stdout"
167958at_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"
167964at_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>&-
167967at_status=$? at_failed=false
167968$at_check_filter
167969echo stderr:; cat "$at_stderr"
167970echo stdout:; cat "$at_stdout"
167971at_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"
167980at_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>&-
167985at_status=$? at_failed=false
167986$at_check_filter
167987at_fn_diff_devnull "$at_stderr" || at_failed=:
167988$at_diff expout "$at_stdout" || at_failed=:
167989at_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"
167998at_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>&-
168003at_status=$? at_failed=false
168004$at_check_filter
168005at_fn_diff_devnull "$at_stderr" || at_failed=:
168006$at_diff expout "$at_stdout" || at_failed=:
168007at_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
168013fi
168014{ set +x
168015$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
168016at_fn_check_prepare_trace "java.at:688"
168017( $at_check_trace; bison YYParser.y
168018) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168019at_status=$? at_failed=false
168020$at_check_filter
168021at_fn_diff_devnull "$at_stderr" || at_failed=:
168022at_fn_diff_devnull "$at_stdout" || at_failed=:
168023at_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"
168030at_fn_check_prepare_trace "java.at:688"
168031( $at_check_trace; grep '[mb]4_' YYParser.y
168032) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168033at_status=$? at_failed=false
168034$at_check_filter
168035at_fn_diff_devnull "$at_stderr" || at_failed=:
168036echo stdout:; cat "$at_stdout"
168037at_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"
168050at_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>&-
168053at_status=$? at_failed=false
168054$at_check_filter
168055echo stderr:; cat "$at_stderr"
168056echo stdout:; cat "$at_stdout"
168057at_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"
168064at_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>&-
168067at_status=$? at_failed=false
168068$at_check_filter
168069at_fn_diff_devnull "$at_stderr" || at_failed=:
168070echo >>"$at_stdout"; $as_echo "1
168071" | \
168072  $at_diff - "$at_stdout" || at_failed=:
168073at_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"
168080at_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>&-
168083at_status=$? at_failed=false
168084$at_check_filter
168085at_fn_diff_devnull "$at_stderr" || at_failed=:
168086echo >>"$at_stdout"; $as_echo "1
168087" | \
168088  $at_diff - "$at_stdout" || at_failed=:
168089at_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"
168096at_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>&-
168099at_status=$? at_failed=false
168100$at_check_filter
168101at_fn_diff_devnull "$at_stderr" || at_failed=:
168102echo >>"$at_stdout"; $as_echo "1
168103" | \
168104  $at_diff - "$at_stdout" || at_failed=:
168105at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
168106$at_failed && at_fn_log_failure
168107$at_traceon; }
168108
168109
168110
168111cat >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%%
168144start: "end" {throw new ClassNotFoundException();};
168145%%
168146class Position {}
168147_ATEOF
168148
168149if 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"
168157at_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>&-
168161at_status=$? at_failed=false
168162$at_check_filter
168163echo stderr:; cat "$at_stderr"
168164echo stdout:; cat "$at_stdout"
168165at_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"
168171at_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>&-
168174at_status=$? at_failed=false
168175$at_check_filter
168176echo stderr:; cat "$at_stderr"
168177echo stdout:; cat "$at_stdout"
168178at_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"
168187at_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>&-
168192at_status=$? at_failed=false
168193$at_check_filter
168194at_fn_diff_devnull "$at_stderr" || at_failed=:
168195$at_diff expout "$at_stdout" || at_failed=:
168196at_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"
168205at_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>&-
168210at_status=$? at_failed=false
168211$at_check_filter
168212at_fn_diff_devnull "$at_stderr" || at_failed=:
168213$at_diff expout "$at_stdout" || at_failed=:
168214at_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
168220fi
168221{ set +x
168222$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
168223at_fn_check_prepare_trace "java.at:688"
168224( $at_check_trace; bison YYParser.y
168225) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168226at_status=$? at_failed=false
168227$at_check_filter
168228at_fn_diff_devnull "$at_stderr" || at_failed=:
168229at_fn_diff_devnull "$at_stdout" || at_failed=:
168230at_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"
168237at_fn_check_prepare_trace "java.at:688"
168238( $at_check_trace; grep '[mb]4_' YYParser.y
168239) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168240at_status=$? at_failed=false
168241$at_check_filter
168242at_fn_diff_devnull "$at_stderr" || at_failed=:
168243echo stdout:; cat "$at_stdout"
168244at_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"
168257at_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>&-
168260at_status=$? at_failed=false
168261$at_check_filter
168262echo stderr:; cat "$at_stderr"
168263echo stdout:; cat "$at_stdout"
168264at_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"
168271at_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>&-
168274at_status=$? at_failed=false
168275$at_check_filter
168276at_fn_diff_devnull "$at_stderr" || at_failed=:
168277echo >>"$at_stdout"; $as_echo "1
168278" | \
168279  $at_diff - "$at_stdout" || at_failed=:
168280at_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"
168287at_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>&-
168290at_status=$? at_failed=false
168291$at_check_filter
168292at_fn_diff_devnull "$at_stderr" || at_failed=:
168293echo >>"$at_stdout"; $as_echo "1
168294" | \
168295  $at_diff - "$at_stdout" || at_failed=:
168296at_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"
168303at_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>&-
168306at_status=$? at_failed=false
168307$at_check_filter
168308at_fn_diff_devnull "$at_stderr" || at_failed=:
168309echo >>"$at_stdout"; $as_echo "1
168310" | \
168311  $at_diff - "$at_stdout" || at_failed=:
168312at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
168313$at_failed && at_fn_log_failure
168314$at_traceon; }
168315
168316
168317
168318cat >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%%
168351start: "end" {throw new ClassNotFoundException();};
168352%%
168353class Position {}
168354_ATEOF
168355
168356if 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"
168364at_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>&-
168368at_status=$? at_failed=false
168369$at_check_filter
168370echo stderr:; cat "$at_stderr"
168371echo stdout:; cat "$at_stdout"
168372at_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"
168378at_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>&-
168381at_status=$? at_failed=false
168382$at_check_filter
168383echo stderr:; cat "$at_stderr"
168384echo stdout:; cat "$at_stdout"
168385at_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"
168394at_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>&-
168399at_status=$? at_failed=false
168400$at_check_filter
168401at_fn_diff_devnull "$at_stderr" || at_failed=:
168402$at_diff expout "$at_stdout" || at_failed=:
168403at_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"
168412at_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>&-
168417at_status=$? at_failed=false
168418$at_check_filter
168419at_fn_diff_devnull "$at_stderr" || at_failed=:
168420$at_diff expout "$at_stdout" || at_failed=:
168421at_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
168427fi
168428{ set +x
168429$as_echo "$at_srcdir/java.at:688: bison YYParser.y"
168430at_fn_check_prepare_trace "java.at:688"
168431( $at_check_trace; bison YYParser.y
168432) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168433at_status=$? at_failed=false
168434$at_check_filter
168435at_fn_diff_devnull "$at_stderr" || at_failed=:
168436at_fn_diff_devnull "$at_stdout" || at_failed=:
168437at_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"
168444at_fn_check_prepare_trace "java.at:688"
168445( $at_check_trace; grep '[mb]4_' YYParser.y
168446) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168447at_status=$? at_failed=false
168448$at_check_filter
168449at_fn_diff_devnull "$at_stderr" || at_failed=:
168450echo stdout:; cat "$at_stdout"
168451at_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"
168464at_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>&-
168467at_status=$? at_failed=false
168468$at_check_filter
168469echo stderr:; cat "$at_stderr"
168470echo stdout:; cat "$at_stdout"
168471at_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"
168478at_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>&-
168481at_status=$? at_failed=false
168482$at_check_filter
168483at_fn_diff_devnull "$at_stderr" || at_failed=:
168484echo >>"$at_stdout"; $as_echo "1
168485" | \
168486  $at_diff - "$at_stdout" || at_failed=:
168487at_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"
168494at_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>&-
168497at_status=$? at_failed=false
168498$at_check_filter
168499at_fn_diff_devnull "$at_stderr" || at_failed=:
168500echo >>"$at_stdout"; $as_echo "1
168501" | \
168502  $at_diff - "$at_stdout" || at_failed=:
168503at_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"
168510at_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>&-
168513at_status=$? at_failed=false
168514$at_check_filter
168515at_fn_diff_devnull "$at_stderr" || at_failed=:
168516echo >>"$at_stdout"; $as_echo "1
168517" | \
168518  $at_diff - "$at_stdout" || at_failed=:
168519at_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
168529read at_status <"$at_status_file"
168530#AT_STOP_319
168531#AT_START_320
168532at_fn_group_banner 320 'java.at:717' \
168533  "Java stype, position_class and location_class" "  " 20
168534at_xfail=no
168535(
168536  $as_echo "320. $at_setup_line: testing $at_desc ..."
168537  $at_traceon
168538
168539
168540
168541cat >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%%
168555start: "end" {$$ = $<java.awt.Color>1;};
168556%%
168557class MyPos {}
168558_ATEOF
168559
168560if 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"
168568at_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>&-
168572at_status=$? at_failed=false
168573$at_check_filter
168574echo stderr:; cat "$at_stderr"
168575echo stdout:; cat "$at_stdout"
168576at_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"
168582at_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>&-
168585at_status=$? at_failed=false
168586$at_check_filter
168587echo stderr:; cat "$at_stderr"
168588echo stdout:; cat "$at_stdout"
168589at_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"
168598at_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>&-
168603at_status=$? at_failed=false
168604$at_check_filter
168605at_fn_diff_devnull "$at_stderr" || at_failed=:
168606$at_diff expout "$at_stdout" || at_failed=:
168607at_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"
168616at_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>&-
168621at_status=$? at_failed=false
168622$at_check_filter
168623at_fn_diff_devnull "$at_stderr" || at_failed=:
168624$at_diff expout "$at_stdout" || at_failed=:
168625at_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
168631fi
168632{ set +x
168633$as_echo "$at_srcdir/java.at:719: bison YYParser.y"
168634at_fn_check_prepare_trace "java.at:719"
168635( $at_check_trace; bison YYParser.y
168636) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168637at_status=$? at_failed=false
168638$at_check_filter
168639at_fn_diff_devnull "$at_stderr" || at_failed=:
168640at_fn_diff_devnull "$at_stdout" || at_failed=:
168641at_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"
168648at_fn_check_prepare_trace "java.at:719"
168649( $at_check_trace; grep '[mb]4_' YYParser.y
168650) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168651at_status=$? at_failed=false
168652$at_check_filter
168653at_fn_diff_devnull "$at_stderr" || at_failed=:
168654echo stdout:; cat "$at_stdout"
168655at_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"
168668at_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>&-
168671at_status=$? at_failed=false
168672$at_check_filter
168673echo stderr:; cat "$at_stderr"
168674echo stdout:; cat "$at_stdout"
168675at_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"
168682at_fn_check_prepare_trace "java.at:725"
168683( $at_check_trace; grep 'java.awt.Color' YYParser.java
168684) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168685at_status=$? at_failed=false
168686$at_check_filter
168687at_fn_diff_devnull "$at_stderr" || at_failed=:
168688echo stdout:; cat "$at_stdout"
168689at_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'"
168695at_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>&-
168698at_status=$? at_failed=false
168699$at_check_filter
168700at_fn_diff_devnull "$at_stderr" || at_failed=:
168701echo stdout:; cat "$at_stdout"
168702at_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'"
168708at_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>&-
168711at_status=$? at_failed=false
168712$at_check_filter
168713at_fn_diff_devnull "$at_stderr" || at_failed=:
168714echo stdout:; cat "$at_stdout"
168715at_fn_check_status 1 $at_status "$at_srcdir/java.at:727"
168716$at_failed && at_fn_log_failure
168717$at_traceon; }
168718
168719
168720
168721cat >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%%
168756start: "end" {$$ = $<java.awt.Color>1;};
168757%%
168758class MyPos {}
168759_ATEOF
168760
168761if 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"
168769at_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>&-
168773at_status=$? at_failed=false
168774$at_check_filter
168775echo stderr:; cat "$at_stderr"
168776echo stdout:; cat "$at_stdout"
168777at_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"
168783at_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>&-
168786at_status=$? at_failed=false
168787$at_check_filter
168788echo stderr:; cat "$at_stderr"
168789echo stdout:; cat "$at_stdout"
168790at_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"
168799at_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>&-
168804at_status=$? at_failed=false
168805$at_check_filter
168806at_fn_diff_devnull "$at_stderr" || at_failed=:
168807$at_diff expout "$at_stdout" || at_failed=:
168808at_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"
168817at_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>&-
168822at_status=$? at_failed=false
168823$at_check_filter
168824at_fn_diff_devnull "$at_stderr" || at_failed=:
168825$at_diff expout "$at_stdout" || at_failed=:
168826at_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
168832fi
168833{ set +x
168834$as_echo "$at_srcdir/java.at:729: bison YYParser.y"
168835at_fn_check_prepare_trace "java.at:729"
168836( $at_check_trace; bison YYParser.y
168837) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168838at_status=$? at_failed=false
168839$at_check_filter
168840at_fn_diff_devnull "$at_stderr" || at_failed=:
168841at_fn_diff_devnull "$at_stdout" || at_failed=:
168842at_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"
168849at_fn_check_prepare_trace "java.at:729"
168850( $at_check_trace; grep '[mb]4_' YYParser.y
168851) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168852at_status=$? at_failed=false
168853$at_check_filter
168854at_fn_diff_devnull "$at_stderr" || at_failed=:
168855echo stdout:; cat "$at_stdout"
168856at_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"
168869at_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>&-
168872at_status=$? at_failed=false
168873$at_check_filter
168874echo stderr:; cat "$at_stderr"
168875echo stdout:; cat "$at_stdout"
168876at_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"
168883at_fn_check_prepare_trace "java.at:737"
168884( $at_check_trace; grep 'java.awt.Color' YYParser.java
168885) >>"$at_stdout" 2>>"$at_stderr" 5>&-
168886at_status=$? at_failed=false
168887$at_check_filter
168888at_fn_diff_devnull "$at_stderr" || at_failed=:
168889echo stdout:; cat "$at_stdout"
168890at_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'"
168896at_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>&-
168899at_status=$? at_failed=false
168900$at_check_filter
168901at_fn_diff_devnull "$at_stderr" || at_failed=:
168902echo stdout:; cat "$at_stdout"
168903at_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'"
168909at_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>&-
168912at_status=$? at_failed=false
168913$at_check_filter
168914at_fn_diff_devnull "$at_stderr" || at_failed=:
168915echo stdout:; cat "$at_stdout"
168916at_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
168924read at_status <"$at_status_file"
168925#AT_STOP_320
168926#AT_START_321
168927at_fn_group_banner 321 'java.at:748' \
168928  "Java syntax error handling without error token" " " 20
168929at_xfail=no
168930(
168931  $as_echo "321. $at_setup_line: testing $at_desc ..."
168932  $at_traceon
168933
168934
168935cat >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%%
168981input:
168982  'a' 'a'
168983;
168984_ATEOF
168985
168986if 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"
168994at_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>&-
168998at_status=$? at_failed=false
168999$at_check_filter
169000echo stderr:; cat "$at_stderr"
169001echo stdout:; cat "$at_stdout"
169002at_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"
169008at_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>&-
169011at_status=$? at_failed=false
169012$at_check_filter
169013echo stderr:; cat "$at_stderr"
169014echo stdout:; cat "$at_stdout"
169015at_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"
169024at_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>&-
169029at_status=$? at_failed=false
169030$at_check_filter
169031at_fn_diff_devnull "$at_stderr" || at_failed=:
169032$at_diff expout "$at_stdout" || at_failed=:
169033at_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"
169042at_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>&-
169047at_status=$? at_failed=false
169048$at_check_filter
169049at_fn_diff_devnull "$at_stderr" || at_failed=:
169050$at_diff expout "$at_stdout" || at_failed=:
169051at_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
169057fi
169058{ set +x
169059$as_echo "$at_srcdir/java.at:799: bison YYParser.y"
169060at_fn_check_prepare_trace "java.at:799"
169061( $at_check_trace; bison YYParser.y
169062) >>"$at_stdout" 2>>"$at_stderr" 5>&-
169063at_status=$? at_failed=false
169064$at_check_filter
169065at_fn_diff_devnull "$at_stderr" || at_failed=:
169066at_fn_diff_devnull "$at_stdout" || at_failed=:
169067at_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"
169081at_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>&-
169084at_status=$? at_failed=false
169085$at_check_filter
169086echo stderr:; cat "$at_stderr"
169087echo stdout:; cat "$at_stdout"
169088at_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"
169094at_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>&-
169097at_status=$? at_failed=false
169098$at_check_filter
169099at_fn_diff_devnull "$at_stderr" || at_failed=:
169100at_fn_diff_devnull "$at_stdout" || at_failed=:
169101at_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"
169107at_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>&-
169110at_status=$? at_failed=false
169111$at_check_filter
169112echo >>"$at_stderr"; $as_echo "syntax error
169113" | \
169114  $at_diff - "$at_stderr" || at_failed=:
169115at_fn_diff_devnull "$at_stdout" || at_failed=:
169116at_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"
169122at_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>&-
169125at_status=$? at_failed=false
169126$at_check_filter
169127echo >>"$at_stderr"; $as_echo "syntax error
169128" | \
169129  $at_diff - "$at_stderr" || at_failed=:
169130at_fn_diff_devnull "$at_stdout" || at_failed=:
169131at_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
169139read at_status <"$at_status_file"
169140#AT_STOP_321
169141#AT_START_322
169142at_fn_group_banner 322 'cxx-type.at:394' \
169143  "GLR: Resolve ambiguity, impure, no locations" "   " 21
169144at_xfail=no
169145(
169146  $as_echo "322. $at_setup_line: testing $at_desc ..."
169147  $at_traceon
169148
169149
169150
169151cat >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
169212prog :
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
169222stmt : expr ';'  %dprec 1     { $$ = $1; }
169223     | decl      %dprec 2
169224     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
169225     | '@'              { YYACCEPT; }
169226     ;
169227
169228expr : 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
169235decl : 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
169242declarator : 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
169254int
169255main (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.  */
169265static
169266void yyerror ( const char *msg)
169267{
169268  fprintf (stderr, "%s\n", msg);
169269}
169270
169271int 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
169337static Node *
169338new_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
169356static Node *
169357new_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
169366static void
169367free_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
169386static char *
169387node_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
169421cat >test-input <<'_ATEOF'
169422
169423
169424z + q;
169425
169426T x;
169427
169428T x = y;
169429
169430x = y;
169431
169432T (x) + y;
169433
169434T (x);
169435
169436T (y) = z + q;
169437
169438T (y y) = z + q;
169439
169440z + q;
169441
169442@
169443
169444This is total garbage, but it should be ignored.
169445_ATEOF
169446
169447
169448if 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"
169456at_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>&-
169460at_status=$? at_failed=false
169461$at_check_filter
169462echo stderr:; cat "$at_stderr"
169463echo stdout:; cat "$at_stdout"
169464at_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"
169470at_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>&-
169473at_status=$? at_failed=false
169474$at_check_filter
169475echo stderr:; cat "$at_stderr"
169476echo stdout:; cat "$at_stdout"
169477at_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"
169486at_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>&-
169491at_status=$? at_failed=false
169492$at_check_filter
169493at_fn_diff_devnull "$at_stderr" || at_failed=:
169494$at_diff expout "$at_stdout" || at_failed=:
169495at_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"
169504at_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>&-
169509at_status=$? at_failed=false
169510$at_check_filter
169511at_fn_diff_devnull "$at_stderr" || at_failed=:
169512$at_diff expout "$at_stdout" || at_failed=:
169513at_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
169519fi
169520{ set +x
169521$as_echo "$at_srcdir/cxx-type.at:395: bison -o types.c types.y"
169522at_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>&-
169525at_status=$? at_failed=false
169526$at_check_filter
169527echo stderr:; cat "$at_stderr"
169528at_fn_diff_devnull "$at_stdout" || at_failed=:
169529at_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"
169536at_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>&-
169539at_status=$? at_failed=false
169540$at_check_filter
169541echo stderr:; cat "$at_stderr"
169542echo stdout:; cat "$at_stdout"
169543at_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"
169549at_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>&-
169552at_status=$? at_failed=false
169553$at_check_filter
169554echo stderr:; cat "$at_stderr"
169555echo stdout:; cat "$at_stdout"
169556at_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"
169564at_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>&-
169567at_status=$? at_failed=false
169568$at_check_filter
169569echo stderr:; tee stderr <"$at_stderr"
169570echo >>"$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=:
169581at_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"
169587at_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>&-
169590at_status=$? at_failed=false
169591$at_check_filter
169592echo >>"$at_stderr"; $as_echo "syntax error
169593" | \
169594  $at_diff - "$at_stderr" || at_failed=:
169595at_fn_diff_devnull "$at_stdout" || at_failed=:
169596at_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
169604read at_status <"$at_status_file"
169605#AT_STOP_322
169606#AT_START_323
169607at_fn_group_banner 323 'cxx-type.at:401' \
169608  "GLR: Resolve ambiguity, impure, locations" "      " 21
169609at_xfail=no
169610(
169611  $as_echo "323. $at_setup_line: testing $at_desc ..."
169612  $at_traceon
169613
169614
169615
169616cat >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
169677prog :
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
169690stmt : expr ';'  %dprec 1     { $$ = $1; }
169691     | decl      %dprec 2
169692     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
169693     | '@'              { YYACCEPT; }
169694     ;
169695
169696expr : 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
169703decl : 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
169710declarator : 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
169722int
169723main (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.  */
169733static
169734void yyerror ( const char *msg)
169735{
169736  YY_LOCATION_PRINT (stderr, (yylloc));
169737  fprintf (stderr, ": ");
169738  fprintf (stderr, "%s\n", msg);
169739}
169740
169741int 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
169810static Node *
169811new_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
169829static Node *
169830new_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
169839static void
169840free_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
169859static char *
169860node_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
169894cat >test-input <<'_ATEOF'
169895
169896
169897z + q;
169898
169899T x;
169900
169901T x = y;
169902
169903x = y;
169904
169905T (x) + y;
169906
169907T (x);
169908
169909T (y) = z + q;
169910
169911T (y y) = z + q;
169912
169913z + q;
169914
169915@
169916
169917This is total garbage, but it should be ignored.
169918_ATEOF
169919
169920
169921if 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"
169929at_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>&-
169933at_status=$? at_failed=false
169934$at_check_filter
169935echo stderr:; cat "$at_stderr"
169936echo stdout:; cat "$at_stdout"
169937at_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"
169943at_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>&-
169946at_status=$? at_failed=false
169947$at_check_filter
169948echo stderr:; cat "$at_stderr"
169949echo stdout:; cat "$at_stdout"
169950at_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"
169959at_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>&-
169964at_status=$? at_failed=false
169965$at_check_filter
169966at_fn_diff_devnull "$at_stderr" || at_failed=:
169967$at_diff expout "$at_stdout" || at_failed=:
169968at_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"
169977at_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>&-
169982at_status=$? at_failed=false
169983$at_check_filter
169984at_fn_diff_devnull "$at_stderr" || at_failed=:
169985$at_diff expout "$at_stdout" || at_failed=:
169986at_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
169992fi
169993{ set +x
169994$as_echo "$at_srcdir/cxx-type.at:402: bison -o types.c types.y"
169995at_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>&-
169998at_status=$? at_failed=false
169999$at_check_filter
170000echo stderr:; cat "$at_stderr"
170001at_fn_diff_devnull "$at_stdout" || at_failed=:
170002at_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"
170009at_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>&-
170012at_status=$? at_failed=false
170013$at_check_filter
170014echo stderr:; cat "$at_stderr"
170015echo stdout:; cat "$at_stdout"
170016at_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"
170022at_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>&-
170025at_status=$? at_failed=false
170026$at_check_filter
170027echo stderr:; cat "$at_stderr"
170028echo stdout:; cat "$at_stdout"
170029at_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"
170037at_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>&-
170040at_status=$? at_failed=false
170041$at_check_filter
170042echo stderr:; tee stderr <"$at_stderr"
170043echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
1700445.0-5.3: <declare>(T,x)
1700457.0-7.7: <init-declare>(T,x,y)
1700469.0-9.5: =(x,y)
17004711.0-11.9: +(<cast>(x,T),y)
17004813.0-13.5: <declare>(T,x)
17004915.0-15.13: <init-declare>(T,y,+(z,q))
17005017.0-17.15: <error>
17005119.0-19.5: +(z,q)
170052" | \
170053  $at_diff - "$at_stdout" || at_failed=:
170054at_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"
170060at_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>&-
170063at_status=$? at_failed=false
170064$at_check_filter
170065echo >>"$at_stderr"; $as_echo "17.5: syntax error
170066" | \
170067  $at_diff - "$at_stderr" || at_failed=:
170068at_fn_diff_devnull "$at_stdout" || at_failed=:
170069at_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
170077read at_status <"$at_status_file"
170078#AT_STOP_323
170079#AT_START_324
170080at_fn_group_banner 324 'cxx-type.at:407' \
170081  "GLR: Resolve ambiguity, pure, no locations" "     " 21
170082at_xfail=no
170083(
170084  $as_echo "324. $at_setup_line: testing $at_desc ..."
170085  $at_traceon
170086
170087
170088
170089cat >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
170150prog :
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
170160stmt : expr ';'  %dprec 1     { $$ = $1; }
170161     | decl      %dprec 2
170162     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
170163     | '@'              { YYACCEPT; }
170164     ;
170165
170166expr : 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
170173decl : 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
170180declarator : 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
170192int
170193main (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.  */
170203static
170204void yyerror ( const char *msg)
170205{
170206  fprintf (stderr, "%s\n", msg);
170207}
170208
170209int 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
170275static Node *
170276new_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
170294static Node *
170295new_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
170304static void
170305free_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
170324static char *
170325node_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
170359cat >test-input <<'_ATEOF'
170360
170361
170362z + q;
170363
170364T x;
170365
170366T x = y;
170367
170368x = y;
170369
170370T (x) + y;
170371
170372T (x);
170373
170374T (y) = z + q;
170375
170376T (y y) = z + q;
170377
170378z + q;
170379
170380@
170381
170382This is total garbage, but it should be ignored.
170383_ATEOF
170384
170385
170386if 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"
170394at_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>&-
170398at_status=$? at_failed=false
170399$at_check_filter
170400echo stderr:; cat "$at_stderr"
170401echo stdout:; cat "$at_stdout"
170402at_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"
170408at_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>&-
170411at_status=$? at_failed=false
170412$at_check_filter
170413echo stderr:; cat "$at_stderr"
170414echo stdout:; cat "$at_stdout"
170415at_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"
170424at_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>&-
170429at_status=$? at_failed=false
170430$at_check_filter
170431at_fn_diff_devnull "$at_stderr" || at_failed=:
170432$at_diff expout "$at_stdout" || at_failed=:
170433at_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"
170442at_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>&-
170447at_status=$? at_failed=false
170448$at_check_filter
170449at_fn_diff_devnull "$at_stderr" || at_failed=:
170450$at_diff expout "$at_stdout" || at_failed=:
170451at_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
170457fi
170458{ set +x
170459$as_echo "$at_srcdir/cxx-type.at:408: bison -o types.c types.y"
170460at_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>&-
170463at_status=$? at_failed=false
170464$at_check_filter
170465echo stderr:; cat "$at_stderr"
170466at_fn_diff_devnull "$at_stdout" || at_failed=:
170467at_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"
170474at_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>&-
170477at_status=$? at_failed=false
170478$at_check_filter
170479echo stderr:; cat "$at_stderr"
170480echo stdout:; cat "$at_stdout"
170481at_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"
170487at_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>&-
170490at_status=$? at_failed=false
170491$at_check_filter
170492echo stderr:; cat "$at_stderr"
170493echo stdout:; cat "$at_stdout"
170494at_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"
170502at_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>&-
170505at_status=$? at_failed=false
170506$at_check_filter
170507echo stderr:; tee stderr <"$at_stderr"
170508echo >>"$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=:
170519at_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"
170525at_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>&-
170528at_status=$? at_failed=false
170529$at_check_filter
170530echo >>"$at_stderr"; $as_echo "syntax error
170531" | \
170532  $at_diff - "$at_stderr" || at_failed=:
170533at_fn_diff_devnull "$at_stdout" || at_failed=:
170534at_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
170542read at_status <"$at_status_file"
170543#AT_STOP_324
170544#AT_START_325
170545at_fn_group_banner 325 'cxx-type.at:414' \
170546  "GLR: Resolve ambiguity, pure, locations" "        " 21
170547at_xfail=no
170548(
170549  $as_echo "325. $at_setup_line: testing $at_desc ..."
170550  $at_traceon
170551
170552
170553
170554cat >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
170615prog :
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
170628stmt : expr ';'  %dprec 1     { $$ = $1; }
170629     | decl      %dprec 2
170630     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
170631     | '@'              { YYACCEPT; }
170632     ;
170633
170634expr : 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
170641decl : 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
170648declarator : 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
170660int
170661main (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.  */
170671static
170672void 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
170679int 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
170748static Node *
170749new_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
170767static Node *
170768new_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
170777static void
170778free_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
170797static char *
170798node_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
170832cat >test-input <<'_ATEOF'
170833
170834
170835z + q;
170836
170837T x;
170838
170839T x = y;
170840
170841x = y;
170842
170843T (x) + y;
170844
170845T (x);
170846
170847T (y) = z + q;
170848
170849T (y y) = z + q;
170850
170851z + q;
170852
170853@
170854
170855This is total garbage, but it should be ignored.
170856_ATEOF
170857
170858
170859if 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"
170867at_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>&-
170871at_status=$? at_failed=false
170872$at_check_filter
170873echo stderr:; cat "$at_stderr"
170874echo stdout:; cat "$at_stdout"
170875at_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"
170881at_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>&-
170884at_status=$? at_failed=false
170885$at_check_filter
170886echo stderr:; cat "$at_stderr"
170887echo stdout:; cat "$at_stdout"
170888at_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"
170897at_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>&-
170902at_status=$? at_failed=false
170903$at_check_filter
170904at_fn_diff_devnull "$at_stderr" || at_failed=:
170905$at_diff expout "$at_stdout" || at_failed=:
170906at_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"
170915at_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>&-
170920at_status=$? at_failed=false
170921$at_check_filter
170922at_fn_diff_devnull "$at_stderr" || at_failed=:
170923$at_diff expout "$at_stdout" || at_failed=:
170924at_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
170930fi
170931{ set +x
170932$as_echo "$at_srcdir/cxx-type.at:415: bison -o types.c types.y"
170933at_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>&-
170936at_status=$? at_failed=false
170937$at_check_filter
170938echo stderr:; cat "$at_stderr"
170939at_fn_diff_devnull "$at_stdout" || at_failed=:
170940at_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"
170947at_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>&-
170950at_status=$? at_failed=false
170951$at_check_filter
170952echo stderr:; cat "$at_stderr"
170953echo stdout:; cat "$at_stdout"
170954at_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"
170960at_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>&-
170963at_status=$? at_failed=false
170964$at_check_filter
170965echo stderr:; cat "$at_stderr"
170966echo stdout:; cat "$at_stdout"
170967at_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"
170975at_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>&-
170978at_status=$? at_failed=false
170979$at_check_filter
170980echo stderr:; tee stderr <"$at_stderr"
170981echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
1709825.0-5.3: <declare>(T,x)
1709837.0-7.7: <init-declare>(T,x,y)
1709849.0-9.5: =(x,y)
17098511.0-11.9: +(<cast>(x,T),y)
17098613.0-13.5: <declare>(T,x)
17098715.0-15.13: <init-declare>(T,y,+(z,q))
17098817.0-17.15: <error>
17098919.0-19.5: +(z,q)
170990" | \
170991  $at_diff - "$at_stdout" || at_failed=:
170992at_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"
170998at_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>&-
171001at_status=$? at_failed=false
171002$at_check_filter
171003echo >>"$at_stderr"; $as_echo "17.5: syntax error
171004" | \
171005  $at_diff - "$at_stderr" || at_failed=:
171006at_fn_diff_devnull "$at_stdout" || at_failed=:
171007at_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
171015read at_status <"$at_status_file"
171016#AT_STOP_325
171017#AT_START_326
171018at_fn_group_banner 326 'cxx-type.at:421' \
171019  "GLR: Merge conflicting parses, impure, no locations" "" 21
171020at_xfail=no
171021(
171022  $as_echo "326. $at_setup_line: testing $at_desc ..."
171023  $at_traceon
171024
171025
171026
171027cat >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
171088prog :
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
171098stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
171099     | decl      %merge <stmtMerge>
171100     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
171101     | '@'              { YYACCEPT; }
171102     ;
171103
171104expr : 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
171111decl : 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
171118declarator : 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
171130int
171131main (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.  */
171141static
171142void yyerror ( const char *msg)
171143{
171144  fprintf (stderr, "%s\n", msg);
171145}
171146
171147int 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
171213static Node *
171214new_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
171232static Node *
171233new_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
171242static void
171243free_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
171262static char *
171263node_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
171292static YYSTYPE
171293stmtMerge (YYSTYPE x0, YYSTYPE x1)
171294{
171295  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
171296}
171297
171298_ATEOF
171299
171300
171301
171302cat >test-input <<'_ATEOF'
171303
171304
171305z + q;
171306
171307T x;
171308
171309T x = y;
171310
171311x = y;
171312
171313T (x) + y;
171314
171315T (x);
171316
171317T (y) = z + q;
171318
171319T (y y) = z + q;
171320
171321z + q;
171322
171323@
171324
171325This is total garbage, but it should be ignored.
171326_ATEOF
171327
171328
171329if 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"
171337at_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>&-
171341at_status=$? at_failed=false
171342$at_check_filter
171343echo stderr:; cat "$at_stderr"
171344echo stdout:; cat "$at_stdout"
171345at_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"
171351at_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>&-
171354at_status=$? at_failed=false
171355$at_check_filter
171356echo stderr:; cat "$at_stderr"
171357echo stdout:; cat "$at_stdout"
171358at_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"
171367at_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>&-
171372at_status=$? at_failed=false
171373$at_check_filter
171374at_fn_diff_devnull "$at_stderr" || at_failed=:
171375$at_diff expout "$at_stdout" || at_failed=:
171376at_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"
171385at_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>&-
171390at_status=$? at_failed=false
171391$at_check_filter
171392at_fn_diff_devnull "$at_stderr" || at_failed=:
171393$at_diff expout "$at_stdout" || at_failed=:
171394at_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
171400fi
171401{ set +x
171402$as_echo "$at_srcdir/cxx-type.at:422: bison -o types.c types.y"
171403at_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>&-
171406at_status=$? at_failed=false
171407$at_check_filter
171408echo stderr:; cat "$at_stderr"
171409at_fn_diff_devnull "$at_stdout" || at_failed=:
171410at_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"
171417at_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>&-
171420at_status=$? at_failed=false
171421$at_check_filter
171422echo stderr:; cat "$at_stderr"
171423echo stdout:; cat "$at_stdout"
171424at_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"
171430at_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>&-
171433at_status=$? at_failed=false
171434$at_check_filter
171435echo stderr:; cat "$at_stderr"
171436echo stdout:; cat "$at_stdout"
171437at_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"
171445at_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>&-
171448at_status=$? at_failed=false
171449$at_check_filter
171450echo stderr:; tee stderr <"$at_stderr"
171451echo >>"$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=:
171462at_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"
171468at_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>&-
171471at_status=$? at_failed=false
171472$at_check_filter
171473echo >>"$at_stderr"; $as_echo "syntax error
171474" | \
171475  $at_diff - "$at_stderr" || at_failed=:
171476at_fn_diff_devnull "$at_stdout" || at_failed=:
171477at_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
171485read at_status <"$at_status_file"
171486#AT_STOP_326
171487#AT_START_327
171488at_fn_group_banner 327 'cxx-type.at:428' \
171489  "GLR: Merge conflicting parses, impure, locations" "" 21
171490at_xfail=no
171491(
171492  $as_echo "327. $at_setup_line: testing $at_desc ..."
171493  $at_traceon
171494
171495
171496
171497cat >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
171558prog :
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
171571stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
171572     | decl      %merge <stmtMerge>
171573     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
171574     | '@'              { YYACCEPT; }
171575     ;
171576
171577expr : 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
171584decl : 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
171591declarator : 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
171603int
171604main (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.  */
171614static
171615void yyerror ( const char *msg)
171616{
171617  YY_LOCATION_PRINT (stderr, (yylloc));
171618  fprintf (stderr, ": ");
171619  fprintf (stderr, "%s\n", msg);
171620}
171621
171622int 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
171691static Node *
171692new_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
171710static Node *
171711new_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
171720static void
171721free_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
171740static char *
171741node_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
171770static YYSTYPE
171771stmtMerge (YYSTYPE x0, YYSTYPE x1)
171772{
171773  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
171774}
171775
171776_ATEOF
171777
171778
171779
171780cat >test-input <<'_ATEOF'
171781
171782
171783z + q;
171784
171785T x;
171786
171787T x = y;
171788
171789x = y;
171790
171791T (x) + y;
171792
171793T (x);
171794
171795T (y) = z + q;
171796
171797T (y y) = z + q;
171798
171799z + q;
171800
171801@
171802
171803This is total garbage, but it should be ignored.
171804_ATEOF
171805
171806
171807if 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"
171815at_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>&-
171819at_status=$? at_failed=false
171820$at_check_filter
171821echo stderr:; cat "$at_stderr"
171822echo stdout:; cat "$at_stdout"
171823at_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"
171829at_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>&-
171832at_status=$? at_failed=false
171833$at_check_filter
171834echo stderr:; cat "$at_stderr"
171835echo stdout:; cat "$at_stdout"
171836at_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"
171845at_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>&-
171850at_status=$? at_failed=false
171851$at_check_filter
171852at_fn_diff_devnull "$at_stderr" || at_failed=:
171853$at_diff expout "$at_stdout" || at_failed=:
171854at_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"
171863at_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>&-
171868at_status=$? at_failed=false
171869$at_check_filter
171870at_fn_diff_devnull "$at_stderr" || at_failed=:
171871$at_diff expout "$at_stdout" || at_failed=:
171872at_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
171878fi
171879{ set +x
171880$as_echo "$at_srcdir/cxx-type.at:429: bison -o types.c types.y"
171881at_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>&-
171884at_status=$? at_failed=false
171885$at_check_filter
171886echo stderr:; cat "$at_stderr"
171887at_fn_diff_devnull "$at_stdout" || at_failed=:
171888at_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"
171895at_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>&-
171898at_status=$? at_failed=false
171899$at_check_filter
171900echo stderr:; cat "$at_stderr"
171901echo stdout:; cat "$at_stdout"
171902at_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"
171908at_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>&-
171911at_status=$? at_failed=false
171912$at_check_filter
171913echo stderr:; cat "$at_stderr"
171914echo stdout:; cat "$at_stdout"
171915at_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"
171923at_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>&-
171926at_status=$? at_failed=false
171927$at_check_filter
171928echo stderr:; tee stderr <"$at_stderr"
171929echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
1719305.0-5.3: <declare>(T,x)
1719317.0-7.7: <init-declare>(T,x,y)
1719329.0-9.5: =(x,y)
17193311.0-11.9: +(<cast>(x,T),y)
17193413.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
17193515.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17193617.0-17.15: <error>
17193719.0-19.5: +(z,q)
171938" | \
171939  $at_diff - "$at_stdout" || at_failed=:
171940at_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"
171946at_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>&-
171949at_status=$? at_failed=false
171950$at_check_filter
171951echo >>"$at_stderr"; $as_echo "17.5: syntax error
171952" | \
171953  $at_diff - "$at_stderr" || at_failed=:
171954at_fn_diff_devnull "$at_stdout" || at_failed=:
171955at_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
171963read at_status <"$at_status_file"
171964#AT_STOP_327
171965#AT_START_328
171966at_fn_group_banner 328 'cxx-type.at:435' \
171967  "GLR: Merge conflicting parses, pure, no locations" "" 21
171968at_xfail=no
171969(
171970  $as_echo "328. $at_setup_line: testing $at_desc ..."
171971  $at_traceon
171972
171973
171974
171975cat >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
172036prog :
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
172046stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
172047     | decl      %merge <stmtMerge>
172048     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
172049     | '@'              { YYACCEPT; }
172050     ;
172051
172052expr : 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
172059decl : 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
172066declarator : 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
172078int
172079main (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.  */
172089static
172090void yyerror ( const char *msg)
172091{
172092  fprintf (stderr, "%s\n", msg);
172093}
172094
172095int 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
172161static Node *
172162new_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
172180static Node *
172181new_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
172190static void
172191free_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
172210static char *
172211node_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
172240static YYSTYPE
172241stmtMerge (YYSTYPE x0, YYSTYPE x1)
172242{
172243  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
172244}
172245
172246_ATEOF
172247
172248
172249
172250cat >test-input <<'_ATEOF'
172251
172252
172253z + q;
172254
172255T x;
172256
172257T x = y;
172258
172259x = y;
172260
172261T (x) + y;
172262
172263T (x);
172264
172265T (y) = z + q;
172266
172267T (y y) = z + q;
172268
172269z + q;
172270
172271@
172272
172273This is total garbage, but it should be ignored.
172274_ATEOF
172275
172276
172277if 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"
172285at_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>&-
172289at_status=$? at_failed=false
172290$at_check_filter
172291echo stderr:; cat "$at_stderr"
172292echo stdout:; cat "$at_stdout"
172293at_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"
172299at_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>&-
172302at_status=$? at_failed=false
172303$at_check_filter
172304echo stderr:; cat "$at_stderr"
172305echo stdout:; cat "$at_stdout"
172306at_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"
172315at_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>&-
172320at_status=$? at_failed=false
172321$at_check_filter
172322at_fn_diff_devnull "$at_stderr" || at_failed=:
172323$at_diff expout "$at_stdout" || at_failed=:
172324at_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"
172333at_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>&-
172338at_status=$? at_failed=false
172339$at_check_filter
172340at_fn_diff_devnull "$at_stderr" || at_failed=:
172341$at_diff expout "$at_stdout" || at_failed=:
172342at_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
172348fi
172349{ set +x
172350$as_echo "$at_srcdir/cxx-type.at:436: bison -o types.c types.y"
172351at_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>&-
172354at_status=$? at_failed=false
172355$at_check_filter
172356echo stderr:; cat "$at_stderr"
172357at_fn_diff_devnull "$at_stdout" || at_failed=:
172358at_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"
172365at_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>&-
172368at_status=$? at_failed=false
172369$at_check_filter
172370echo stderr:; cat "$at_stderr"
172371echo stdout:; cat "$at_stdout"
172372at_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"
172378at_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>&-
172381at_status=$? at_failed=false
172382$at_check_filter
172383echo stderr:; cat "$at_stderr"
172384echo stdout:; cat "$at_stdout"
172385at_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"
172393at_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>&-
172396at_status=$? at_failed=false
172397$at_check_filter
172398echo stderr:; tee stderr <"$at_stderr"
172399echo >>"$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=:
172410at_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"
172416at_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>&-
172419at_status=$? at_failed=false
172420$at_check_filter
172421echo >>"$at_stderr"; $as_echo "syntax error
172422" | \
172423  $at_diff - "$at_stderr" || at_failed=:
172424at_fn_diff_devnull "$at_stdout" || at_failed=:
172425at_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
172433read at_status <"$at_status_file"
172434#AT_STOP_328
172435#AT_START_329
172436at_fn_group_banner 329 'cxx-type.at:441' \
172437  "GLR: Merge conflicting parses, pure, locations" " " 21
172438at_xfail=no
172439(
172440  $as_echo "329. $at_setup_line: testing $at_desc ..."
172441  $at_traceon
172442
172443
172444
172445cat >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
172506prog :
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
172519stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
172520     | decl      %merge <stmtMerge>
172521     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
172522     | '@'              { YYACCEPT; }
172523     ;
172524
172525expr : 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
172532decl : 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
172539declarator : 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
172551int
172552main (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.  */
172562static
172563void 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
172570int 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
172639static Node *
172640new_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
172658static Node *
172659new_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
172668static void
172669free_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
172688static char *
172689node_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
172718static YYSTYPE
172719stmtMerge (YYSTYPE x0, YYSTYPE x1)
172720{
172721  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
172722}
172723
172724_ATEOF
172725
172726
172727
172728cat >test-input <<'_ATEOF'
172729
172730
172731z + q;
172732
172733T x;
172734
172735T x = y;
172736
172737x = y;
172738
172739T (x) + y;
172740
172741T (x);
172742
172743T (y) = z + q;
172744
172745T (y y) = z + q;
172746
172747z + q;
172748
172749@
172750
172751This is total garbage, but it should be ignored.
172752_ATEOF
172753
172754
172755if 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"
172763at_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>&-
172767at_status=$? at_failed=false
172768$at_check_filter
172769echo stderr:; cat "$at_stderr"
172770echo stdout:; cat "$at_stdout"
172771at_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"
172777at_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>&-
172780at_status=$? at_failed=false
172781$at_check_filter
172782echo stderr:; cat "$at_stderr"
172783echo stdout:; cat "$at_stdout"
172784at_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"
172793at_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>&-
172798at_status=$? at_failed=false
172799$at_check_filter
172800at_fn_diff_devnull "$at_stderr" || at_failed=:
172801$at_diff expout "$at_stdout" || at_failed=:
172802at_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"
172811at_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>&-
172816at_status=$? at_failed=false
172817$at_check_filter
172818at_fn_diff_devnull "$at_stderr" || at_failed=:
172819$at_diff expout "$at_stdout" || at_failed=:
172820at_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
172826fi
172827{ set +x
172828$as_echo "$at_srcdir/cxx-type.at:442: bison -o types.c types.y"
172829at_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>&-
172832at_status=$? at_failed=false
172833$at_check_filter
172834echo stderr:; cat "$at_stderr"
172835at_fn_diff_devnull "$at_stdout" || at_failed=:
172836at_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"
172843at_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>&-
172846at_status=$? at_failed=false
172847$at_check_filter
172848echo stderr:; cat "$at_stderr"
172849echo stdout:; cat "$at_stdout"
172850at_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"
172856at_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>&-
172859at_status=$? at_failed=false
172860$at_check_filter
172861echo stderr:; cat "$at_stderr"
172862echo stdout:; cat "$at_stdout"
172863at_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"
172871at_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>&-
172874at_status=$? at_failed=false
172875$at_check_filter
172876echo stderr:; tee stderr <"$at_stderr"
172877echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
1728785.0-5.3: <declare>(T,x)
1728797.0-7.7: <init-declare>(T,x,y)
1728809.0-9.5: =(x,y)
17288111.0-11.9: +(<cast>(x,T),y)
17288213.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
17288315.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17288417.0-17.15: <error>
17288519.0-19.5: +(z,q)
172886" | \
172887  $at_diff - "$at_stdout" || at_failed=:
172888at_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"
172894at_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>&-
172897at_status=$? at_failed=false
172898$at_check_filter
172899echo >>"$at_stderr"; $as_echo "17.5: syntax error
172900" | \
172901  $at_diff - "$at_stderr" || at_failed=:
172902at_fn_diff_devnull "$at_stdout" || at_failed=:
172903at_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
172911read at_status <"$at_status_file"
172912#AT_STOP_329
172913#AT_START_330
172914at_fn_group_banner 330 'cxx-type.at:448' \
172915  "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 21
172916at_xfail=no
172917(
172918  $as_echo "330. $at_setup_line: testing $at_desc ..."
172919  $at_traceon
172920
172921
172922
172923cat >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
172984prog :
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
172994stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
172995     | decl      %merge <stmtMerge>
172996     | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
172997     | '@'              { YYACCEPT; }
172998     ;
172999
173000expr : 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
173007decl : 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
173014declarator : 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
173026int
173027main (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.  */
173037static
173038void yyerror ( const char *msg)
173039{
173040  fprintf (stderr, "%s\n", msg);
173041}
173042
173043int 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
173109static Node *
173110new_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
173128static Node *
173129new_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
173138static void
173139free_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
173158static char *
173159node_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
173188static YYSTYPE
173189stmtMerge (YYSTYPE x0, YYSTYPE x1)
173190{
173191  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
173192}
173193
173194_ATEOF
173195
173196
173197
173198cat >test-input <<'_ATEOF'
173199
173200
173201z + q;
173202
173203T x;
173204
173205T x = y;
173206
173207x = y;
173208
173209T (x) + y;
173210
173211T (x);
173212
173213T (y) = z + q;
173214
173215T (y y) = z + q;
173216
173217z + q;
173218
173219@
173220
173221This is total garbage, but it should be ignored.
173222_ATEOF
173223
173224
173225if 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"
173233at_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>&-
173237at_status=$? at_failed=false
173238$at_check_filter
173239echo stderr:; cat "$at_stderr"
173240echo stdout:; cat "$at_stdout"
173241at_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"
173247at_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>&-
173250at_status=$? at_failed=false
173251$at_check_filter
173252echo stderr:; cat "$at_stderr"
173253echo stdout:; cat "$at_stdout"
173254at_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"
173263at_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>&-
173268at_status=$? at_failed=false
173269$at_check_filter
173270at_fn_diff_devnull "$at_stderr" || at_failed=:
173271$at_diff expout "$at_stdout" || at_failed=:
173272at_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"
173281at_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>&-
173286at_status=$? at_failed=false
173287$at_check_filter
173288at_fn_diff_devnull "$at_stderr" || at_failed=:
173289$at_diff expout "$at_stdout" || at_failed=:
173290at_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
173296fi
173297{ set +x
173298$as_echo "$at_srcdir/cxx-type.at:449: bison -o types.c types.y"
173299at_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>&-
173302at_status=$? at_failed=false
173303$at_check_filter
173304echo stderr:; cat "$at_stderr"
173305at_fn_diff_devnull "$at_stdout" || at_failed=:
173306at_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"
173313at_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>&-
173316at_status=$? at_failed=false
173317$at_check_filter
173318echo stderr:; cat "$at_stderr"
173319echo stdout:; cat "$at_stdout"
173320at_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"
173326at_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>&-
173329at_status=$? at_failed=false
173330$at_check_filter
173331echo stderr:; cat "$at_stderr"
173332echo stdout:; cat "$at_stdout"
173333at_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"
173341at_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>&-
173344at_status=$? at_failed=false
173345$at_check_filter
173346echo stderr:; tee stderr <"$at_stderr"
173347echo >>"$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=:
173358at_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"
173364at_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>&-
173367at_status=$? at_failed=false
173368$at_check_filter
173369echo >>"$at_stderr"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' or ')'
173370" | \
173371  $at_diff - "$at_stderr" || at_failed=:
173372at_fn_diff_devnull "$at_stdout" || at_failed=:
173373at_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
173381read at_status <"$at_status_file"
173382#AT_STOP_330
173383#AT_START_331
173384at_fn_group_banner 331 'glr-regression.at:25' \
173385  "Badly Collapsed GLR States" "                     " 22
173386at_xfail=no
173387(
173388  $as_echo "331. $at_setup_line: testing $at_desc ..."
173389  $at_traceon
173390
173391
173392
173393cat >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
173411static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
173412static void yyerror ( const char *msg);
173413static int yylex (void);
173414%}
173415
173416
173417%glr-parser
173418
173419
173420/* -------- productions ------ */
173421%%
173422
173423StartSymbol: E  { $$=0; }                   %merge <exprMerge>
173424           ;
173425
173426E: 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
173435static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
173436{
173437  (void) x0;
173438  (void) x1;
173439  printf ("<OR>\n");
173440  return 0;
173441}
173442
173443const char *input = YY_NULL;
173444
173445int
173446main (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.  */
173455static
173456void yyerror ( const char *msg)
173457{
173458  fprintf (stderr, "%s\n", msg);
173459}
173460
173461int
173462yylex (void)
173463{
173464  return *input++;
173465}
173466_ATEOF
173467
173468
173469
173470
173471if 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"
173479at_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>&-
173483at_status=$? at_failed=false
173484$at_check_filter
173485echo stderr:; cat "$at_stderr"
173486echo stdout:; cat "$at_stdout"
173487at_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"
173493at_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>&-
173496at_status=$? at_failed=false
173497$at_check_filter
173498echo stderr:; cat "$at_stderr"
173499echo stdout:; cat "$at_stdout"
173500at_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"
173509at_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>&-
173514at_status=$? at_failed=false
173515$at_check_filter
173516at_fn_diff_devnull "$at_stderr" || at_failed=:
173517$at_diff expout "$at_stdout" || at_failed=:
173518at_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"
173527at_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>&-
173532at_status=$? at_failed=false
173533$at_check_filter
173534at_fn_diff_devnull "$at_stderr" || at_failed=:
173535$at_diff expout "$at_stdout" || at_failed=:
173536at_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
173542fi
173543{ set +x
173544$as_echo "$at_srcdir/glr-regression.at:90: bison -o glr-regr1.c glr-regr1.y"
173545at_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>&-
173548at_status=$? at_failed=false
173549$at_check_filter
173550echo >>"$at_stderr"; $as_echo "glr-regr1.y: conflicts: 1 shift/reduce
173551" | \
173552  $at_diff - "$at_stderr" || at_failed=:
173553at_fn_diff_devnull "$at_stdout" || at_failed=:
173554at_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"
173561at_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>&-
173564at_status=$? at_failed=false
173565$at_check_filter
173566echo stderr:; cat "$at_stderr"
173567echo stdout:; cat "$at_stdout"
173568at_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"
173574at_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>&-
173577at_status=$? at_failed=false
173578$at_check_filter
173579echo stderr:; cat "$at_stderr"
173580echo stdout:; cat "$at_stdout"
173581at_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"
173587at_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>&-
173590at_status=$? at_failed=false
173591$at_check_filter
173592echo stderr:; tee stderr <"$at_stderr"
173593echo >>"$at_stdout"; $as_echo "E -> 'B'
173594E -> 'B'
173595E -> E 'P' E
173596E -> 'B'
173597E -> E 'P' E
173598E -> 'B'
173599E -> E 'P' E
173600E -> E 'P' E
173601<OR>
173602" | \
173603  $at_diff - "$at_stdout" || at_failed=:
173604at_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"
173610at_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>&-
173613at_status=$? at_failed=false
173614$at_check_filter
173615at_fn_diff_devnull "$at_stderr" || at_failed=:
173616at_fn_diff_devnull "$at_stdout" || at_failed=:
173617at_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
173626read at_status <"$at_status_file"
173627#AT_STOP_331
173628#AT_START_332
173629at_fn_group_banner 332 'glr-regression.at:112' \
173630  "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 22
173631at_xfail=no
173632(
173633  $as_echo "332. $at_setup_line: testing $at_desc ..."
173634  $at_traceon
173635
173636
173637
173638cat >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
173666command:
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
173677var:
173678  'V'
173679     { $$ = $1; }
173680  ;
173681
173682var_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
173695var_printer: 'v'
173696   { printf ("Variable: '%s'\n", $-1); }
173697
173698%%
173699#include <stdio.h>
173700/* A C error reporting function.  */
173701static
173702void yyerror ( const char *msg)
173703{
173704  fprintf (stderr, "%s\n", msg);
173705}
173706FILE *input;
173707
173708int
173709yylex (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
173732int
173733main (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
173749if 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"
173757at_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>&-
173761at_status=$? at_failed=false
173762$at_check_filter
173763echo stderr:; cat "$at_stderr"
173764echo stdout:; cat "$at_stdout"
173765at_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"
173771at_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>&-
173774at_status=$? at_failed=false
173775$at_check_filter
173776echo stderr:; cat "$at_stderr"
173777echo stdout:; cat "$at_stdout"
173778at_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"
173787at_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>&-
173792at_status=$? at_failed=false
173793$at_check_filter
173794at_fn_diff_devnull "$at_stderr" || at_failed=:
173795$at_diff expout "$at_stdout" || at_failed=:
173796at_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"
173805at_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>&-
173810at_status=$? at_failed=false
173811$at_check_filter
173812at_fn_diff_devnull "$at_stderr" || at_failed=:
173813$at_diff expout "$at_stdout" || at_failed=:
173814at_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
173820fi
173821{ set +x
173822$as_echo "$at_srcdir/glr-regression.at:210: bison -o glr-regr2a.c glr-regr2a.y"
173823at_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>&-
173826at_status=$? at_failed=false
173827$at_check_filter
173828echo >>"$at_stderr"; $as_echo "glr-regr2a.y: conflicts: 2 shift/reduce
173829" | \
173830  $at_diff - "$at_stderr" || at_failed=:
173831at_fn_diff_devnull "$at_stdout" || at_failed=:
173832at_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"
173839at_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>&-
173842at_status=$? at_failed=false
173843$at_check_filter
173844echo stderr:; cat "$at_stderr"
173845echo stdout:; cat "$at_stdout"
173846at_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"
173852at_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>&-
173855at_status=$? at_failed=false
173856$at_check_filter
173857echo stderr:; cat "$at_stderr"
173858echo stdout:; cat "$at_stdout"
173859at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213"
173860$at_failed && at_fn_log_failure
173861$at_traceon; }
173862
173863
173864cat >input1.txt <<'_ATEOF'
173865s 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"
173870at_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>&-
173873at_status=$? at_failed=false
173874$at_check_filter
173875echo stderr:; tee stderr <"$at_stderr"
173876echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_1'
173877" | \
173878  $at_diff - "$at_stdout" || at_failed=:
173879at_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"
173885at_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>&-
173888at_status=$? at_failed=false
173889$at_check_filter
173890at_fn_diff_devnull "$at_stderr" || at_failed=:
173891at_fn_diff_devnull "$at_stdout" || at_failed=:
173892at_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
173898cat >input2.txt <<'_ATEOF'
173899s 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"
173904at_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>&-
173907at_status=$? at_failed=false
173908$at_check_filter
173909echo stderr:; tee stderr <"$at_stderr"
173910echo >>"$at_stdout"; $as_echo "Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2'
173911" | \
173912  $at_diff - "$at_stdout" || at_failed=:
173913at_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"
173919at_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>&-
173922at_status=$? at_failed=false
173923$at_check_filter
173924at_fn_diff_devnull "$at_stderr" || at_failed=:
173925at_fn_diff_devnull "$at_stdout" || at_failed=:
173926at_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
173932cat >input3.txt <<'_ATEOF'
173933s 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"
173938at_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>&-
173941at_status=$? at_failed=false
173942$at_check_filter
173943echo stderr:; tee stderr <"$at_stderr"
173944echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_3'
173945" | \
173946  $at_diff - "$at_stdout" || at_failed=:
173947at_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"
173953at_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>&-
173956at_status=$? at_failed=false
173957$at_check_filter
173958at_fn_diff_devnull "$at_stderr" || at_failed=:
173959at_fn_diff_devnull "$at_stdout" || at_failed=:
173960at_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
173970read at_status <"$at_status_file"
173971#AT_STOP_332
173972#AT_START_333
173973at_fn_group_banner 333 'glr-regression.at:244' \
173974  "Improper merging of GLR delayed action sets" "    " 22
173975at_xfail=no
173976(
173977  $as_echo "333. $at_setup_line: testing $at_desc ..."
173978  $at_traceon
173979
173980
173981
173982cat >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
174000static int MergeRule (int x0, int x1);
174001static void yyerror ( const char *msg);
174002static 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
174015S : P1 T4 O2 NT6 P2  { printf ("Result: %x\n", $4); }
174016;
174017
174018NT1 : P1 T1 O1 T2 P2 { $$ = RULE(2); }  %merge<MergeRule>
174019;
174020
174021NT2 : NT1             { $$ = RULE(3); } %merge<MergeRule>
174022    | P1 NT1 O1 T3 P2 { $$ = RULE(4); } %merge<MergeRule>
174023;
174024
174025NT3 : T3              { $$ = RULE(5); } %merge<MergeRule>
174026    | P1 NT1 O1 T3 P2 { $$ = RULE(6); } %merge<MergeRule>
174027;
174028
174029NT4 : NT3              { $$ = RULE(7); } %merge<MergeRule>
174030    | NT2              { $$ = RULE(8); } %merge<MergeRule>
174031    | P1 NT2 O1 NT3 P2 { $$ = RULE(9); } %merge<MergeRule>
174032;
174033
174034NT5 : NT4              { $$ = RULE(10); } %merge<MergeRule>
174035;
174036
174037NT6 : P1 NT1 O1 T3 P2  { $$ = RULE(11) | $2; } %merge<MergeRule>
174038    | NT5              { $$ = RULE(12) | $1; } %merge<MergeRule>
174039;
174040
174041%%
174042
174043static int
174044MergeRule (int x0, int x1)
174045{
174046  return x0 | x1;
174047}
174048#include <stdio.h>
174049/* A C error reporting function.  */
174050static
174051void yyerror ( const char *msg)
174052{
174053  fprintf (stderr, "%s\n", msg);
174054}
174055
174056FILE *input = YY_NULL;
174057
174058int P[] = { P1, P2 };
174059int O[] = { O1, O2 };
174060int T[] = { T1, T2, T3, T4 };
174061
174062int 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
174077int
174078main(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
174094if 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"
174102at_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>&-
174106at_status=$? at_failed=false
174107$at_check_filter
174108echo stderr:; cat "$at_stderr"
174109echo stdout:; cat "$at_stdout"
174110at_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"
174116at_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>&-
174119at_status=$? at_failed=false
174120$at_check_filter
174121echo stderr:; cat "$at_stderr"
174122echo stdout:; cat "$at_stdout"
174123at_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"
174132at_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>&-
174137at_status=$? at_failed=false
174138$at_check_filter
174139at_fn_diff_devnull "$at_stderr" || at_failed=:
174140$at_diff expout "$at_stdout" || at_failed=:
174141at_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"
174150at_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>&-
174155at_status=$? at_failed=false
174156$at_check_filter
174157at_fn_diff_devnull "$at_stderr" || at_failed=:
174158$at_diff expout "$at_stdout" || at_failed=:
174159at_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
174165fi
174166{ set +x
174167$as_echo "$at_srcdir/glr-regression.at:343: bison -o glr-regr3.c glr-regr3.y"
174168at_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>&-
174171at_status=$? at_failed=false
174172$at_check_filter
174173echo >>"$at_stderr"; $as_echo "glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce
174174" | \
174175  $at_diff - "$at_stderr" || at_failed=:
174176at_fn_diff_devnull "$at_stdout" || at_failed=:
174177at_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"
174184at_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>&-
174187at_status=$? at_failed=false
174188$at_check_filter
174189echo stderr:; cat "$at_stderr"
174190echo stdout:; cat "$at_stdout"
174191at_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"
174197at_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>&-
174200at_status=$? at_failed=false
174201$at_check_filter
174202echo stderr:; cat "$at_stderr"
174203echo stdout:; cat "$at_stdout"
174204at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346"
174205$at_failed && at_fn_log_failure
174206$at_traceon; }
174207
174208
174209cat >input.txt <<'_ATEOF'
174210p1 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"
174215at_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>&-
174218at_status=$? at_failed=false
174219$at_check_filter
174220echo stderr:; tee stderr <"$at_stderr"
174221echo >>"$at_stdout"; $as_echo "Result: 1c04
174222" | \
174223  $at_diff - "$at_stdout" || at_failed=:
174224at_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"
174230at_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>&-
174233at_status=$? at_failed=false
174234$at_check_filter
174235at_fn_diff_devnull "$at_stderr" || at_failed=:
174236at_fn_diff_devnull "$at_stdout" || at_failed=:
174237at_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
174246read at_status <"$at_status_file"
174247#AT_STOP_333
174248#AT_START_334
174249at_fn_group_banner 334 'glr-regression.at:364' \
174250  "Duplicate representation of merged trees" "       " 22
174251at_xfail=no
174252(
174253  $as_echo "334. $at_setup_line: testing $at_desc ..."
174254  $at_traceon
174255
174256
174257
174258cat >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
174286tree: S { printf ("%s\n", $1); } ;
174287
174288S:
174289  A   %merge<merge> { $$ = make_value ("S", $1); }
174290  | B %merge<merge> { $$ = make_value ("S", $1); }
174291  ;
174292
174293A:
174294  A1   %merge<merge> { $$ = make_value ("A", $1); }
174295  | A2 %merge<merge> { $$ = make_value ("A", $1); }
174296  ;
174297
174298A1: 'a' { $$ = make_value ("A1", "'a'"); } ;
174299A2: 'a' { $$ = make_value ("A2", "'a'"); } ;
174300B:  'a' { $$ = make_value ("B", "'a'");  } ;
174301
174302%%
174303#include <stdio.h>
174304/* A C error reporting function.  */
174305static
174306void yyerror ( const char *msg)
174307{
174308  fprintf (stderr, "%s\n", msg);
174309}
174310#include <assert.h>
174311static
174312int 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
174324int
174325main (void)
174326{
174327  int status = yyparse ();
174328  while (ptrs_next != ptrs)
174329    free (*--ptrs_next);
174330  return status;
174331}
174332
174333static char *
174334make_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
174343static char *
174344merge (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
174357if 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"
174365at_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>&-
174369at_status=$? at_failed=false
174370$at_check_filter
174371echo stderr:; cat "$at_stderr"
174372echo stdout:; cat "$at_stdout"
174373at_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"
174379at_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>&-
174382at_status=$? at_failed=false
174383$at_check_filter
174384echo stderr:; cat "$at_stderr"
174385echo stdout:; cat "$at_stdout"
174386at_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"
174395at_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>&-
174400at_status=$? at_failed=false
174401$at_check_filter
174402at_fn_diff_devnull "$at_stderr" || at_failed=:
174403$at_diff expout "$at_stdout" || at_failed=:
174404at_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"
174413at_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>&-
174418at_status=$? at_failed=false
174419$at_check_filter
174420at_fn_diff_devnull "$at_stderr" || at_failed=:
174421$at_diff expout "$at_stdout" || at_failed=:
174422at_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
174428fi
174429{ set +x
174430$as_echo "$at_srcdir/glr-regression.at:438: bison -o glr-regr4.c glr-regr4.y"
174431at_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>&-
174434at_status=$? at_failed=false
174435$at_check_filter
174436echo >>"$at_stderr"; $as_echo "glr-regr4.y: conflicts: 1 reduce/reduce
174437" | \
174438  $at_diff - "$at_stderr" || at_failed=:
174439at_fn_diff_devnull "$at_stdout" || at_failed=:
174440at_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"
174447at_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>&-
174450at_status=$? at_failed=false
174451$at_check_filter
174452echo stderr:; cat "$at_stderr"
174453echo stdout:; cat "$at_stdout"
174454at_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"
174460at_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>&-
174463at_status=$? at_failed=false
174464$at_check_filter
174465echo stderr:; cat "$at_stderr"
174466echo stdout:; cat "$at_stdout"
174467at_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"
174474at_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>&-
174477at_status=$? at_failed=false
174478$at_check_filter
174479echo stderr:; tee stderr <"$at_stderr"
174480echo >>"$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=:
174483at_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"
174489at_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>&-
174492at_status=$? at_failed=false
174493$at_check_filter
174494at_fn_diff_devnull "$at_stderr" || at_failed=:
174495at_fn_diff_devnull "$at_stdout" || at_failed=:
174496at_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
174505read at_status <"$at_status_file"
174506#AT_STOP_334
174507#AT_START_335
174508at_fn_group_banner 335 'glr-regression.at:455' \
174509  "User destructor for unresolved GLR semantic value" "" 22
174510at_xfail=no
174511(
174512  $as_echo "335. $at_setup_line: testing $at_desc ..."
174513  $at_traceon
174514
174515
174516
174517cat >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
174549start:
174550   'a' { $$ = MAGIC_VALUE; }
174551   | 'a' { $$ = MAGIC_VALUE; }
174552   ;
174553
174554%%
174555#include <assert.h>
174556static
174557int 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.  */
174570static
174571void yyerror ( const char *msg)
174572{
174573  fprintf (stderr, "%s\n", msg);
174574}
174575int
174576main (void)
174577{
174578  return yyparse () != 1;
174579}
174580_ATEOF
174581
174582
174583
174584
174585if 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"
174593at_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>&-
174597at_status=$? at_failed=false
174598$at_check_filter
174599echo stderr:; cat "$at_stderr"
174600echo stdout:; cat "$at_stdout"
174601at_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"
174607at_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>&-
174610at_status=$? at_failed=false
174611$at_check_filter
174612echo stderr:; cat "$at_stderr"
174613echo stdout:; cat "$at_stdout"
174614at_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"
174623at_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>&-
174628at_status=$? at_failed=false
174629$at_check_filter
174630at_fn_diff_devnull "$at_stderr" || at_failed=:
174631$at_diff expout "$at_stdout" || at_failed=:
174632at_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"
174641at_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>&-
174646at_status=$? at_failed=false
174647$at_check_filter
174648at_fn_diff_devnull "$at_stderr" || at_failed=:
174649$at_diff expout "$at_stdout" || at_failed=:
174650at_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
174656fi
174657{ set +x
174658$as_echo "$at_srcdir/glr-regression.at:498: bison -o glr-regr5.c glr-regr5.y"
174659at_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>&-
174662at_status=$? at_failed=false
174663$at_check_filter
174664echo >>"$at_stderr"; $as_echo "glr-regr5.y: conflicts: 1 reduce/reduce
174665" | \
174666  $at_diff - "$at_stderr" || at_failed=:
174667at_fn_diff_devnull "$at_stdout" || at_failed=:
174668at_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"
174675at_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>&-
174678at_status=$? at_failed=false
174679$at_check_filter
174680echo stderr:; cat "$at_stderr"
174681echo stdout:; cat "$at_stdout"
174682at_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"
174688at_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>&-
174691at_status=$? at_failed=false
174692$at_check_filter
174693echo stderr:; cat "$at_stderr"
174694echo stdout:; cat "$at_stdout"
174695at_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"
174702at_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>&-
174705at_status=$? at_failed=false
174706$at_check_filter
174707echo stderr:; tee stderr <"$at_stderr"
174708at_fn_diff_devnull "$at_stdout" || at_failed=:
174709at_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"
174715at_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>&-
174718at_status=$? at_failed=false
174719$at_check_filter
174720echo >>"$at_stderr"; $as_echo "syntax is ambiguous
174721" | \
174722  $at_diff - "$at_stderr" || at_failed=:
174723at_fn_diff_devnull "$at_stdout" || at_failed=:
174724at_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
174733read at_status <"$at_status_file"
174734#AT_STOP_335
174735#AT_START_336
174736at_fn_group_banner 336 'glr-regression.at:515' \
174737  "User destructor after an error during a split parse" "" 22
174738at_xfail=no
174739(
174740  $as_echo "336. $at_setup_line: testing $at_desc ..."
174741  $at_traceon
174742
174743
174744
174745cat >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
174772start: 'a' | 'a' ;
174773
174774%%
174775#include <stdio.h>
174776/* A C error reporting function.  */
174777static
174778void yyerror ( const char *msg)
174779{
174780  fprintf (stderr, "%s\n", msg);
174781}
174782#include <assert.h>
174783static
174784int 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}
174795int
174796main (void)
174797{
174798  return yyparse () != 1;
174799}
174800_ATEOF
174801
174802
174803
174804
174805if 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"
174813at_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>&-
174817at_status=$? at_failed=false
174818$at_check_filter
174819echo stderr:; cat "$at_stderr"
174820echo stdout:; cat "$at_stdout"
174821at_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"
174827at_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>&-
174830at_status=$? at_failed=false
174831$at_check_filter
174832echo stderr:; cat "$at_stderr"
174833echo stdout:; cat "$at_stdout"
174834at_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"
174843at_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>&-
174848at_status=$? at_failed=false
174849$at_check_filter
174850at_fn_diff_devnull "$at_stderr" || at_failed=:
174851$at_diff expout "$at_stdout" || at_failed=:
174852at_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"
174861at_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>&-
174866at_status=$? at_failed=false
174867$at_check_filter
174868at_fn_diff_devnull "$at_stderr" || at_failed=:
174869$at_diff expout "$at_stdout" || at_failed=:
174870at_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
174876fi
174877{ set +x
174878$as_echo "$at_srcdir/glr-regression.at:550: bison -o glr-regr6.c glr-regr6.y"
174879at_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>&-
174882at_status=$? at_failed=false
174883$at_check_filter
174884echo >>"$at_stderr"; $as_echo "glr-regr6.y: conflicts: 1 reduce/reduce
174885" | \
174886  $at_diff - "$at_stderr" || at_failed=:
174887at_fn_diff_devnull "$at_stdout" || at_failed=:
174888at_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"
174895at_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>&-
174898at_status=$? at_failed=false
174899$at_check_filter
174900echo stderr:; cat "$at_stderr"
174901echo stdout:; cat "$at_stdout"
174902at_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"
174908at_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>&-
174911at_status=$? at_failed=false
174912$at_check_filter
174913echo stderr:; cat "$at_stderr"
174914echo stdout:; cat "$at_stdout"
174915at_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"
174922at_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>&-
174925at_status=$? at_failed=false
174926$at_check_filter
174927echo stderr:; tee stderr <"$at_stderr"
174928echo >>"$at_stdout"; $as_echo "Destructor called.
174929" | \
174930  $at_diff - "$at_stdout" || at_failed=:
174931at_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"
174937at_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>&-
174940at_status=$? at_failed=false
174941$at_check_filter
174942echo >>"$at_stderr"; $as_echo "syntax is ambiguous
174943" | \
174944  $at_diff - "$at_stderr" || at_failed=:
174945at_fn_diff_devnull "$at_stdout" || at_failed=:
174946at_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
174955read at_status <"$at_status_file"
174956#AT_STOP_336
174957#AT_START_337
174958at_fn_group_banner 337 'glr-regression.at:569' \
174959  "Duplicated user destructor for lookahead" "       " 22
174960at_xfail=no
174961(
174962  $as_echo "337. $at_setup_line: testing $at_desc ..."
174963  $at_traceon
174964
174965
174966
174967cat >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
175001start:
175002    stack1 start
175003  | stack2 start
175004  | /* empty */
175005  ;
175006stack1: 'a' ;
175007stack2: 'a' ;
175008
175009%%
175010
175011static int
175012yylex (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.  */
175028static
175029void yyerror ( const char *msg)
175030{
175031  fprintf (stderr, "%s\n", msg);
175032}
175033int
175034main (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
175050if 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"
175058at_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>&-
175062at_status=$? at_failed=false
175063$at_check_filter
175064echo stderr:; cat "$at_stderr"
175065echo stdout:; cat "$at_stdout"
175066at_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"
175072at_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>&-
175075at_status=$? at_failed=false
175076$at_check_filter
175077echo stderr:; cat "$at_stderr"
175078echo stdout:; cat "$at_stdout"
175079at_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"
175088at_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>&-
175093at_status=$? at_failed=false
175094$at_check_filter
175095at_fn_diff_devnull "$at_stderr" || at_failed=:
175096$at_diff expout "$at_stdout" || at_failed=:
175097at_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"
175106at_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>&-
175111at_status=$? at_failed=false
175112$at_check_filter
175113at_fn_diff_devnull "$at_stderr" || at_failed=:
175114$at_diff expout "$at_stdout" || at_failed=:
175115at_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
175121fi
175122{ set +x
175123$as_echo "$at_srcdir/glr-regression.at:639: bison -o glr-regr7.c glr-regr7.y"
175124at_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>&-
175127at_status=$? at_failed=false
175128$at_check_filter
175129echo >>"$at_stderr"; $as_echo "glr-regr7.y: conflicts: 2 reduce/reduce
175130" | \
175131  $at_diff - "$at_stderr" || at_failed=:
175132at_fn_diff_devnull "$at_stdout" || at_failed=:
175133at_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"
175140at_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>&-
175143at_status=$? at_failed=false
175144$at_check_filter
175145echo stderr:; cat "$at_stderr"
175146echo stdout:; cat "$at_stdout"
175147at_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"
175153at_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>&-
175156at_status=$? at_failed=false
175157$at_check_filter
175158echo stderr:; cat "$at_stderr"
175159echo stdout:; cat "$at_stdout"
175160at_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"
175167at_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>&-
175170at_status=$? at_failed=false
175171$at_check_filter
175172echo stderr:; tee stderr <"$at_stderr"
175173at_fn_diff_devnull "$at_stdout" || at_failed=:
175174at_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"
175180at_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>&-
175183at_status=$? at_failed=false
175184$at_check_filter
175185echo >>"$at_stderr"; $as_echo "memory exhausted
175186" | \
175187  $at_diff - "$at_stderr" || at_failed=:
175188at_fn_diff_devnull "$at_stdout" || at_failed=:
175189at_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
175198read at_status <"$at_status_file"
175199#AT_STOP_337
175200#AT_START_338
175201at_fn_group_banner 338 'glr-regression.at:658' \
175202  "Incorrectly initialized location for empty right-hand side in GLR" "" 22
175203at_xfail=no
175204(
175205  $as_echo "338. $at_setup_line: testing $at_desc ..."
175206  $at_traceon
175207
175208
175209
175210cat >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
175236PortClause	: 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
175243InterfaceDeclaration	: OptConstantWord	%dprec 1
175244	| OptSignalWord	%dprec 2
175245	;
175246
175247OptConstantWord	: /* empty */
175248	| T_CONSTANT
175249	;
175250
175251OptSignalWord	: /* 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.  */
175260static
175261void yyerror ( const char *msg)
175262{
175263  fprintf (stderr, "%s\n", msg);
175264}
175265static int lexIndex;
175266
175267int 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
175287int
175288main (void)
175289{
175290  yyparse();
175291  return 0;
175292}
175293_ATEOF
175294
175295
175296
175297
175298if 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"
175306at_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>&-
175310at_status=$? at_failed=false
175311$at_check_filter
175312echo stderr:; cat "$at_stderr"
175313echo stdout:; cat "$at_stdout"
175314at_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"
175320at_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>&-
175323at_status=$? at_failed=false
175324$at_check_filter
175325echo stderr:; cat "$at_stderr"
175326echo stdout:; cat "$at_stdout"
175327at_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"
175336at_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>&-
175341at_status=$? at_failed=false
175342$at_check_filter
175343at_fn_diff_devnull "$at_stderr" || at_failed=:
175344$at_diff expout "$at_stdout" || at_failed=:
175345at_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"
175354at_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>&-
175359at_status=$? at_failed=false
175360$at_check_filter
175361at_fn_diff_devnull "$at_stderr" || at_failed=:
175362$at_diff expout "$at_stdout" || at_failed=:
175363at_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
175369fi
175370{ set +x
175371$as_echo "$at_srcdir/glr-regression.at:733: bison -o glr-regr8.c glr-regr8.y"
175372at_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>&-
175375at_status=$? at_failed=false
175376$at_check_filter
175377echo >>"$at_stderr"; $as_echo "glr-regr8.y: conflicts: 1 reduce/reduce
175378" | \
175379  $at_diff - "$at_stderr" || at_failed=:
175380at_fn_diff_devnull "$at_stdout" || at_failed=:
175381at_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"
175388at_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>&-
175391at_status=$? at_failed=false
175392$at_check_filter
175393echo stderr:; cat "$at_stderr"
175394echo stdout:; cat "$at_stdout"
175395at_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"
175401at_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>&-
175404at_status=$? at_failed=false
175405$at_check_filter
175406echo stderr:; cat "$at_stderr"
175407echo stdout:; cat "$at_stdout"
175408at_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"
175415at_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>&-
175418at_status=$? at_failed=false
175419$at_check_filter
175420echo stderr:; tee stderr <"$at_stderr"
175421echo >>"$at_stdout"; $as_echo "empty: 9/9
1754221/9 - 9/9 - 13/17
175423" | \
175424  $at_diff - "$at_stdout" || at_failed=:
175425at_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"
175431at_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>&-
175434at_status=$? at_failed=false
175435$at_check_filter
175436at_fn_diff_devnull "$at_stderr" || at_failed=:
175437at_fn_diff_devnull "$at_stdout" || at_failed=:
175438at_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
175447read at_status <"$at_status_file"
175448#AT_STOP_338
175449#AT_START_339
175450at_fn_group_banner 339 'glr-regression.at:752' \
175451  "No users destructors if stack 0 deleted" "        " 22
175452at_xfail=no
175453(
175454  $as_echo "339. $at_setup_line: testing $at_desc ..."
175455  $at_traceon
175456
175457
175458
175459cat >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
175490start:
175491    ambig0 'a'   { destructors += 2; USE ($2); }
175492  | ambig1 start { destructors += 1; }
175493  | ambig2 start { destructors += 1; }
175494  ;
175495
175496ambig0: 'a' ;
175497ambig1: 'a' ;
175498ambig2: 'a' ;
175499
175500%%
175501
175502static int
175503yylex (void)
175504{
175505  tokens += 1;
175506  return 'a';
175507}
175508
175509#include <stdio.h>
175510/* A C error reporting function.  */
175511static
175512void yyerror ( const char *msg)
175513{
175514  fprintf (stderr, "%s\n", msg);
175515}
175516int
175517main (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
175533if 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"
175541at_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>&-
175545at_status=$? at_failed=false
175546$at_check_filter
175547echo stderr:; cat "$at_stderr"
175548echo stdout:; cat "$at_stdout"
175549at_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"
175555at_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>&-
175558at_status=$? at_failed=false
175559$at_check_filter
175560echo stderr:; cat "$at_stderr"
175561echo stdout:; cat "$at_stdout"
175562at_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"
175571at_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>&-
175576at_status=$? at_failed=false
175577$at_check_filter
175578at_fn_diff_devnull "$at_stderr" || at_failed=:
175579$at_diff expout "$at_stdout" || at_failed=:
175580at_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"
175589at_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>&-
175594at_status=$? at_failed=false
175595$at_check_filter
175596at_fn_diff_devnull "$at_stderr" || at_failed=:
175597$at_diff expout "$at_stdout" || at_failed=:
175598at_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
175604fi
175605{ set +x
175606$as_echo "$at_srcdir/glr-regression.at:813: bison -o glr-regr9.c glr-regr9.y"
175607at_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>&-
175610at_status=$? at_failed=false
175611$at_check_filter
175612echo >>"$at_stderr"; $as_echo "glr-regr9.y: conflicts: 1 reduce/reduce
175613" | \
175614  $at_diff - "$at_stderr" || at_failed=:
175615at_fn_diff_devnull "$at_stdout" || at_failed=:
175616at_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"
175623at_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>&-
175626at_status=$? at_failed=false
175627$at_check_filter
175628echo stderr:; cat "$at_stderr"
175629echo stdout:; cat "$at_stdout"
175630at_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"
175636at_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>&-
175639at_status=$? at_failed=false
175640$at_check_filter
175641echo stderr:; cat "$at_stderr"
175642echo stdout:; cat "$at_stdout"
175643at_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"
175650at_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>&-
175653at_status=$? at_failed=false
175654$at_check_filter
175655echo stderr:; tee stderr <"$at_stderr"
175656at_fn_diff_devnull "$at_stdout" || at_failed=:
175657at_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"
175663at_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>&-
175666at_status=$? at_failed=false
175667$at_check_filter
175668echo >>"$at_stderr"; $as_echo "memory exhausted
175669" | \
175670  $at_diff - "$at_stderr" || at_failed=:
175671at_fn_diff_devnull "$at_stdout" || at_failed=:
175672at_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
175681read at_status <"$at_status_file"
175682#AT_STOP_339
175683#AT_START_340
175684at_fn_group_banner 340 'glr-regression.at:829' \
175685  "Corrupted semantic options if user action cuts parse" "" 22
175686at_xfail=no
175687(
175688  $as_echo "340. $at_setup_line: testing $at_desc ..."
175689  $at_traceon
175690
175691
175692
175693cat >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
175718start:
175719    %dprec 2 { $$ = garbage; YYACCEPT; }
175720  | %dprec 1 { $$ = garbage; YYACCEPT; }
175721  ;
175722
175723%%
175724#include <stdio.h>
175725/* A C error reporting function.  */
175726static
175727void yyerror ( const char *msg)
175728{
175729  fprintf (stderr, "%s\n", msg);
175730}
175731#include <assert.h>
175732static
175733int 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
175745int
175746main (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
175758if 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"
175766at_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>&-
175770at_status=$? at_failed=false
175771$at_check_filter
175772echo stderr:; cat "$at_stderr"
175773echo stdout:; cat "$at_stdout"
175774at_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"
175780at_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>&-
175783at_status=$? at_failed=false
175784$at_check_filter
175785echo stderr:; cat "$at_stderr"
175786echo stdout:; cat "$at_stdout"
175787at_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"
175796at_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>&-
175801at_status=$? at_failed=false
175802$at_check_filter
175803at_fn_diff_devnull "$at_stderr" || at_failed=:
175804$at_diff expout "$at_stdout" || at_failed=:
175805at_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"
175814at_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>&-
175819at_status=$? at_failed=false
175820$at_check_filter
175821at_fn_diff_devnull "$at_stderr" || at_failed=:
175822$at_diff expout "$at_stdout" || at_failed=:
175823at_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
175829fi
175830{ set +x
175831$as_echo "$at_srcdir/glr-regression.at:869: bison -o glr-regr10.c glr-regr10.y"
175832at_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>&-
175835at_status=$? at_failed=false
175836$at_check_filter
175837echo >>"$at_stderr"; $as_echo "glr-regr10.y: conflicts: 1 reduce/reduce
175838" | \
175839  $at_diff - "$at_stderr" || at_failed=:
175840at_fn_diff_devnull "$at_stdout" || at_failed=:
175841at_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"
175848at_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>&-
175851at_status=$? at_failed=false
175852$at_check_filter
175853echo stderr:; cat "$at_stderr"
175854echo stdout:; cat "$at_stdout"
175855at_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"
175861at_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>&-
175864at_status=$? at_failed=false
175865$at_check_filter
175866echo stderr:; cat "$at_stderr"
175867echo stdout:; cat "$at_stdout"
175868at_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"
175875at_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>&-
175878at_status=$? at_failed=false
175879$at_check_filter
175880echo stderr:; tee stderr <"$at_stderr"
175881at_fn_diff_devnull "$at_stdout" || at_failed=:
175882at_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"
175888at_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>&-
175891at_status=$? at_failed=false
175892$at_check_filter
175893at_fn_diff_devnull "$at_stderr" || at_failed=:
175894at_fn_diff_devnull "$at_stdout" || at_failed=:
175895at_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
175904read at_status <"$at_status_file"
175905#AT_STOP_340
175906#AT_START_341
175907at_fn_group_banner 341 'glr-regression.at:883' \
175908  "Undesirable destructors if user action cuts parse" "" 22
175909at_xfail=no
175910(
175911  $as_echo "341. $at_setup_line: testing $at_desc ..."
175912  $at_traceon
175913
175914
175915
175916cat >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
175941start:
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.  */
175950static
175951void yyerror ( const char *msg)
175952{
175953  fprintf (stderr, "%s\n", msg);
175954}
175955#include <assert.h>
175956static
175957int 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
175969int
175970main (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
175985if 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"
175993at_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>&-
175997at_status=$? at_failed=false
175998$at_check_filter
175999echo stderr:; cat "$at_stderr"
176000echo stdout:; cat "$at_stdout"
176001at_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"
176007at_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>&-
176010at_status=$? at_failed=false
176011$at_check_filter
176012echo stderr:; cat "$at_stderr"
176013echo stdout:; cat "$at_stdout"
176014at_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"
176023at_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>&-
176028at_status=$? at_failed=false
176029$at_check_filter
176030at_fn_diff_devnull "$at_stderr" || at_failed=:
176031$at_diff expout "$at_stdout" || at_failed=:
176032at_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"
176041at_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>&-
176046at_status=$? at_failed=false
176047$at_check_filter
176048at_fn_diff_devnull "$at_stderr" || at_failed=:
176049$at_diff expout "$at_stdout" || at_failed=:
176050at_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
176056fi
176057{ set +x
176058$as_echo "$at_srcdir/glr-regression.at:927: bison -o glr-regr11.c glr-regr11.y"
176059at_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>&-
176062at_status=$? at_failed=false
176063$at_check_filter
176064echo >>"$at_stderr"; $as_echo "glr-regr11.y: conflicts: 1 reduce/reduce
176065" | \
176066  $at_diff - "$at_stderr" || at_failed=:
176067at_fn_diff_devnull "$at_stdout" || at_failed=:
176068at_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"
176075at_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>&-
176078at_status=$? at_failed=false
176079$at_check_filter
176080echo stderr:; cat "$at_stderr"
176081echo stdout:; cat "$at_stdout"
176082at_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"
176088at_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>&-
176091at_status=$? at_failed=false
176092$at_check_filter
176093echo stderr:; cat "$at_stderr"
176094echo stdout:; cat "$at_stdout"
176095at_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"
176102at_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>&-
176105at_status=$? at_failed=false
176106$at_check_filter
176107echo stderr:; tee stderr <"$at_stderr"
176108at_fn_diff_devnull "$at_stdout" || at_failed=:
176109at_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"
176115at_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>&-
176118at_status=$? at_failed=false
176119$at_check_filter
176120at_fn_diff_devnull "$at_stderr" || at_failed=:
176121at_fn_diff_devnull "$at_stdout" || at_failed=:
176122at_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
176131read at_status <"$at_status_file"
176132#AT_STOP_341
176133#AT_START_342
176134at_fn_group_banner 342 'glr-regression.at:941' \
176135  "Leaked semantic values if user action cuts parse" "" 22
176136at_xfail=no
176137(
176138  $as_echo "342. $at_setup_line: testing $at_desc ..."
176139  $at_traceon
176140
176141
176142
176143cat >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
176175start:
176176  alt1 %dprec 1
176177  | alt2 %dprec 2
176178  ;
176179
176180alt1:
176181  PARENT_RHS_AFTER {
176182    USE ($1);
176183    parent_rhs_after_value = 0;
176184  }
176185  ;
176186
176187alt2:
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
176196parent_rhs_before:
176197  {
176198    USE ($$);
176199    parent_rhs_before_value = 1;
176200  }
176201  ;
176202
176203merged:
176204  %merge<merge> {
176205    USE ($$);
176206    merged_value = 1;
176207  }
176208  | cut %merge<merge> {
176209    USE ($$);
176210    merged_value = 1;
176211  }
176212  ;
176213
176214cut: { YYACCEPT; } ;
176215
176216%%
176217
176218static int
176219merge (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.  */
176228static
176229void yyerror ( const char *msg)
176230{
176231  fprintf (stderr, "%s\n", msg);
176232}
176233#include <assert.h>
176234static
176235int 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
176248int
176249main (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
176274if 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"
176282at_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>&-
176286at_status=$? at_failed=false
176287$at_check_filter
176288echo stderr:; cat "$at_stderr"
176289echo stdout:; cat "$at_stdout"
176290at_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"
176296at_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>&-
176299at_status=$? at_failed=false
176300$at_check_filter
176301echo stderr:; cat "$at_stderr"
176302echo stdout:; cat "$at_stdout"
176303at_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"
176312at_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>&-
176317at_status=$? at_failed=false
176318$at_check_filter
176319at_fn_diff_devnull "$at_stderr" || at_failed=:
176320$at_diff expout "$at_stdout" || at_failed=:
176321at_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"
176330at_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>&-
176335at_status=$? at_failed=false
176336$at_check_filter
176337at_fn_diff_devnull "$at_stderr" || at_failed=:
176338$at_diff expout "$at_stdout" || at_failed=:
176339at_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
176345fi
176346{ set +x
176347$as_echo "$at_srcdir/glr-regression.at:1048: bison -o glr-regr12.c glr-regr12.y"
176348at_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>&-
176351at_status=$? at_failed=false
176352$at_check_filter
176353echo >>"$at_stderr"; $as_echo "glr-regr12.y: conflicts: 1 shift/reduce, 1 reduce/reduce
176354" | \
176355  $at_diff - "$at_stderr" || at_failed=:
176356at_fn_diff_devnull "$at_stdout" || at_failed=:
176357at_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"
176364at_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>&-
176367at_status=$? at_failed=false
176368$at_check_filter
176369echo stderr:; cat "$at_stderr"
176370echo stdout:; cat "$at_stdout"
176371at_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"
176377at_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>&-
176380at_status=$? at_failed=false
176381$at_check_filter
176382echo stderr:; cat "$at_stderr"
176383echo stdout:; cat "$at_stdout"
176384at_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"
176391at_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>&-
176394at_status=$? at_failed=false
176395$at_check_filter
176396echo stderr:; tee stderr <"$at_stderr"
176397at_fn_diff_devnull "$at_stdout" || at_failed=:
176398at_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"
176404at_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>&-
176407at_status=$? at_failed=false
176408$at_check_filter
176409at_fn_diff_devnull "$at_stderr" || at_failed=:
176410at_fn_diff_devnull "$at_stdout" || at_failed=:
176411at_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
176420read at_status <"$at_status_file"
176421#AT_STOP_342
176422#AT_START_343
176423at_fn_group_banner 343 'glr-regression.at:1064' \
176424  "Incorrect lookahead during deterministic GLR" "   " 22
176425at_xfail=no
176426(
176427  $as_echo "343. $at_setup_line: testing $at_desc ..."
176428  $at_traceon
176429
176430
176431
176432cat >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
176465start:
176466  defstate_init defstate_shift 'b' change_lookahead 'a' {
176467    USE ($3);
176468    print_lookahead ("start <- defstate_init defstate_shift 'b'");
176469  }
176470  ;
176471defstate_init:
176472  {
176473    print_lookahead ("defstate_init <- empty string");
176474  }
176475  ;
176476defstate_shift:
176477  nondefstate defstate_look 'a' {
176478    USE ($3);
176479    print_lookahead ("defstate_shift <- nondefstate defstate_look 'a'");
176480  }
176481  ;
176482defstate_look:
176483  {
176484    print_lookahead ("defstate_look <- empty string");
176485  }
176486  ;
176487nondefstate:
176488  {
176489    print_lookahead ("nondefstate <- empty string");
176490  }
176491  | 'b' {
176492    USE ($1);
176493    print_lookahead ("nondefstate <- 'b'");
176494  }
176495  ;
176496change_lookahead:
176497  {
176498    yychar = 'a';
176499  }
176500  ;
176501
176502%%
176503
176504#include <stdio.h>
176505/* A C error reporting function.  */
176506static
176507void yyerror ( const char *msg)
176508{
176509  fprintf (stderr, "%s\n", msg);
176510}
176511#include <assert.h>
176512static
176513int 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
176525static void
176526print_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
176545int
176546main (void)
176547{
176548  yychar = '#'; /* Not a token in the grammar.  */
176549  yylval.value = '!';
176550  return yyparse ();
176551}
176552_ATEOF
176553
176554
176555
176556
176557if 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"
176565at_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>&-
176569at_status=$? at_failed=false
176570$at_check_filter
176571echo stderr:; cat "$at_stderr"
176572echo stdout:; cat "$at_stdout"
176573at_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"
176579at_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>&-
176582at_status=$? at_failed=false
176583$at_check_filter
176584echo stderr:; cat "$at_stderr"
176585echo stdout:; cat "$at_stdout"
176586at_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"
176595at_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>&-
176600at_status=$? at_failed=false
176601$at_check_filter
176602at_fn_diff_devnull "$at_stderr" || at_failed=:
176603$at_diff expout "$at_stdout" || at_failed=:
176604at_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"
176613at_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>&-
176618at_status=$? at_failed=false
176619$at_check_filter
176620at_fn_diff_devnull "$at_stderr" || at_failed=:
176621$at_diff expout "$at_stdout" || at_failed=:
176622at_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
176628fi
176629{ set +x
176630$as_echo "$at_srcdir/glr-regression.at:1165: bison -o glr-regr13.c glr-regr13.y"
176631at_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>&-
176634at_status=$? at_failed=false
176635$at_check_filter
176636at_fn_diff_devnull "$at_stderr" || at_failed=:
176637at_fn_diff_devnull "$at_stdout" || at_failed=:
176638at_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"
176645at_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>&-
176648at_status=$? at_failed=false
176649$at_check_filter
176650echo stderr:; cat "$at_stderr"
176651echo stdout:; cat "$at_stdout"
176652at_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"
176658at_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>&-
176661at_status=$? at_failed=false
176662$at_check_filter
176663echo stderr:; cat "$at_stderr"
176664echo stdout:; cat "$at_stdout"
176665at_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"
176672at_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>&-
176675at_status=$? at_failed=false
176676$at_check_filter
176677echo stderr:; tee stderr <"$at_stderr"
176678echo >>"$at_stdout"; $as_echo "defstate_init <- empty string:
176679  yychar=YYEMPTY
176680nondefstate <- empty string:
176681  yychar='a', yylval='A', yylloc=(1,1),(1,1)
176682defstate_look <- empty string:
176683  yychar='a', yylval='A', yylloc=(1,1),(1,1)
176684defstate_shift <- nondefstate defstate_look 'a':
176685  yychar=YYEMPTY
176686start <- defstate_init defstate_shift 'b':
176687  yychar=YYEMPTY
176688" | \
176689  $at_diff - "$at_stdout" || at_failed=:
176690at_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"
176696at_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>&-
176699at_status=$? at_failed=false
176700$at_check_filter
176701at_fn_diff_devnull "$at_stderr" || at_failed=:
176702at_fn_diff_devnull "$at_stdout" || at_failed=:
176703at_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
176712read at_status <"$at_status_file"
176713#AT_STOP_343
176714#AT_START_344
176715at_fn_group_banner 344 'glr-regression.at:1188' \
176716  "Incorrect lookahead during nondeterministic GLR" "" 22
176717at_xfail=no
176718(
176719  $as_echo "344. $at_setup_line: testing $at_desc ..."
176720  $at_traceon
176721
176722
176723
176724cat >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
176772start:
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.  */
176780merge:
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
176792nonconflict1:
176793  {
176794    print_lookahead ("nonconflict1 <- empty string");
176795  }
176796  ;
176797nonconflict2:
176798  {
176799    print_lookahead ("nonconflict2 <- empty string");
176800  }
176801  | 'a' {
176802    USE ($1);
176803    print_lookahead ("nonconflict2 <- 'a'");
176804  }
176805  ;
176806conflict:
176807  {
176808    print_lookahead ("conflict <- empty string");
176809  }
176810  ;
176811defstate_look:
176812  {
176813    print_lookahead ("defstate_look <- empty string");
176814  }
176815  ;
176816
176817/* yychar != YYEMPTY but lookahead need is yyfalse.  */
176818defstate_shift:
176819  {
176820    print_lookahead ("defstate_shift <- empty string");
176821  }
176822  ;
176823
176824stack_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  ;
176830alt1:
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  ;
176839alt2:
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  ;
176848alt3:
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  ;
176857no_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.  */
176871static
176872void yyerror ( const char *msg)
176873{
176874  fprintf (stderr, "%s\n", msg);
176875}
176876static int
176877yylex (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
176888static void
176889print_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
176908static char
176909merge (union YYSTYPE s1, union YYSTYPE s2)
176910{
176911  char dummy = s1.value + s2.value;
176912  return dummy;
176913}
176914
176915int
176916main (void)
176917{
176918  yychar = '#'; /* Not a token in the grammar.  */
176919  yylval.value = '!';
176920  return yyparse ();
176921}
176922_ATEOF
176923
176924
176925
176926
176927if 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"
176935at_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>&-
176939at_status=$? at_failed=false
176940$at_check_filter
176941echo stderr:; cat "$at_stderr"
176942echo stdout:; cat "$at_stdout"
176943at_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"
176949at_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>&-
176952at_status=$? at_failed=false
176953$at_check_filter
176954echo stderr:; cat "$at_stderr"
176955echo stdout:; cat "$at_stdout"
176956at_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"
176965at_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>&-
176970at_status=$? at_failed=false
176971$at_check_filter
176972at_fn_diff_devnull "$at_stderr" || at_failed=:
176973$at_diff expout "$at_stdout" || at_failed=:
176974at_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"
176983at_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>&-
176988at_status=$? at_failed=false
176989$at_check_filter
176990at_fn_diff_devnull "$at_stderr" || at_failed=:
176991$at_diff expout "$at_stdout" || at_failed=:
176992at_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
176998fi
176999{ set +x
177000$as_echo "$at_srcdir/glr-regression.at:1378: bison -o glr-regr14.c glr-regr14.y"
177001at_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>&-
177004at_status=$? at_failed=false
177005$at_check_filter
177006echo >>"$at_stderr"; $as_echo "glr-regr14.y: conflicts: 3 reduce/reduce
177007" | \
177008  $at_diff - "$at_stderr" || at_failed=:
177009at_fn_diff_devnull "$at_stdout" || at_failed=:
177010at_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"
177017at_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>&-
177020at_status=$? at_failed=false
177021$at_check_filter
177022echo stderr:; cat "$at_stderr"
177023echo stdout:; cat "$at_stdout"
177024at_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"
177030at_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>&-
177033at_status=$? at_failed=false
177034$at_check_filter
177035echo stderr:; cat "$at_stderr"
177036echo stdout:; cat "$at_stdout"
177037at_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"
177044at_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>&-
177047at_status=$? at_failed=false
177048$at_check_filter
177049echo stderr:; tee stderr <"$at_stderr"
177050echo >>"$at_stdout"; $as_echo "conflict <- empty string:
177051  yychar='a', yylval='A', yylloc=(1,1),(1,1)
177052defstate_look <- empty string:
177053  yychar='a', yylval='A', yylloc=(1,1),(1,1)
177054nonconflict2 <- empty string:
177055  yychar='b', yylval='B', yylloc=(1,2),(1,2)
177056defstate_shift <- empty string:
177057  yychar=YYEMPTY
177058merge <- conflict defstate_look 'a' nonconflict2 'b' defstate_shift:
177059  yychar=YYEMPTY
177060start <- merge 'c' stack_explosion:
177061  yychar=YYEOF
177062" | \
177063  $at_diff - "$at_stdout" || at_failed=:
177064at_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"
177070at_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>&-
177073at_status=$? at_failed=false
177074$at_check_filter
177075at_fn_diff_devnull "$at_stderr" || at_failed=:
177076at_fn_diff_devnull "$at_stdout" || at_failed=:
177077at_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
177086read at_status <"$at_status_file"
177087#AT_STOP_344
177088#AT_START_345
177089at_fn_group_banner 345 'glr-regression.at:1405' \
177090  "Leaked semantic values when reporting ambiguity" "" 22
177091at_xfail=no
177092(
177093  $as_echo "345. $at_setup_line: testing $at_desc ..."
177094  $at_traceon
177095
177096
177097
177098cat >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
177121start:
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.  */
177131alt1: ;
177132
177133alt2:
177134  parent_rhs_before ambiguity {
177135    USE ($1);
177136    parent_rhs_before_value = 0;
177137  }
177138  ;
177139
177140parent_rhs_before:
177141  {
177142    USE ($$);
177143    parent_rhs_before_value = 1;
177144  }
177145  ;
177146
177147ambiguity: ambiguity1 | ambiguity2 ;
177148ambiguity1: ;
177149ambiguity2: ;
177150
177151%%
177152#include <stdio.h>
177153/* A C error reporting function.  */
177154static
177155void yyerror ( const char *msg)
177156{
177157  fprintf (stderr, "%s\n", msg);
177158}
177159#include <assert.h>
177160static
177161int 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
177173int
177174main (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
177189if 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"
177197at_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>&-
177201at_status=$? at_failed=false
177202$at_check_filter
177203echo stderr:; cat "$at_stderr"
177204echo stdout:; cat "$at_stdout"
177205at_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"
177211at_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>&-
177214at_status=$? at_failed=false
177215$at_check_filter
177216echo stderr:; cat "$at_stderr"
177217echo stdout:; cat "$at_stdout"
177218at_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"
177227at_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>&-
177232at_status=$? at_failed=false
177233$at_check_filter
177234at_fn_diff_devnull "$at_stderr" || at_failed=:
177235$at_diff expout "$at_stdout" || at_failed=:
177236at_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"
177245at_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>&-
177250at_status=$? at_failed=false
177251$at_check_filter
177252at_fn_diff_devnull "$at_stderr" || at_failed=:
177253$at_diff expout "$at_stdout" || at_failed=:
177254at_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
177260fi
177261{ set +x
177262$as_echo "$at_srcdir/glr-regression.at:1471: bison -o glr-regr15.c glr-regr15.y"
177263at_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>&-
177266at_status=$? at_failed=false
177267$at_check_filter
177268echo >>"$at_stderr"; $as_echo "glr-regr15.y: conflicts: 2 reduce/reduce
177269" | \
177270  $at_diff - "$at_stderr" || at_failed=:
177271at_fn_diff_devnull "$at_stdout" || at_failed=:
177272at_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"
177279at_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>&-
177282at_status=$? at_failed=false
177283$at_check_filter
177284echo stderr:; cat "$at_stderr"
177285echo stdout:; cat "$at_stdout"
177286at_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"
177292at_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>&-
177295at_status=$? at_failed=false
177296$at_check_filter
177297echo stderr:; cat "$at_stderr"
177298echo stdout:; cat "$at_stdout"
177299at_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"
177306at_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>&-
177309at_status=$? at_failed=false
177310$at_check_filter
177311echo stderr:; tee stderr <"$at_stderr"
177312at_fn_diff_devnull "$at_stdout" || at_failed=:
177313at_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"
177319at_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>&-
177322at_status=$? at_failed=false
177323$at_check_filter
177324echo >>"$at_stderr"; $as_echo "syntax is ambiguous
177325" | \
177326  $at_diff - "$at_stderr" || at_failed=:
177327at_fn_diff_devnull "$at_stdout" || at_failed=:
177328at_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
177337read at_status <"$at_status_file"
177338#AT_STOP_345
177339#AT_START_346
177340at_fn_group_banner 346 'glr-regression.at:1487' \
177341  "Leaked lookahead after nondeterministic parse syntax error" "" 22
177342at_xfail=no
177343(
177344  $as_echo "346. $at_setup_line: testing $at_desc ..."
177345  $at_traceon
177346
177347
177348
177349cat >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
177373start: alt1 'a' | alt2 'a' ;
177374alt1: ;
177375alt2: ;
177376
177377%%
177378
177379#include <stdio.h>
177380/* A C error reporting function.  */
177381static
177382void yyerror ( const char *msg)
177383{
177384  fprintf (stderr, "%s\n", msg);
177385}
177386#include <assert.h>
177387static
177388int 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
177401int
177402main (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
177417if 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"
177425at_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>&-
177429at_status=$? at_failed=false
177430$at_check_filter
177431echo stderr:; cat "$at_stderr"
177432echo stdout:; cat "$at_stdout"
177433at_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"
177439at_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>&-
177442at_status=$? at_failed=false
177443$at_check_filter
177444echo stderr:; cat "$at_stderr"
177445echo stdout:; cat "$at_stdout"
177446at_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"
177455at_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>&-
177460at_status=$? at_failed=false
177461$at_check_filter
177462at_fn_diff_devnull "$at_stderr" || at_failed=:
177463$at_diff expout "$at_stdout" || at_failed=:
177464at_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"
177473at_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>&-
177478at_status=$? at_failed=false
177479$at_check_filter
177480at_fn_diff_devnull "$at_stderr" || at_failed=:
177481$at_diff expout "$at_stdout" || at_failed=:
177482at_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
177488fi
177489{ set +x
177490$as_echo "$at_srcdir/glr-regression.at:1531: bison -o glr-regr16.c glr-regr16.y"
177491at_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>&-
177494at_status=$? at_failed=false
177495$at_check_filter
177496echo >>"$at_stderr"; $as_echo "glr-regr16.y: conflicts: 1 reduce/reduce
177497" | \
177498  $at_diff - "$at_stderr" || at_failed=:
177499at_fn_diff_devnull "$at_stdout" || at_failed=:
177500at_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"
177507at_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>&-
177510at_status=$? at_failed=false
177511$at_check_filter
177512echo stderr:; cat "$at_stderr"
177513echo stdout:; cat "$at_stdout"
177514at_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"
177520at_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>&-
177523at_status=$? at_failed=false
177524$at_check_filter
177525echo stderr:; cat "$at_stderr"
177526echo stdout:; cat "$at_stdout"
177527at_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"
177534at_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>&-
177537at_status=$? at_failed=false
177538$at_check_filter
177539echo stderr:; tee stderr <"$at_stderr"
177540at_fn_diff_devnull "$at_stdout" || at_failed=:
177541at_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"
177547at_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>&-
177550at_status=$? at_failed=false
177551$at_check_filter
177552echo >>"$at_stderr"; $as_echo "syntax error
177553" | \
177554  $at_diff - "$at_stderr" || at_failed=:
177555at_fn_diff_devnull "$at_stdout" || at_failed=:
177556at_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
177565read at_status <"$at_status_file"
177566#AT_STOP_346
177567#AT_START_347
177568at_fn_group_banner 347 'glr-regression.at:1547' \
177569  "Uninitialized location when reporting ambiguity" "" 22
177570at_xfail=no
177571(
177572  $as_echo "347. $at_setup_line: testing $at_desc ..."
177573  $at_traceon
177574
177575
177576
177577
177578cat >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.  */
177605start: ambig1 empty1 | ambig2 empty2 ;
177606
177607/* Tests multiple levels of yyresolveLocations recursion.  */
177608ambig1: sub_ambig1 | sub_ambig2 ;
177609ambig2: 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.  */
177614sub_ambig1: empty1 'a' 'b' ;
177615sub_ambig2: empty2 'a' 'b' ;
177616empty1: ;
177617empty2: ;
177618
177619%%
177620# include <assert.h>
177621
177622#include <stdio.h>
177623/* A C error reporting function.  */
177624static
177625void 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}
177631static int
177632yylex (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
177644int
177645main (void)
177646{
177647  return yyparse () != 1;
177648}
177649_ATEOF
177650
177651
177652
177653
177654if 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"
177662at_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>&-
177666at_status=$? at_failed=false
177667$at_check_filter
177668echo stderr:; cat "$at_stderr"
177669echo stdout:; cat "$at_stdout"
177670at_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"
177676at_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>&-
177679at_status=$? at_failed=false
177680$at_check_filter
177681echo stderr:; cat "$at_stderr"
177682echo stdout:; cat "$at_stdout"
177683at_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"
177692at_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>&-
177697at_status=$? at_failed=false
177698$at_check_filter
177699at_fn_diff_devnull "$at_stderr" || at_failed=:
177700$at_diff expout "$at_stdout" || at_failed=:
177701at_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"
177710at_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>&-
177715at_status=$? at_failed=false
177716$at_check_filter
177717at_fn_diff_devnull "$at_stderr" || at_failed=:
177718$at_diff expout "$at_stdout" || at_failed=:
177719at_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
177725fi
177726{ set +x
177727$as_echo "$at_srcdir/glr-regression.at:1609: bison -o glr-regr17.c glr-regr17.y"
177728at_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>&-
177731at_status=$? at_failed=false
177732$at_check_filter
177733echo >>"$at_stderr"; $as_echo "glr-regr17.y: conflicts: 3 reduce/reduce
177734" | \
177735  $at_diff - "$at_stderr" || at_failed=:
177736at_fn_diff_devnull "$at_stdout" || at_failed=:
177737at_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"
177744at_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>&-
177747at_status=$? at_failed=false
177748$at_check_filter
177749echo stderr:; cat "$at_stderr"
177750echo stdout:; cat "$at_stdout"
177751at_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"
177757at_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>&-
177760at_status=$? at_failed=false
177761$at_check_filter
177762echo stderr:; cat "$at_stderr"
177763echo stdout:; cat "$at_stdout"
177764at_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"
177771at_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>&-
177774at_status=$? at_failed=false
177775$at_check_filter
177776echo stderr:; tee stderr <"$at_stderr"
177777at_fn_diff_devnull "$at_stdout" || at_failed=:
177778at_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"
177784at_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>&-
177787at_status=$? at_failed=false
177788$at_check_filter
177789echo >>"$at_stderr"; $as_echo "1.1-2.2: syntax is ambiguous
177790" | \
177791  $at_diff - "$at_stderr" || at_failed=:
177792at_fn_diff_devnull "$at_stdout" || at_failed=:
177793at_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
177802read at_status <"$at_status_file"
177803#AT_STOP_347
177804#AT_START_348
177805at_fn_group_banner 348 'glr-regression.at:1625' \
177806  "Missed %merge type warnings when LHS type is declared later" "" 22
177807at_xfail=no
177808(
177809  $as_echo "348. $at_setup_line: testing $at_desc ..."
177810  $at_traceon
177811
177812
177813
177814cat >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
177839sym1: sym2 %merge<merge> { $$ = $1; } ;
177840sym2: sym3 %merge<merge> { $$ = $1; } ;
177841sym3: %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.  */
177850static
177851void yyerror ( const char *msg)
177852{
177853  fprintf (stderr, "%s\n", msg);
177854}
177855#include <assert.h>
177856static
177857int 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}
177868int
177869main (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"
177881at_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>&-
177884at_status=$? at_failed=false
177885$at_check_filter
177886echo >>"$at_stderr"; $as_echo "glr-regr18.y:26.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
177887glr-regr18.y:25.18-24:     previous declaration
177888glr-regr18.y:27.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
177889glr-regr18.y:26.18-24:     previous declaration
177890" | \
177891  $at_diff - "$at_stderr" || at_failed=:
177892at_fn_diff_devnull "$at_stdout" || at_failed=:
177893at_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
177902read at_status <"$at_status_file"
177903#AT_STOP_348
177904#AT_START_349
177905at_fn_group_banner 349 'glr-regression.at:1678' \
177906  "Ambiguity reports" "                              " 22
177907at_xfail=no
177908(
177909  $as_echo "349. $at_setup_line: testing $at_desc ..."
177910  $at_traceon
177911
177912
177913
177914cat >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%%
177935start:
177936  'a' b 'c' d
177937| 'a' b 'c' d
177938;
177939b: 'b';
177940d: /* nada.  */;
177941%%
177942#include <assert.h>
177943static
177944int 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.  */
177957static
177958void yyerror ( const char *msg)
177959{
177960  fprintf (stderr, "%s\n", msg);
177961}
177962int
177963main (void)
177964{
177965  yydebug = 1;
177966  return !!yyparse ();
177967}
177968_ATEOF
177969
177970
177971
177972
177973if 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"
177981at_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>&-
177985at_status=$? at_failed=false
177986$at_check_filter
177987echo stderr:; cat "$at_stderr"
177988echo stdout:; cat "$at_stdout"
177989at_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"
177995at_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>&-
177998at_status=$? at_failed=false
177999$at_check_filter
178000echo stderr:; cat "$at_stderr"
178001echo stdout:; cat "$at_stdout"
178002at_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"
178011at_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>&-
178016at_status=$? at_failed=false
178017$at_check_filter
178018at_fn_diff_devnull "$at_stderr" || at_failed=:
178019$at_diff expout "$at_stdout" || at_failed=:
178020at_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"
178029at_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>&-
178034at_status=$? at_failed=false
178035$at_check_filter
178036at_fn_diff_devnull "$at_stderr" || at_failed=:
178037$at_diff expout "$at_stdout" || at_failed=:
178038at_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
178044fi
178045{ set +x
178046$as_echo "$at_srcdir/glr-regression.at:1712: bison -o input.c input.y"
178047at_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>&-
178050at_status=$? at_failed=false
178051$at_check_filter
178052echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
178053" | \
178054  $at_diff - "$at_stderr" || at_failed=:
178055at_fn_diff_devnull "$at_stdout" || at_failed=:
178056at_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"
178063at_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>&-
178066at_status=$? at_failed=false
178067$at_check_filter
178068echo stderr:; cat "$at_stderr"
178069echo stdout:; cat "$at_stdout"
178070at_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"
178076at_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>&-
178079at_status=$? at_failed=false
178080$at_check_filter
178081echo stderr:; cat "$at_stderr"
178082echo stdout:; cat "$at_stdout"
178083at_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"
178090at_fn_check_prepare_dynamic " $PREPARSER ./input" "glr-regression.at:1717"
178091( $at_check_trace;  $PREPARSER ./input
178092) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178093at_status=$? at_failed=false
178094$at_check_filter
178095echo stderr:; tee stderr <"$at_stderr"
178096at_fn_diff_devnull "$at_stdout" || at_failed=:
178097at_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"
178103at_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>&-
178106at_status=$? at_failed=false
178107$at_check_filter
178108echo >>"$at_stderr"; $as_echo "Starting parse
178109Entering state 0
178110Reading a token: Next token is token 'a' ()
178111Shifting token 'a' ()
178112Entering state 1
178113Reading a token: Next token is token 'b' ()
178114Shifting token 'b' ()
178115Entering state 3
178116Reducing stack 0 by rule 3 (line 25):
178117   \$1 = token 'b' ()
178118-> \$\$ = nterm b ()
178119Entering state 4
178120Reading a token: Next token is token 'c' ()
178121Shifting token 'c' ()
178122Entering state 6
178123Reducing stack 0 by rule 4 (line 26):
178124-> \$\$ = nterm d ()
178125Entering state 7
178126Reading a token: Now at end of input.
178127Stack 0 Entering state 7
178128Now at end of input.
178129Splitting off stack 1 from 0.
178130Reduced stack 1 by rule #2; action deferred.  Now in state 2.
178131Stack 1 Entering state 2
178132Now at end of input.
178133Reduced stack 0 by rule #1; action deferred.  Now in state 2.
178134Merging stack 0 into stack 1.
178135Stack 1 Entering state 2
178136Now at end of input.
178137Removing dead stacks.
178138Rename stack 1 -> 0.
178139On stack 0, shifting token \$end ()
178140Stack 0 now in state #5
178141Ambiguity detected.
178142Option 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
178149Option 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
178156syntax is ambiguous
178157Cleanup: popping token \$end ()
178158Cleanup: popping unresolved nterm start ()
178159Cleanup: popping nterm d ()
178160Cleanup: popping token 'c' ()
178161Cleanup: popping nterm b ()
178162Cleanup: popping token 'a' ()
178163" | \
178164  $at_diff - "$at_stderr" || at_failed=:
178165at_fn_diff_devnull "$at_stdout" || at_failed=:
178166at_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
178175read at_status <"$at_status_file"
178176#AT_STOP_349
178177#AT_START_350
178178at_fn_group_banner 350 'push.at:24' \
178179  "Memory Leak for Early Deletion" "                 " 23
178180at_xfail=no
178181(
178182  $as_echo "350. $at_setup_line: testing $at_desc ..."
178183  $at_traceon
178184
178185
178186# Requires Valgrind.
178187
178188cat >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
178202static void yyerror ( const char *msg);
178203%}
178204
178205%define api.pure
178206%define api.push-pull push
178207
178208%%
178209
178210start: 'a' 'b' 'c' ;
178211
178212%%
178213
178214#include <stdio.h>
178215/* A C error reporting function.  */
178216static
178217void yyerror ( const char *msg)
178218{
178219  fprintf (stderr, "%s\n", msg);
178220}
178221
178222int
178223main (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
178249if 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"
178257at_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>&-
178261at_status=$? at_failed=false
178262$at_check_filter
178263echo stderr:; cat "$at_stderr"
178264echo stdout:; cat "$at_stdout"
178265at_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"
178271at_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>&-
178274at_status=$? at_failed=false
178275$at_check_filter
178276echo stderr:; cat "$at_stderr"
178277echo stdout:; cat "$at_stdout"
178278at_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"
178287at_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>&-
178292at_status=$? at_failed=false
178293$at_check_filter
178294at_fn_diff_devnull "$at_stderr" || at_failed=:
178295$at_diff expout "$at_stdout" || at_failed=:
178296at_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"
178305at_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>&-
178310at_status=$? at_failed=false
178311$at_check_filter
178312at_fn_diff_devnull "$at_stderr" || at_failed=:
178313$at_diff expout "$at_stdout" || at_failed=:
178314at_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
178320fi
178321{ set +x
178322$as_echo "$at_srcdir/push.at:73: bison -o input.c input.y"
178323at_fn_check_prepare_trace "push.at:73"
178324( $at_check_trace; bison -o input.c input.y
178325) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178326at_status=$? at_failed=false
178327$at_check_filter
178328at_fn_diff_devnull "$at_stderr" || at_failed=:
178329at_fn_diff_devnull "$at_stdout" || at_failed=:
178330at_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"
178337at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74"
178338( $at_check_trace; $BISON_C_WORKS
178339) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178340at_status=$? at_failed=false
178341$at_check_filter
178342echo stderr:; cat "$at_stderr"
178343echo stdout:; cat "$at_stdout"
178344at_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"
178350at_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>&-
178353at_status=$? at_failed=false
178354$at_check_filter
178355echo stderr:; cat "$at_stderr"
178356echo stdout:; cat "$at_stdout"
178357at_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"
178363at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75"
178364( $at_check_trace;  $PREPARSER ./input
178365) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178366at_status=$? at_failed=false
178367$at_check_filter
178368echo stderr:; tee stderr <"$at_stderr"
178369at_fn_diff_devnull "$at_stdout" || at_failed=:
178370at_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"
178376at_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>&-
178379at_status=$? at_failed=false
178380$at_check_filter
178381at_fn_diff_devnull "$at_stderr" || at_failed=:
178382at_fn_diff_devnull "$at_stdout" || at_failed=:
178383at_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
178392read at_status <"$at_status_file"
178393#AT_STOP_350
178394#AT_START_351
178395at_fn_group_banner 351 'push.at:83' \
178396  "Multiple impure instances" "                      " 23
178397at_xfail=no
178398(
178399  $as_echo "351. $at_setup_line: testing $at_desc ..."
178400  $at_traceon
178401
178402
178403
178404
178405
178406
178407cat >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>
178420static void yyerror ( const char *msg);
178421static int yylex (void);
178422%}
178423
178424%define api.push-pull both
178425
178426%%
178427
178428start: ;
178429
178430%%
178431#include <stdio.h>
178432/* A C error reporting function.  */
178433static
178434void yyerror ( const char *msg)
178435{
178436  fprintf (stderr, "%s\n", msg);
178437}
178438#include <assert.h>
178439static
178440int 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
178452int
178453main (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
178475if 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"
178483at_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>&-
178487at_status=$? at_failed=false
178488$at_check_filter
178489echo stderr:; cat "$at_stderr"
178490echo stdout:; cat "$at_stdout"
178491at_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"
178497at_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>&-
178500at_status=$? at_failed=false
178501$at_check_filter
178502echo stderr:; cat "$at_stderr"
178503echo stdout:; cat "$at_stdout"
178504at_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"
178513at_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>&-
178518at_status=$? at_failed=false
178519$at_check_filter
178520at_fn_diff_devnull "$at_stderr" || at_failed=:
178521$at_diff expout "$at_stdout" || at_failed=:
178522at_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"
178531at_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>&-
178536at_status=$? at_failed=false
178537$at_check_filter
178538at_fn_diff_devnull "$at_stderr" || at_failed=:
178539$at_diff expout "$at_stdout" || at_failed=:
178540at_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
178546fi
178547{ set +x
178548$as_echo "$at_srcdir/push.at:133: bison -o input.c input.y"
178549at_fn_check_prepare_trace "push.at:133"
178550( $at_check_trace; bison -o input.c input.y
178551) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178552at_status=$? at_failed=false
178553$at_check_filter
178554at_fn_diff_devnull "$at_stderr" || at_failed=:
178555at_fn_diff_devnull "$at_stdout" || at_failed=:
178556at_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"
178563at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133"
178564( $at_check_trace; $BISON_C_WORKS
178565) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178566at_status=$? at_failed=false
178567$at_check_filter
178568echo stderr:; cat "$at_stderr"
178569echo stdout:; cat "$at_stdout"
178570at_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"
178576at_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>&-
178579at_status=$? at_failed=false
178580$at_check_filter
178581echo stderr:; cat "$at_stderr"
178582echo stdout:; cat "$at_stdout"
178583at_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"
178589at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133"
178590( $at_check_trace;  $PREPARSER ./input
178591) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178592at_status=$? at_failed=false
178593$at_check_filter
178594echo stderr:; tee stderr <"$at_stderr"
178595at_fn_diff_devnull "$at_stdout" || at_failed=:
178596at_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"
178602at_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>&-
178605at_status=$? at_failed=false
178606$at_check_filter
178607at_fn_diff_devnull "$at_stderr" || at_failed=:
178608at_fn_diff_devnull "$at_stdout" || at_failed=:
178609at_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
178618cat >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>
178631static void yyerror ( const char *msg);
178632
178633%}
178634
178635%define api.push-pull push
178636
178637%%
178638
178639start: ;
178640
178641%%
178642#include <stdio.h>
178643/* A C error reporting function.  */
178644static
178645void yyerror ( const char *msg)
178646{
178647  fprintf (stderr, "%s\n", msg);
178648}
178649
178650
178651int
178652main (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
178674if 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"
178682at_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>&-
178686at_status=$? at_failed=false
178687$at_check_filter
178688echo stderr:; cat "$at_stderr"
178689echo stdout:; cat "$at_stdout"
178690at_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"
178696at_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>&-
178699at_status=$? at_failed=false
178700$at_check_filter
178701echo stderr:; cat "$at_stderr"
178702echo stdout:; cat "$at_stdout"
178703at_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"
178712at_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>&-
178717at_status=$? at_failed=false
178718$at_check_filter
178719at_fn_diff_devnull "$at_stderr" || at_failed=:
178720$at_diff expout "$at_stdout" || at_failed=:
178721at_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"
178730at_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>&-
178735at_status=$? at_failed=false
178736$at_check_filter
178737at_fn_diff_devnull "$at_stderr" || at_failed=:
178738$at_diff expout "$at_stdout" || at_failed=:
178739at_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
178745fi
178746{ set +x
178747$as_echo "$at_srcdir/push.at:134: bison -o input.c input.y"
178748at_fn_check_prepare_trace "push.at:134"
178749( $at_check_trace; bison -o input.c input.y
178750) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178751at_status=$? at_failed=false
178752$at_check_filter
178753at_fn_diff_devnull "$at_stderr" || at_failed=:
178754at_fn_diff_devnull "$at_stdout" || at_failed=:
178755at_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"
178762at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134"
178763( $at_check_trace; $BISON_C_WORKS
178764) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178765at_status=$? at_failed=false
178766$at_check_filter
178767echo stderr:; cat "$at_stderr"
178768echo stdout:; cat "$at_stdout"
178769at_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"
178775at_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>&-
178778at_status=$? at_failed=false
178779$at_check_filter
178780echo stderr:; cat "$at_stderr"
178781echo stdout:; cat "$at_stdout"
178782at_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"
178788at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134"
178789( $at_check_trace;  $PREPARSER ./input
178790) >>"$at_stdout" 2>>"$at_stderr" 5>&-
178791at_status=$? at_failed=false
178792$at_check_filter
178793echo stderr:; tee stderr <"$at_stderr"
178794at_fn_diff_devnull "$at_stdout" || at_failed=:
178795at_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"
178801at_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>&-
178804at_status=$? at_failed=false
178805$at_check_filter
178806at_fn_diff_devnull "$at_stderr" || at_failed=:
178807at_fn_diff_devnull "$at_stdout" || at_failed=:
178808at_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
178821read at_status <"$at_status_file"
178822#AT_STOP_351
178823#AT_START_352
178824at_fn_group_banner 352 'push.at:144' \
178825  "Unsupported Skeletons" "                          " 23
178826at_xfail=no
178827(
178828  $as_echo "352. $at_setup_line: testing $at_desc ..."
178829  $at_traceon
178830
178831
178832
178833cat >input.y <<'_ATEOF'
178834%glr-parser
178835%define api.push-pull push
178836%%
178837start: ;
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"
178845at_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>&-
178848at_status=$? at_failed=false
178849$at_check_filter
178850echo >>"$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=:
178853at_fn_diff_devnull "$at_stdout" || at_failed=:
178854at_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
178863read at_status <"$at_status_file"
178864#AT_STOP_352
178865