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