#! /bin/sh # Generated from ../../../tests/local.at by GNU Autoconf 2.69. # # Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? ':' means no, empty means yes. at_verbose=: at_quiet= # Running several jobs in parallel, 0 means as many as test groups. at_jobs=1 at_traceon=: at_trace_echo=: at_check_filter_trace=: # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # Display the version message? at_version_p=false # List test groups? at_list_p=false # --clean at_clean=false # Test groups to run at_groups= # Whether to rerun failed tests. at_recheck= # Whether a write failure occurred at_write_fail=0 # The directory we run the suite in. Default to . if no -C option. at_dir=`pwd` # An absolute reference to this testsuite script. case $as_myself in [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;; * ) at_myself=$at_dir/$as_myself ;; esac # Whether -C is in effect. at_change_dir=false # Whether to enable colored test results. at_color=auto # List of the tested programs. at_tested='bison' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='???' # Description of all the test groups. at_help_all="1;input.at:27;Invalid inputs;; 2;input.at:57;Invalid inputs with {};; 3;input.at:84;Invalid \$n and @n;; 4;input.at:104;Type Clashes;; 5;input.at:285;Unused values;; 6;input.at:295;Unused values before symbol declarations;; 7;input.at:305;Default %printer and %destructor redeclared;; 8;input.at:365;Per-type %printer and %destructor redeclared;; 9;input.at:408;Unused values with default %destructor;; 10;input.at:450;Unused values with per-type %destructor;; 11;input.at:475;Incompatible Aliases;; 12;input.at:516;Torturing the Scanner;; 13;input.at:674;Typed symbol aliases;; 14;input.at:710;Require 1.0;; 15;input.at:711;Require 2.7;; 16;input.at:713;Require 100.0;; 17;input.at:720;String aliases for character tokens;; 18;input.at:741;Symbols;; 19;input.at:807;Numbered tokens;; 20;input.at:845;Unclosed constructs;; 21;input.at:909;%start after first rule;; 22;input.at:930;%prec takes a token;; 23;input.at:951;%prec's token must be defined;; 24;input.at:971;Reject unused %code qualifiers;; 25;input.at:1060;%define errors;; 26;input.at:1096;%define, --define, --force-define;; 27;input.at:1161;%define Boolean variables;; 28;input.at:1181;%define enum variables;; 29;input.at:1216;%define backward compatibility;; 30;input.at:1257;Unused %define api.pure;; 31;input.at:1290;C++ namespace reference errors;; 32;input.at:1346;Bad character literals;; 33;input.at:1399;Bad escapes in literals;; 34;input.at:1448;LAC: Errors for %define;; 35;input.at:1471;-Werror is not affected by -Wnone and -Wall;; 36;input.at:1505;%name-prefix and %define api.prefix are incompatible;; 37;input.at:1534;Stray \$ or @;; 38;input.at:1568;Code injection;; 39;named-refs.at:21;Tutorial calculator;; 40;named-refs.at:195;Undefined and ambiguous references;; 41;named-refs.at:271;Misleading references;; 42;named-refs.at:288;Many kinds of errors;; 43;named-refs.at:521;Missing identifiers in brackets;; 44;named-refs.at:535;Redundant words in brackets;; 45;named-refs.at:549;Comments in brackets;; 46;named-refs.at:563;Stray symbols in brackets;; 47;named-refs.at:580;Redundant words in LHS brackets;; 48;named-refs.at:595;Factored LHS;; 49;named-refs.at:606;Unresolved references;; 50;named-refs.at:671;\$ or @ followed by . or -;; 51;output.at:44;Output files: -dv ;; 52;output.at:50;Output files: -dv >&-;; 53;output.at:55;Output files: -dv -o foo.c ;; 54;output.at:57;Output files: -dv -o foo.tab.c ;; 55;output.at:59;Output files: -dv -y ;; 56;output.at:61;Output files: -dv -b bar ;; 57;output.at:63;Output files: -dv -g -o foo.c ;; 58;output.at:67;Output files: %defines %verbose ;; 59;output.at:69;Output files: %defines %verbose %yacc ;; 60;output.at:72;Output files: %defines %verbose %yacc ;; 61;output.at:76;Output files: %file-prefix \"bar\" %defines %verbose ;; 62;output.at:78;Output files: %output=\"bar.c\" %defines %verbose %yacc ;; 63;output.at:80;Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc ;; 64;output.at:87;Output files: %defines %verbose ;; 65;output.at:90;Output files: %defines %verbose -o foo.c ;; 66;output.at:93;Output files: --defines=foo.hpp -o foo.c++ ;; 67;output.at:97;Output files: %defines \"foo.hpp\" -o foo.c++ ;; 68;output.at:101;Output files: -o foo.c++ --graph=foo.gph ;; 69;output.at:116;Output files: %skeleton \"lalr1.cc\" %defines %verbose ;; 70;output.at:119;Output files: %skeleton \"lalr1.cc\" %defines %verbose ;; 71;output.at:123;Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc ;; 72;output.at:128;Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\" ;; 73;output.at:158;Conflicting output files: --graph=\"foo.tab.c\";; 74;output.at:163;Conflicting output files: %defines \"foo.output\" -v;; 75;output.at:168;Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\";; 76;output.at:173;Conflicting output files: -o foo.y;; 77;output.at:219;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++; 78;output.at:226;Output file name: (;c++; 79;output.at:227;Output file name: );c++; 80;output.at:228;Output file name: #;c++; 81;output.at:229;Output file name: @@;c++; 82;output.at:230;Output file name: @{;c++; 83;output.at:231;Output file name: @};c++; 84;output.at:232;Output file name: [;c++; 85;output.at:233;Output file name: ];c++; 86;output.at:260;Graph with no conflicts;graph; 87;output.at:294;Graph with unsolved S/R;graph; 88;output.at:358;Graph with solved S/R;graph; 89;output.at:417;Graph with R/R;graph; 90;output.at:449;Graph with reductions with multiple LAT;graph; 91;output.at:508;Graph with a reduction rule both enabled and disabled;graph; 92;skeletons.at:24;Relative skeleton file names;; 93;skeletons.at:84;Installed skeleton file names;; 94;skeletons.at:146;%define Boolean variables: invalid skeleton defaults;; 95;skeletons.at:170;Complaining during macro argument expansion;; 96;skeletons.at:252;Fatal errors make M4 exit immediately;; 97;skeletons.at:306;Fatal errors but M4 continues producing output;; 98;sets.at:66;Nullable;; 99;sets.at:151;Broken Closure;; 100;sets.at:193;Firsts;; 101;sets.at:269;Accept;; 102;reduce.at:25;Useless Terminals;; 103;reduce.at:69;Useless Nonterminals;; 104;reduce.at:124;Useless Rules;report; 105;reduce.at:271;Reduced Automaton;report; 106;reduce.at:381;Underivable Rules;report; 107;reduce.at:423;Empty Language;; 108;reduce.at:474;no %define lr.type: Single State Split;; 109;reduce.at:474;%define lr.type lalr: Single State Split;; 110;reduce.at:474;%define lr.type ielr: Single State Split;; 111;reduce.at:474;%define lr.type canonical-lr: Single State Split;; 112;reduce.at:707;no %define lr.type: Lane Split;; 113;reduce.at:707;%define lr.type lalr: Lane Split;; 114;reduce.at:707;%define lr.type ielr: Lane Split;; 115;reduce.at:707;%define lr.type canonical-lr: Lane Split;; 116;reduce.at:951;no %define lr.type: Complex Lane Split;; 117;reduce.at:951;%define lr.type lalr: Complex Lane Split;; 118;reduce.at:951;%define lr.type ielr: Complex Lane Split;; 119;reduce.at:951;%define lr.type canonical-lr: Complex Lane Split;; 120;reduce.at:1220;no %define lr.type: Split During Added Lookahead Propagation;; 121;reduce.at:1220;%define lr.type lalr: Split During Added Lookahead Propagation;; 122;reduce.at:1220;%define lr.type ielr: Split During Added Lookahead Propagation;; 123;reduce.at:1220;%define lr.type canonical-lr: Split During Added Lookahead Propagation;; 124;reduce.at:1550;no %define lr.default-reductions;; 125;reduce.at:1550;%define lr.default-reductions most;; 126;reduce.at:1550;%define lr.default-reductions consistent;; 127;reduce.at:1550;%define lr.default-reductions accepting;; 128;synclines.at:150;Prologue syncline;; 129;synclines.at:168;%union syncline;; 130;synclines.at:189;Postprologue syncline;; 131;synclines.at:213;Action syncline;; 132;synclines.at:232;Epilogue syncline;; 133;synclines.at:249;%code top syncline;; 134;synclines.at:290;%no-lines;; 135;synclines.at:291;%no-lines;; 136;synclines.at:292;%no-lines;; 137;synclines.at:293;%no-lines;; 138;headers.at:57;Invalid CPP guards: --defines=input/input.h;; 139;headers.at:58;Invalid CPP guards: --defines=9foo.h;; 140;headers.at:59;Invalid CPP guards: %glr-parser --defines=input/input.h;; 141;headers.at:60;Invalid CPP guards: %glr-parser --defines=9foo.h;; 142;headers.at:69;export YYLTYPE;; 143;headers.at:125;Several parsers;c++; 144;actions.at:24;Mid-rule actions;; 145;actions.at:133;Initial location: yacc.c ;; 146;actions.at:134;Initial location: yacc.c %define api.pure full;; 147;actions.at:135;Initial location: yacc.c %define api.pure %parse-param { int x };; 148;actions.at:136;Initial location: yacc.c %define api.push-pull both;; 149;actions.at:137;Initial location: yacc.c %define api.push-pull both %define api.pure full;; 150;actions.at:138;Initial location: glr.c ;; 151;actions.at:139;Initial location: glr.c %define api.pure;; 152;actions.at:140;Initial location: lalr1.cc ;c++; 153;actions.at:141;Initial location: glr.cc ;c++; 154;actions.at:150;Initial location: yacc.c %define api.pure full;; 155;actions.at:161;Initial location: yacc.c %define api.pure full;; 156;actions.at:244;Location print: yacc.c ;; 157;actions.at:245;Location print: glr.c ;; 158;actions.at:257;Exotic Dollars;; 159;actions.at:751;Printers and Destructors;; 160;actions.at:752;Printers and Destructors with union;; 161;actions.at:754;Printers and Destructors: %defines %skeleton \"lalr1.cc\";c++; 162;actions.at:755;Printers and Destructors with union: %defines %skeleton \"lalr1.cc\";c++; 163;actions.at:757;Printers and Destructors: %glr-parser;; 164;actions.at:758;Printers and Destructors with union: %glr-parser;; 165;actions.at:769;Default tagless %printer and %destructor;; 166;actions.at:867;Default tagged and per-type %printer and %destructor;; 167;actions.at:991;Default %printer and %destructor for user-defined end token;; 168;actions.at:1098;Default %printer and %destructor are not for error or \$undefined;; 169;actions.at:1193;Default %printer and %destructor are not for \$accept;; 170;actions.at:1258;Default %printer and %destructor for mid-rule values;; 171;actions.at:1406;@\$ in %initial-action implies %locations;; 172;actions.at:1407;@\$ in %destructor implies %locations;; 173;actions.at:1408;@\$ in %printer implies %locations;; 174;actions.at:1529;Qualified \$\$ in actions: yacc.c;; 175;actions.at:1530;Qualified \$\$ in actions: glr.c;; 176;actions.at:1531;Qualified \$\$ in actions: lalr1.cc;c++; 177;actions.at:1532;Qualified \$\$ in actions: glr.cc;c++; 178;actions.at:1540;Fix user actions without a trailing semicolon;; 179;actions.at:1649;Destroying lookahead assigned by semantic action;; 180;actions.at:1708;YYBACKUP;; 181;conflicts.at:31;S/R in initial;; 182;conflicts.at:57;%nonassoc and eof;; 183;conflicts.at:155;%error-verbose and consistent errors;c++ java; 184;conflicts.at:456;LAC: %nonassoc requires splitting canonical LR states;; 185;conflicts.at:546;Unresolved SR Conflicts;report; 186;conflicts.at:653;Resolved SR Conflicts;report; 187;conflicts.at:775;Defaulted Conflicted Reduction;report; 188;conflicts.at:894;%expect not enough;; 189;conflicts.at:914;%expect right;; 190;conflicts.at:931;%expect too much;; 191;conflicts.at:951;%expect with reduce conflicts;; 192;conflicts.at:971;%prec with user string;; 193;conflicts.at:988;%no-default-prec without %prec;; 194;conflicts.at:1014;%no-default-prec with %prec;; 195;conflicts.at:1038;%default-prec;; 196;conflicts.at:1062;Unreachable States After Conflict Resolution;; 197;conflicts.at:1273;Solved conflicts report for multiple reductions in a state;; 198;conflicts.at:1353;%nonassoc error actions for multiple reductions in a state;; 199;conflicts.at:1422;-W versus %expect and %expect-rr;; 200;calc.at:597;Calculator ;; 201;calc.at:599;Calculator %defines;; 202;calc.at:600;Calculator %locations;; 203;calc.at:602;Calculator %name-prefix=\"calc\";; 204;calc.at:603;Calculator %verbose;; 205;calc.at:604;Calculator %yacc;; 206;calc.at:605;Calculator %error-verbose;; 207;calc.at:607;Calculator %define api.pure full %locations;; 208;calc.at:608;Calculator %define api.push-pull both %define api.pure full %locations;; 209;calc.at:609;Calculator %error-verbose %locations;; 210;calc.at:611;Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;; 211;calc.at:612;Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc;; 212;calc.at:614;Calculator %debug;; 213;calc.at:615;Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;; 214;calc.at:616;Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;; 215;calc.at:618;Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;; 216;calc.at:619;Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;; 217;calc.at:621;Calculator %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};; 218;calc.at:638;Calculator %glr-parser ;; 219;calc.at:640;Calculator %glr-parser %defines;; 220;calc.at:641;Calculator %glr-parser %locations;; 221;calc.at:642;Calculator %glr-parser %name-prefix \"calc\";; 222;calc.at:643;Calculator %glr-parser %define api.prefix \"calc\";; 223;calc.at:644;Calculator %glr-parser %verbose;; 224;calc.at:645;Calculator %glr-parser %yacc;; 225;calc.at:646;Calculator %glr-parser %error-verbose;; 226;calc.at:648;Calculator %glr-parser %define api.pure %locations;; 227;calc.at:649;Calculator %glr-parser %error-verbose %locations;; 228;calc.at:651;Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;; 229;calc.at:653;Calculator %glr-parser %debug;; 230;calc.at:654;Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;; 231;calc.at:655;Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;; 232;calc.at:657;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;; 233;calc.at:659;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};; 234;calc.at:660;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};; 235;calc.at:670;Calculator %skeleton \"lalr1.cc\" %defines %locations;c++; 236;calc.at:679;Calculator %language \"C++\" %defines %locations ;c++; 237;calc.at:680;Calculator %language \"C++\" %defines %locations %define api.location.type Span;c++; 238;calc.at:681;Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++; 239;calc.at:682;Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++; 240;calc.at:683;Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++; 241;calc.at:685;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc;c++; 242;calc.at:687;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++; 243;calc.at:688;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++; 244;calc.at:699;Calculator %skeleton \"glr.cc\" %defines %locations;c++; 245;calc.at:708;Calculator %language \"C++\" %glr-parser %defines %locations ;c++; 246;calc.at:709;Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span;c++; 247;calc.at:710;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++; 248;calc.at:711;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++; 249;calc.at:713;Calculator %language \"C++\" %glr-parser %defines %locations %debug;c++; 250;calc.at:714;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++; 251;calc.at:716;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++; 252;calc.at:718;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++; 253;calc.at:719;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++; 254;torture.at:137;Big triangle;; 255;torture.at:227;Big horizontal;; 256;torture.at:364;Many lookahead tokens;; 257;torture.at:466;Exploding the Stack Size with Alloca;; 258;torture.at:512;Exploding the Stack Size with Malloc;; 259;existing.at:79;GNU AWK 3.1.0 Grammar: LALR(1);; 260;existing.at:79;GNU AWK 3.1.0 Grammar: IELR(1);; 261;existing.at:79;GNU AWK 3.1.0 Grammar: Canonical LR(1);; 262;existing.at:783;GNU Cim Grammar: LALR(1);; 263;existing.at:783;GNU Cim Grammar: IELR(1);; 264;existing.at:783;GNU Cim Grammar: Canonical LR(1);; 265;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: LALR(1);; 266;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: IELR(1);; 267;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);; 268;regression.at:25;Trivial grammars;; 269;regression.at:55;YYSTYPE typedef;; 270;regression.at:85;Early token definitions with --yacc;; 271;regression.at:125;Early token definitions without --yacc;; 272;regression.at:170;Braces parsing;; 273;regression.at:194;Duplicate string;; 274;regression.at:222;Rule Line Numbers;report; 275;regression.at:368;Mixing %token styles;; 276;regression.at:391;Invalid inputs;; 277;regression.at:418;Invalid inputs with {};; 278;regression.at:443;Token definitions;; 279;regression.at:511;Characters Escapes;; 280;regression.at:544;Web2c Report;report; 281;regression.at:721;Web2c Actions;report; 282;regression.at:936;Dancer ;; 283;regression.at:937;Dancer %glr-parser;; 284;regression.at:938;Dancer %skeleton \"lalr1.cc\";c++; 285;regression.at:1020;Expecting two tokens ;; 286;regression.at:1021;Expecting two tokens %glr-parser;; 287;regression.at:1022;Expecting two tokens %skeleton \"lalr1.cc\";c++; 288;regression.at:1030;Braced code in declaration in rules section;; 289;regression.at:1097;String alias declared after use;; 290;regression.at:1120;Extra lookahead sets in report;; 291;regression.at:1161;Token number in precedence declaration;; 292;regression.at:1219;parse-gram.y: LALR = IELR;; 293;regression.at:1240;%error-verbose and YYSTACK_USE_ALLOCA;; 294;regression.at:1319;%error-verbose overflow;; 295;regression.at:1429;LAC: Exploratory stack;; 296;regression.at:1523;LAC: Memory exhaustion;; 297;regression.at:1664;Lex and parse params: yacc.c;; 298;regression.at:1665;Lex and parse params: glr.c;; 299;regression.at:1666;Lex and parse params: lalr1.cc;c++; 300;regression.at:1667;Lex and parse params: glr.cc;c++; 301;c++.at:101;Doxygen Public Documentation;; 302;c++.at:102;Doxygen Private Documentation;; 303;c++.at:160;Relative namespace references;c++; 304;c++.at:166;Absolute namespace references;c++; 305;c++.at:175;Syntactically invalid namespace references;; 306;c++.at:190;Exception safety;c++; 307;java.at:360;Calculator ;java; 308;java.at:360;Calculator %error-verbose ;java; 309;java.at:360;Calculator %locations ;java; 310;java.at:360;Calculator %error-verbose %locations ;java; 311;java.at:369;Calculator %lex-param { InputStream is } ;java; 312;java.at:369;Calculator %error-verbose %lex-param { InputStream is } ;java; 313;java.at:369;Calculator %locations %lex-param { InputStream is } ;java; 314;java.at:369;Calculator %error-verbose %locations %lex-param { InputStream is } ;java; 315;java.at:455;Java parser class and package names;java; 316;java.at:476;Java parser class modifiers;java; 317;java.at:534;Java parser class extends and implements;java; 318;java.at:554;Java %parse-param and %lex-param;java; 319;java.at:628;Java throws specifications;java; 320;java.at:717;Java stype, position_class and location_class;java; 321;java.at:748;Java syntax error handling without error token;java; 322;cxx-type.at:394;GLR: Resolve ambiguity, impure, no locations;; 323;cxx-type.at:401;GLR: Resolve ambiguity, impure, locations;; 324;cxx-type.at:407;GLR: Resolve ambiguity, pure, no locations;; 325;cxx-type.at:414;GLR: Resolve ambiguity, pure, locations;; 326;cxx-type.at:421;GLR: Merge conflicting parses, impure, no locations;; 327;cxx-type.at:428;GLR: Merge conflicting parses, impure, locations;; 328;cxx-type.at:435;GLR: Merge conflicting parses, pure, no locations;; 329;cxx-type.at:441;GLR: Merge conflicting parses, pure, locations;; 330;cxx-type.at:448;GLR: Verbose messages, resolve ambiguity, impure, no locations;; 331;glr-regression.at:25;Badly Collapsed GLR States;; 332;glr-regression.at:112;Improper handling of embedded actions and dollar(-N) in GLR parsers;; 333;glr-regression.at:244;Improper merging of GLR delayed action sets;; 334;glr-regression.at:364;Duplicate representation of merged trees;; 335;glr-regression.at:455;User destructor for unresolved GLR semantic value;; 336;glr-regression.at:515;User destructor after an error during a split parse;; 337;glr-regression.at:569;Duplicated user destructor for lookahead;; 338;glr-regression.at:658;Incorrectly initialized location for empty right-hand side in GLR;; 339;glr-regression.at:752;No users destructors if stack 0 deleted;; 340;glr-regression.at:829;Corrupted semantic options if user action cuts parse;; 341;glr-regression.at:883;Undesirable destructors if user action cuts parse;; 342;glr-regression.at:941;Leaked semantic values if user action cuts parse;; 343;glr-regression.at:1064;Incorrect lookahead during deterministic GLR;; 344;glr-regression.at:1188;Incorrect lookahead during nondeterministic GLR;; 345;glr-regression.at:1405;Leaked semantic values when reporting ambiguity;; 346;glr-regression.at:1487;Leaked lookahead after nondeterministic parse syntax error;; 347;glr-regression.at:1547;Uninitialized location when reporting ambiguity;; 348;glr-regression.at:1625;Missed %merge type warnings when LHS type is declared later;; 349;glr-regression.at:1678;Ambiguity reports;; 350;push.at:24;Memory Leak for Early Deletion;; 351;push.at:83;Multiple impure instances;; 352;push.at:144;Unsupported Skeletons;; " # List of the all the test groups. at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- # Validate and normalize the test group number contained in each variable # NAME. Leading zeroes are treated as decimal. at_fn_validate_ranges () { for at_grp do eval at_value=\$$at_grp if test $at_value -lt 1 || test $at_value -gt 352; then $as_echo "invalid test group: $at_value" >&2 exit 1 fi case $at_value in 0*) # We want to treat leading 0 as decimal, like expr and test, but # AS_VAR_ARITH treats it as octal if it uses $(( )). # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the # expr fork, but it is not worth the effort to determine if the # shell supports XSI when the user can just avoid leading 0. eval $at_grp='`expr $at_value + 0`' ;; esac done } ## ## Set up package specific options. ## at_arg_compile_c_with_cxx=false at_arg_given_compile_c_with_cxx=false at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi case $at_option in *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; *) at_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) at_version_p=: ;; --clean | -c ) at_clean=: ;; --color ) at_color=always ;; --color=* ) case $at_optarg in no | never | none) at_color=never ;; auto | tty | if-tty) at_color=auto ;; always | yes | force) at_color=always ;; *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; esac ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=; at_quiet=: ;; --trace | -x ) at_traceon='set -x' at_trace_echo=echo at_check_filter_trace=at_fn_filter_trace ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_fn_validate_ranges at_option as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start at_range=`$as_echo "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,$p'` as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end at_range=`$as_echo "$at_groups_all" | \ sed -ne '1,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`expr $at_option : '\(.*\)-'` at_range_end=`expr $at_option : '.*-\(.*\)'` if test $at_range_start -gt $at_range_end; then at_tmp=$at_range_end at_range_end=$at_range_start at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end at_range=`$as_echo "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; # Directory selection. --directory | -C ) at_prev=--directory ;; --directory=* ) at_change_dir=: at_dir=$at_optarg if test x- = "x$at_dir" ; then at_dir=./- fi ;; # Parallel execution. --jobs | -j ) at_jobs=0 ;; --jobs=* | -j[0-9]* ) if test -n "$at_optarg"; then at_jobs=$at_optarg else at_jobs=`expr X$at_option : 'X-j\(.*\)'` fi case $at_jobs in *[!0-9]*) at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; esac ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_groups_selected=$at_help_all at_save_IFS=$IFS IFS=, set X $at_optarg shift IFS=$at_save_IFS for at_keyword do at_invert= case $at_keyword in '!'*) at_invert="-v" at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'` ;; esac # It is on purpose that we match the test group titles too. at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done # Smash the keywords. at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` as_fn_append at_groups "$at_groups_selected$as_nl" ;; --recheck) at_recheck=: ;; --compile-c-with-cxx ) at_optarg=: at_arg_compile_c_with_cxx=: at_arg_given_compile_c_with_cxx=: ;; --no-compile-c-with-cxx ) at_optarg=false at_arg_compile_c_with_cxx=false at_arg_given_compile_c_with_cxx=: ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $at_envvar in '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. export $at_envvar as_fn_append at_debug_args " $at_envvar='$at_value'" ;; *) $as_echo "$as_me: invalid option: $at_option" >&2 $as_echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Verify our last option didn't require an argument if test -n "$at_prev"; then : as_fn_error $? "\`$at_prev' requires an argument" fi # The file containing the suite. at_suite_log=$at_dir/$as_me.log # Selected test groups. if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else if test -n "$at_recheck" && test -r "$at_suite_log"; then at_oldfails=`sed -n ' /^Failed tests:$/,/^Skipped tests:$/{ s/^[ ]*\([1-9][0-9]*\):.*/\1/p } /^Unexpected passes:$/,/^## Detailed failed tests/{ s/^[ ]*\([1-9][0-9]*\):.*/\1/p } /^## Detailed failed tests/q ' "$at_suite_log"` as_fn_append at_groups "$at_oldfails$as_nl" fi # Sort the tests, removing duplicates. at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` fi if test x"$at_color" = xalways \ || { test x"$at_color" = xauto && test -t 1; }; then at_red=`printf '\033[0;31m'` at_grn=`printf '\033[0;32m'` at_lgn=`printf '\033[1;32m'` at_blu=`printf '\033[1;34m'` at_std=`printf '\033[m'` else at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. if $at_help_p; then cat <<_ATEOF || at_write_fail=1 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, given by numeric ranges, and save a detailed log file. Upon failure, create debugging scripts. Do not change environment variables directly. Instead, set them via command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relative to the top level of this distribution. E.g., from within the build directory /tmp/foo-1.0, invoking this: $ $0 AUTOTEST_PATH=bin is equivalent to the following, assuming the source directory is /src/foo-1.0: PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0 _ATEOF cat <<_ATEOF || at_write_fail=1 Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF || at_write_fail=1 Execution tuning: -C, --directory=DIR change to directory DIR before starting --color[=never|auto|always] disable colored test results, or enable even without terminal -j, --jobs[=N] Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and top-level logging default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF || at_write_fail=1 Other options: _ATEOF cat <<_ATEOF || at_write_fail=1 compile C parsers with the C++ compiler _ATEOF cat <<_ATEOF || at_write_fail=1 Report bugs to . General help using GNU software: . _ATEOF exit $at_write_fail fi # List of tests. if $at_list_p; then cat <<_ATEOF || at_write_fail=1 GNU Bison 2.7 test suite test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # Pass an empty line as separator between selected groups and help. $as_echo "$at_groups$as_nl$as_nl$at_help_all" | awk 'NF == 1 && FS != ";" { selected[$ 1] = 1 next } /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 if ($ 4) { lmax = 79 indent = " " line = indent len = length (line) n = split ($ 4, a, " ") for (i = 1; i <= n; i++) { l = length (a[i]) + 1 if (i > 1 && len + l > lmax) { print line line = indent " " a[i] len = length (line) } else { line = line " " a[i] len += l } } if (n) print line } } }' || at_write_fail=1 exit $at_write_fail fi if $at_version_p; then $as_echo "$as_me (GNU Bison 2.7)" && cat <<\_ATEOF || at_write_fail=1 Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi # Should we print banners? Yes if more than one test is run. case $at_groups in #( *$as_nl* ) at_print_banners=: ;; #( * ) at_print_banners=false ;; esac # Text for banner N, set to a single space once printed. # Banner 1. input.at:18 # Category starts at test group 1. at_banner_text_1="Input Processing." # Banner 2. named-refs.at:19 # Category starts at test group 39. at_banner_text_2="Named references tests." # Banner 3. output.at:18 # Category starts at test group 51. at_banner_text_3="Output file names." # Banner 4. skeletons.at:18 # Category starts at test group 92. at_banner_text_4="Skeleton Support." # Banner 5. sets.at:59 # Category starts at test group 98. at_banner_text_5="Grammar Sets (Firsts etc.)." # Banner 6. reduce.at:18 # Category starts at test group 102. at_banner_text_6="Grammar Reduction." # Banner 7. synclines.at:19 # Category starts at test group 128. at_banner_text_7="User Actions." # Banner 8. headers.at:19 # Category starts at test group 138. at_banner_text_8="Parser Headers." # Banner 9. actions.at:18 # Category starts at test group 144. at_banner_text_9="User Actions." # Banner 10. conflicts.at:19 # Category starts at test group 181. at_banner_text_10="Conflicts." # Banner 11. calc.at:588 # Category starts at test group 200. at_banner_text_11="Simple LALR(1) Calculator." # Banner 12. calc.at:628 # Category starts at test group 218. at_banner_text_12="Simple GLR Calculator." # Banner 13. calc.at:667 # Category starts at test group 235. at_banner_text_13="Simple LALR(1) C++ Calculator." # Banner 14. calc.at:696 # Category starts at test group 244. at_banner_text_14="Simple GLR C++ Calculator." # Banner 15. torture.at:19 # Category starts at test group 254. at_banner_text_15="Torture Tests." # Banner 16. existing.at:19 # Category starts at test group 259. at_banner_text_16="Existing Grammars." # Banner 17. regression.at:18 # Category starts at test group 268. at_banner_text_17="Regression tests." # Banner 18. c++.at:19 # Category starts at test group 301. at_banner_text_18="C++ Features." # Banner 19. java.at:18 # Category starts at test group 307. at_banner_text_19="Java Calculator." # Banner 20. java.at:382 # Category starts at test group 315. at_banner_text_20="Java Parameters." # Banner 21. cxx-type.at:18 # Category starts at test group 322. at_banner_text_21="C++ Type Syntax (GLR)." # Banner 22. glr-regression.at:19 # Category starts at test group 331. at_banner_text_22="GLR Regression Tests" # Banner 23. push.at:18 # Category starts at test group 350. at_banner_text_23="Push Parsing Tests" # Take any -C into account. if $at_change_dir ; then test x != "x$at_dir" && cd "$at_dir" \ || as_fn_error $? "unable to change directory" at_dir=`pwd` fi # Load the config files for any default variable assignments. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: : "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" # atconfig delivers names relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir_var in srcdir top_srcdir top_build_prefix do eval at_val=\$at_$at_dir_var case $at_val in [\\/$]* | ?:[\\/]* ) at_prefix= ;; *) at_prefix=../../ ;; esac eval "$at_dir_var=\$at_prefix\$at_val" done fi ## -------------------- ## ## Directory structure. ## ## -------------------- ## # This is the set of directories and files used by this script # (non-literals are capitalized): # # TESTSUITE - the testsuite # TESTSUITE.log - summarizes the complete testsuite run # TESTSUITE.dir/ - created during a run, remains after -d or failed test # + at-groups/ - during a run: status of all groups in run # | + NNN/ - during a run: meta-data about test group NNN # | | + check-line - location (source file and line) of current AT_CHECK # | | + status - exit status of current AT_CHECK # | | + stdout - stdout of current AT_CHECK # | | + stder1 - stderr, including trace # | | + stderr - stderr, with trace filtered out # | | + test-source - portion of testsuite that defines group # | | + times - timestamps for computing duration # | | + pass - created if group passed # | | + xpass - created if group xpassed # | | + fail - created if group failed # | | + xfail - created if group xfailed # | | + skip - created if group skipped # + at-stop - during a run: end the run if this file exists # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction # + 0..NNN/ - created for each group NNN, remains after -d or failed test # | + TESTSUITE.log - summarizes the group results # | + ... - files created during the group # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups # Stop file: if it exists, do not start new jobs. at_stop_file=$at_suite_dir/at-stop # The fifo used for the job dispatcher. at_job_fifo=$at_suite_dir/at-job-fifo if $at_clean; then test -d "$at_suite_dir" && find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -f -r "$at_suite_dir" "$at_suite_log" exit $? fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites (ie. atconfig was not found), # AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR case $as_dir in [\\/]* | ?:[\\/]* ) as_fn_append at_path "$as_dir" ;; * ) if test -z "$at_top_build_prefix"; then # Stand-alone test suite. as_fn_append at_path "$as_dir" else # Embedded test suite. as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR" as_fn_append at_path "$at_top_srcdir/$as_dir" fi ;; esac done IFS=$as_save_IFS # Now build and simplify PATH. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. at_new_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -d "$as_dir" || continue case $as_dir in [\\/]* | ?:[\\/]* ) ;; * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;; esac case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;; $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;; *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;; esac done IFS=$as_save_IFS PATH=$at_new_path export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null else : >"$at_suite_log" fi exec 5>>"$at_suite_log" # Banners and logs. $as_echo "## ------------------------- ## ## GNU Bison 2.7 test suite. ## ## ------------------------- ##" { $as_echo "## ------------------------- ## ## GNU Bison 2.7 test suite. ## ## ------------------------- ##" echo $as_echo "$as_me: command line was:" $as_echo " \$ $0 $at_cli_args" echo # If ChangeLog exists, list a few lines in case it might help determining # the exact version. if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then $as_echo "## ---------- ## ## ChangeLog. ## ## ---------- ##" echo sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo fi { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } echo # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue $as_echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done } >&5 at_save_special_files () { for at_save_file in stderr experr expout do test ! -f at-bison-check-$at_save_file.bak || as_fn_error 1 "fatal error: back-up on top of a back-up" test ! -f $at_save_file || mv $at_save_file at-bison-check-$at_save_file.bak done } at_restore_special_files () { for at_save_file in stderr experr expout do test ! -f at-bison-check-$at_save_file.bak || mv at-bison-check-$at_save_file.bak $at_save_file done } ## ------------------------- ## ## Autotest shell functions. ## ## ------------------------- ## # at_fn_banner NUMBER # ------------------- # Output banner NUMBER, provided the testsuite is running multiple groups and # this particular banner has not yet been printed. at_fn_banner () { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 test "x$at_banner_text" = "x " && return 0 eval "at_banner_text_$1=\" \"" if test -z "$at_banner_text"; then $at_first || echo else $as_echo "$as_nl$at_banner_text$as_nl" fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE # --------------------------------------- # Perform AT_CHECK preparations for the command at LINE for an untraceable # command; REASON is the reason for disabling tracing. at_fn_check_prepare_notrace () { $at_trace_echo "Not enabling shell tracing (command contains $1)" $as_echo "$2" >"$at_check_line_file" at_check_trace=: at_check_filter=: : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_trace LINE # ------------------------------ # Perform AT_CHECK preparations for the command at LINE for a traceable # command. at_fn_check_prepare_trace () { $as_echo "$1" >"$at_check_line_file" at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_dynamic COMMAND LINE # ---------------------------------------- # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate # preparation function. at_fn_check_prepare_dynamic () { case $1 in *$as_nl*) at_fn_check_prepare_notrace 'an embedded newline' "$2" ;; *) at_fn_check_prepare_trace "$2" ;; esac } # at_fn_filter_trace # ------------------ # Remove the lines in the file "$at_stderr" generated by "set -x" and print # them to stderr. at_fn_filter_trace () { mv "$at_stderr" "$at_stder1" grep '^ *+' "$at_stder1" >&2 grep -v '^ *+' "$at_stder1" >"$at_stderr" } # at_fn_log_failure FILE-LIST # --------------------------- # Copy the files in the list on stdout with a "> " prefix, and exit the shell # with a failure exit code. at_fn_log_failure () { for file do $as_echo "$file:"; sed 's/^/> /' "$file"; done echo 1 > "$at_status_file" exit 1 } # at_fn_check_skip EXIT-CODE LINE # ------------------------------- # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit # the test group subshell with that same exit code. Use LINE in any report # about test failure. at_fn_check_skip () { case $1 in 99) echo 99 > "$at_status_file"; at_failed=: $as_echo "$2: hard failure"; exit 99;; 77) echo 77 > "$at_status_file"; exit 77;; esac } # at_fn_check_status EXPECTED EXIT-CODE LINE # ------------------------------------------ # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing. # Otherwise, if it is 77 or 99, exit the test group subshell with that same # exit code; if it is anything else print an error message referring to LINE, # and fail the test. at_fn_check_status () { case $2 in $1 ) ;; 77) echo 77 > "$at_status_file"; exit 77;; 99) echo 99 > "$at_status_file"; at_failed=: $as_echo "$3: hard failure"; exit 99;; *) $as_echo "$3: exit code was $2, expected $1" at_failed=:;; esac } # at_fn_diff_devnull FILE # ----------------------- # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff # invocations. at_fn_diff_devnull () { test -s "$1" || return 0 $at_diff "$at_devnull" "$1" } # at_fn_test NUMBER # ----------------- # Parse out test NUMBER from the tail of this file. at_fn_test () { eval at_sed=\$at_sed$1 sed "$at_sed" "$at_myself" > "$at_test_source" } # at_fn_create_debugging_script # ----------------------------- # Create the debugging script $at_group_dir/run which will reproduce the # current test group. at_fn_create_debugging_script () { { echo "#! /bin/sh" && echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && $as_echo "cd '$at_dir'" && $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && echo 'exit 1' } >"$at_group_dir/run" && chmod +x "$at_group_dir/run" } ## -------------------------------- ## ## End of autotest shell functions. ## ## -------------------------------- ## { $as_echo "## ---------------- ## ## Tested programs. ## ## ---------------- ##" echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue case $at_program in [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;; * ) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f "$as_dir/$at_program" && break done IFS=$as_save_IFS at_program_=$as_dir/$at_program ;; esac if test -f "$at_program_"; then { $as_echo "$at_srcdir/local.at:913: $at_program_ --version" "$at_program_" --version &5 2>&1 else as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { $as_echo "## ------------------ ## ## Running the tests. ## ## ------------------ ##" } >&5 at_start_date=`date` at_start_time=`date +%s 2>/dev/null` $as_echo "$as_me: starting at: $at_start_date" >&5 # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull >"$at_devnull" fi # Use `diff -u' when possible. if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff" then at_diff='diff -u' else at_diff=diff fi # Get the last needed group. for at_group in : $at_groups; do :; done # Extract the start and end lines of each test group at the tail # of this file awk ' BEGIN { FS="" } /^#AT_START_/ { start = NR } /^#AT_STOP_/ { test = substr ($ 0, 10) print "at_sed" test "=\"1," start "d;" (NR-1) "q\"" if (test == "'"$at_group"'") exit }' "$at_myself" > "$at_suite_dir/at-source-lines" && . "$at_suite_dir/at-source-lines" || as_fn_error $? "cannot create test line number cache" "$LINENO" 5 rm -f "$at_suite_dir/at-source-lines" # Set number of jobs for `-j'; avoid more jobs than test groups. set X $at_groups; shift; at_max_jobs=$# if test $at_max_jobs -eq 0; then at_jobs=1 fi if test $at_jobs -ne 1 && { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then at_jobs=$at_max_jobs fi # If parallel mode, don't output banners, don't split summary lines. if test $at_jobs -ne 1; then at_print_banners=false at_quiet=: fi # Set up helper dirs. rm -rf "$at_helper_dir" && mkdir "$at_helper_dir" && cd "$at_helper_dir" && { test -z "$at_groups" || mkdir $at_groups; } || as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 # Functions for running a test group. We leave the actual # test group execution outside of a shell function in order # to avoid hitting zsh 4.x exit status bugs. # at_fn_group_prepare # ------------------- # Prepare for running a test group. at_fn_group_prepare () { # The directory for additional per-group helper files. at_job_dir=$at_helper_dir/$at_group # The file containing the location of the last AT_CHECK. at_check_line_file=$at_job_dir/check-line # The file containing the exit status of the last command. at_status_file=$at_job_dir/status # The files containing the output of the tested commands. at_stdout=$at_job_dir/stdout at_stder1=$at_job_dir/stder1 at_stderr=$at_job_dir/stderr # The file containing the code for a test group. at_test_source=$at_job_dir/test-source # The file containing dates. at_times_file=$at_job_dir/times # Be sure to come back to the top test directory. cd "$at_suite_dir" # Clearly separate the test groups when verbose. $at_first || $at_verbose echo at_group_normalized=$at_group eval 'while :; do case $at_group_normalized in #( '"$at_format"'*) break;; esac at_group_normalized=0$at_group_normalized done' # Create a fresh directory for the next test group, and enter. # If one already exists, the user may have invoked ./run from # within that directory; we remove the contents, but not the # directory itself, so that we aren't pulling the rug out from # under the shell's notion of the current directory. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 $as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p echo 0 > "$at_status_file" # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log. if test -z "$at_verbose"; then at_tee_pipe='tee -a "$at_group_log"' else at_tee_pipe='cat >> "$at_group_log"' fi } # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] # ------------------------------------------------- # Declare the test group ORDINAL, located at LINE with group description DESC, # and residing under BANNER. Use PAD to align the status column. at_fn_group_banner () { at_setup_line="$2" test -n "$5" && at_fn_banner $5 at_desc="$3" case $1 in [0-9]) at_desc_line=" $1: ";; [0-9][0-9]) at_desc_line=" $1: " ;; *) at_desc_line="$1: " ;; esac as_fn_append at_desc_line "$3$4" $at_quiet $as_echo_n "$at_desc_line" echo "# -*- compilation -*-" >> "$at_group_log" } # at_fn_group_postprocess # ----------------------- # Perform cleanup after running a test group. at_fn_group_postprocess () { # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd "$at_suite_dir" if test ! -f "$at_check_line_file"; then sed "s/^ */$as_me: WARNING: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF $as_echo "$at_setup_line" >"$at_check_line_file" at_status=99 fi $at_verbose $as_echo_n "$at_group. $at_setup_line: " $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_res=xpass at_errexit=$at_errexit_p at_color=$at_red ;; no:0) at_msg="ok" at_res=pass at_errexit=false at_color=$at_grn ;; *:77) at_msg='skipped ('`cat "$at_check_line_file"`')' at_res=skip at_errexit=false at_color=$at_blu ;; no:* | *:99) at_msg='FAILED ('`cat "$at_check_line_file"`')' at_res=fail at_errexit=$at_errexit_p at_color=$at_red ;; yes:*) at_msg='expected failure ('`cat "$at_check_line_file"`')' at_res=xfail at_errexit=false at_color=$at_lgn ;; esac echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then $as_echo "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. $as_echo " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f "$at_times_file"; then at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' rm -f "$at_times_file" fi $as_echo "$at_log_msg" >> "$at_group_log" $as_echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files # or the success was unexpected. if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script if test $at_res = xpass && $at_errexit; then echo stop > "$at_stop_file" fi else if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -fr "$at_group_dir" fi rm -f "$at_test_source" fi ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. $as_echo "$at_log_msg" >> "$at_group_log" # Upon failure, keep the group directory for autopsy, and create # the debugging script. With -e, do not start any further tests. at_fn_create_debugging_script if $at_errexit; then echo stop > "$at_stop_file" fi ;; esac } ## ------------ ## ## Driver loop. ## ## ------------ ## if (set -m && set +m && set +b) >/dev/null 2>&1; then set +b at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=- else at_job_control_on=: at_job_control_off=: at_job_group= fi for at_signal in 1 2 15; do trap 'set +x; set +e $at_job_control_off at_signal='"$at_signal"' echo stop > "$at_stop_file" trap "" $at_signal at_pgids= for at_pgid in `jobs -p 2>/dev/null`; do at_pgids="$at_pgids $at_job_group$at_pgid" done test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null wait if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then echo >&2 fi at_signame=`kill -l $at_signal 2>&1 || echo $at_signal` set x $at_signame test 0 -gt 2 && at_signame=$at_signal { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 $as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} as_fn_arith 128 + $at_signal && exit_status=$as_val as_fn_exit $exit_status' $at_signal done rm -f "$at_stop_file" at_first=: if test $at_jobs -ne 1 && rm -f "$at_job_fifo" && test -n "$at_job_group" && ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null then # FIFO job dispatcher. trap 'at_pids= for at_pid in `jobs -p`; do at_pids="$at_pids $at_job_group$at_pid" done if test -n "$at_pids"; then at_sig=TSTP test "${TMOUT+set}" = set && at_sig=STOP kill -$at_sig $at_pids 2>/dev/null fi kill -STOP $$ test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP echo # Turn jobs into a list of numbers, starting from 1. at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift for at_group in $at_groups; do $at_job_control_on 2>/dev/null ( # Start one test group. $at_job_control_off if $at_first; then exec 7>"$at_job_fifo" else exec 6<&- fi trap 'set +x; set +e trap "" PIPE echo stop > "$at_stop_file" echo >&7 as_fn_exit 141' PIPE at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && . "$at_test_source" then :; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess echo >&7 ) & $at_job_control_off if $at_first; then at_first=false exec 6<"$at_job_fifo" 7>"$at_job_fifo" fi shift # Consume one token. if test $# -gt 0; then :; else read at_token <&6 || break set x $* fi test -f "$at_stop_file" && break done exec 7>&- # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist shift if test $# -gt 0; then shift for at_job do read at_token done <&6 fi exec 6<&- wait else # Run serially, avoid forks and other potential surprises. for at_group in $at_groups; do at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && . "$at_test_source"; then :; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess test -f "$at_stop_file" && break at_first=false done fi # Wrap up the test suite with summary statistics. cd "$at_helper_dir" # Use ?..???? when the list must remain sorted, the faster * otherwise. at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'` at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'` at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'` at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do echo $f; done | sed '/?/d; s,/xpass,,'` at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do echo $f; done | sed '/?/d; s,/fail,,'` set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list shift; at_group_count=$# set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$* set X $at_xfail_list; shift; at_xfail_count=$# set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$* set X $at_skip_list; shift; at_skip_count=$# as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val # Back to the top directory. cd "$at_dir" rm -rf "$at_helper_dir" # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`date +%s 2>/dev/null` $as_echo "$as_me: ending at: $at_stop_date" >&5 case $at_start_time,$at_stop_time in [0-9]*,[0-9]*) as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" $as_echo "$as_me: test suite duration: $at_duration" >&5 ;; esac echo $as_echo "## ------------- ## ## Test results. ## ## ------------- ##" echo { echo $as_echo "## ------------- ## ## Test results. ## ## ------------- ##" echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." at_color=$at_red else # Don't you just love exponential explosion of the number of cases? at_color=$at_red case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_color$at_result$at_std" echo "$at_result" >&5 else echo "${at_color}ERROR: $at_result$at_std" >&2 echo "ERROR: $at_result" >&5 { echo $as_echo "## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ##" # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL "$at_myself" $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL "$at_myself" $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL "$at_myself" $at_xpass_list --list echo fi if test $at_fail_count != 0; then $as_echo "## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ##" echo for at_group in $at_fail_list do at_group_normalized=$at_group eval 'while :; do case $at_group_normalized in #( '"$at_format"'*) break;; esac at_group_normalized=0$at_group_normalized done' cat "$at_suite_dir/$at_group_normalized/$as_me.log" echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## ${at_top_build_prefix}config.log ## _ASBOX sed 's/^/| /' ${at_top_build_prefix}config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo if $at_debug_p; then at_msg='per-test log files' else at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'" fi $as_echo "Please send $at_msg and all information you think might help: To: 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} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below \`${at_testdir+${at_testdir}/}$as_me.dir'. " exit 1 fi exit 0 ## ------------- ## ## Actual tests. ## ## ------------- ## #AT_START_1 at_fn_group_banner 1 'input.at:27' \ "Invalid inputs" " " 1 at_xfail=no ( $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' \000\001\002\377? %% ? default: 'a' } %& %a-does-not-exist %- %{ _ATEOF { set +x $as_echo "$at_srcdir/input.at:39: \$PERL -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' input.y || exit 77" at_fn_check_prepare_dynamic "$PERL -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' input.y || exit 77" "input.at:39" ( $at_check_trace; $PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' input.y || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:39" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:41: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:41" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: invalid characters: '\\0\\001\\002\\377?' input.y:3.1: error: invalid character: '?' input.y:4.14: error: invalid character: '}' input.y:5.1: error: invalid character: '%' input.y:5.2: error: invalid character: '&' input.y:6.1-17: error: invalid directive: '%a-does-not-exist' input.y:7.1: error: invalid character: '%' input.y:7.2: error: invalid character: '-' input.y:8.1-9.0: error: missing '%}' at end of file input.y:8.1-9.0: error: syntax error, unexpected %{...%} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:41" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_1 #AT_START_2 at_fn_group_banner 2 'input.at:57' \ "Invalid inputs with {}" " " 1 at_xfail=no ( $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon # We used to SEGV here. See # http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html cat >input.y <<'_ATEOF' %destructor %initial-action %lex-param %parse-param %printer %union _ATEOF { set +x $as_echo "$at_srcdir/input.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:72" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:72" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_2 #AT_START_3 at_fn_group_banner 3 'input.at:84' \ "Invalid \$n and @n" " " 1 at_xfail=no ( $as_echo "3. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: { $$ = $1 ; }; exp: { @$ = @1 ; }; _ATEOF { set +x $as_echo "$at_srcdir/input.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:92" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.13-14: error: integer out of range: '\$1' input.y:3.13-14: error: integer out of range: '@1' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:92" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_3 #AT_START_4 at_fn_group_banner 4 'input.at:104' \ "Type Clashes" " " 1 at_xfail=no ( $as_echo "4. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %union { int bar; } %token foo %type exp %% exp: foo { $$; } foo { $2; } foo | foo | /* Empty. */ ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:117: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:117" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type input.y:5.24-25: error: \$2 of 'exp' has no declared type input.y:5.6-32: warning: type clash on default action: != <> input.y:6.6-8: warning: type clash on default action: != <> input.y:7.5: warning: empty rule for typed nonterminal, and no action " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:117" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_4 #AT_START_5 at_fn_group_banner 5 'input.at:285' \ "Unused values" " " 1 at_xfail=no ( $as_echo "5. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token INT; %type a b c d e f g h i j k l; %destructor { destroy ($$); } INT a b c d e f g h i j k l; %% start: 'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; } | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; } | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; } ; a: INT | INT { } INT { } INT { }; b: INT | /* empty */; c: INT | INT { $1; } INT { $2; } INT { $4; }; d: INT | INT { } INT { $1; } INT { $2; }; e: INT | INT { } INT { } INT { $1; }; f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; }; g: INT | INT { $$; } INT { $$; } INT { }; h: INT | INT { $$; } INT { $$ = $2; } INT { }; i: INT | INT INT { } { $$ = $1 + $2; }; j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; k: INT | INT INT { $$; } { $$ = $3; } { }; l: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $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 \\ --graph=xml-tests/test.dot -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:286" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "input.at:286" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:286: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:286" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:286: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:286" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:286: bison -fcaret input.y" at_fn_check_prepare_trace "input.at:286" ( $at_check_trace; bison -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: \$1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: \$3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: \$5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.10-62: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: \$3 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:13.43-45: warning: unused value: \$5 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:14.10-49: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: \$3 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.30-32: warning: unused value: \$5 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:15.10-37: warning: unset value: \$\$ e: INT | INT { } INT { } INT { \$1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: \$3 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:15.27-29: warning: unused value: \$5 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:17.10-58: warning: unset value: \$\$ g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: \$1 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.31-33: warning: unused value: \$3 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.52-54: warning: unused value: \$5 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: \$\$ h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: \$1 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: \$3 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.66-68: warning: unused value: \$5 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:21.10-68: warning: unset value: \$\$ k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: \$1 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.14-16: warning: unused value: \$2 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "input.at:286" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:11.10-32: warning: unset value: $$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: $1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: $3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: $5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.10-62: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: $3 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:13.43-45: warning: unused value: $5 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:14.10-49: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: $3 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.30-32: warning: unused value: $5 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:15.10-37: warning: unset value: $$ e: INT | INT { } INT { } INT { $1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: $3 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:15.27-29: warning: unused value: $5 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:17.10-58: warning: unset value: $$ g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: $1 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.31-33: warning: unused value: $3 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.52-54: warning: unused value: $5 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: $$ h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: $1 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: $3 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.66-68: warning: unused value: $5 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:21.10-68: warning: unset value: $$ k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: $1 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.14-16: warning: unused value: $2 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:286: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:286" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "input.at:286" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "input.at:286" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "input.at:286" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:286" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.y <<'_ATEOF' %token INT; %type a b c d e f g h i j k l; %destructor { destroy ($$); } INT a b c d e f g h i j k l; %% start: 'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; } | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; } | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; } ; a: INT | INT { } INT { } INT { }; b: INT | /* empty */; c: INT | INT { $1; } INT { $2; } INT { $4; }; d: INT | INT { } INT { $1; } INT { $2; }; e: INT | INT { } INT { } INT { $1; }; f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; }; g: INT | INT { $$; } INT { $$; } INT { }; h: INT | INT { $$; } INT { $$ = $2; } INT { }; i: INT | INT INT { } { $$ = $1 + $2; }; j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; k: INT | INT INT { $$; } { $$ = $3; } { }; l: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $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 \\ --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:287" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:287" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:287: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:287" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:287: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:287" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:287: bison --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_trace "input.at:287" ( $at_check_trace; bison --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: \$1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: \$3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: \$5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.14-20: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^ input.y:13.26-41: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^ input.y:13.10-62: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: \$3 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:13.43-45: warning: unused value: \$5 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:14.14-16: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.10-49: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: \$3 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.30-32: warning: unused value: \$5 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:15.10-37: warning: unset value: \$\$ e: INT | INT { } INT { } INT { \$1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: \$3 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:15.27-29: warning: unused value: \$5 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:17.10-58: warning: unset value: \$\$ g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: \$1 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.14-29: warning: unused value: \$2 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.31-33: warning: unused value: \$3 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.35-50: warning: unused value: \$4 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.52-54: warning: unused value: \$5 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: \$\$ h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: \$1 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: \$3 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.35-64: warning: unused value: \$4 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.66-68: warning: unused value: \$5 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:20.18-37: warning: unused value: \$3 j: INT | INT INT { \$\$ = 1; } { \$\$ = \$1 + \$2; }; ^^^^^^^^^^^^^^^^^^^^ input.y:21.10-68: warning: unset value: \$\$ k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: \$1 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.14-16: warning: unused value: \$2 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.35-64: warning: unused value: \$4 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" "input.at:287" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:11.10-32: warning: unset value: $$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: $1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: $3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: $5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.14-20: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^ input.y:13.26-41: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^ input.y:13.10-62: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: $3 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:13.43-45: warning: unused value: $5 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:14.14-16: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.10-49: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: $3 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.30-32: warning: unused value: $5 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:15.10-37: warning: unset value: $$ e: INT | INT { } INT { } INT { $1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: $3 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:15.27-29: warning: unused value: $5 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:17.10-58: warning: unset value: $$ g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: $1 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.14-29: warning: unused value: $2 g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.31-33: warning: unused value: $3 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.35-50: warning: unused value: $4 g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.52-54: warning: unused value: $5 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: $$ h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: $1 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: $3 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.35-64: warning: unused value: $4 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.66-68: warning: unused value: $5 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:20.18-37: warning: unused value: $3 j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; ^^^^^^^^^^^^^^^^^^^^ input.y:21.10-68: warning: unset value: $$ k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: $1 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.14-16: warning: unused value: $2 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.35-64: warning: unused value: $4 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:287: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:287" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:287" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:287" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:287" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:287" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_5 #AT_START_6 at_fn_group_banner 6 'input.at:295' \ "Unused values before symbol declarations" " " 1 at_xfail=no ( $as_echo "6. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% start: 'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; } | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; } | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; } ; a: INT | INT { } INT { } INT { }; b: INT | /* empty */; c: INT | INT { $1; } INT { $2; } INT { $4; }; d: INT | INT { } INT { $1; } INT { $2; }; e: INT | INT { } INT { } INT { $1; }; f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; }; g: INT | INT { $$; } INT { $$; } INT { }; h: INT | INT { $$; } INT { $$ = $2; } INT { }; i: INT | INT INT { } { $$ = $1 + $2; }; j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; k: INT | INT INT { $$; } { $$ = $3; } { }; l: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; %token INT; %type a b c d e f g h i j k l; %destructor { destroy ($$); } INT a b c d e f g h i j k l; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "input.at:296" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:296: bison -fcaret input.y" at_fn_check_prepare_trace "input.at:296" ( $at_check_trace; bison -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: \$1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: \$3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: \$5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.10-62: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: \$3 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:13.43-45: warning: unused value: \$5 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:14.10-49: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: \$3 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.30-32: warning: unused value: \$5 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:15.10-37: warning: unset value: \$\$ e: INT | INT { } INT { } INT { \$1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: \$3 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:15.27-29: warning: unused value: \$5 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:17.10-58: warning: unset value: \$\$ g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: \$1 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.31-33: warning: unused value: \$3 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.52-54: warning: unused value: \$5 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: \$\$ h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: \$1 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: \$3 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.66-68: warning: unused value: \$5 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:21.10-68: warning: unset value: \$\$ k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: \$1 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.14-16: warning: unused value: \$2 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "input.at:296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:11.10-32: warning: unset value: $$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: $1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: $3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: $5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.10-62: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: $3 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:13.43-45: warning: unused value: $5 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:14.10-49: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: $3 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.30-32: warning: unused value: $5 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:15.10-37: warning: unset value: $$ e: INT | INT { } INT { } INT { $1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: $3 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:15.27-29: warning: unused value: $5 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:17.10-58: warning: unset value: $$ g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: $1 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.31-33: warning: unused value: $3 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.52-54: warning: unused value: $5 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: $$ h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: $1 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: $3 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.66-68: warning: unused value: $5 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:21.10-68: warning: unset value: $$ k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: $1 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.14-16: warning: unused value: $2 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:296: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:296" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "input.at:296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "input.at:296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "input.at:296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:296" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.y <<'_ATEOF' %% start: 'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; } | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; } | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; } ; a: INT | INT { } INT { } INT { }; b: INT | /* empty */; c: INT | INT { $1; } INT { $2; } INT { $4; }; d: INT | INT { } INT { $1; } INT { $2; }; e: INT | INT { } INT { } INT { $1; }; f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; }; g: INT | INT { $$; } INT { $$; } INT { }; h: INT | INT { $$; } INT { $$ = $2; } INT { }; i: INT | INT INT { } { $$ = $1 + $2; }; j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; k: INT | INT INT { $$; } { $$ = $3; } { }; l: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; %token INT; %type a b c d e f g h i j k l; %destructor { destroy ($$); } INT a b c d e f g h i j k l; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:297" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:297" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:297: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:297" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:297: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:297" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:297: bison --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_trace "input.at:297" ( $at_check_trace; bison --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: \$1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: \$3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: \$5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.14-20: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^ input.y:13.26-41: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^ input.y:13.10-62: warning: unset value: \$\$ c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: \$3 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:13.43-45: warning: unused value: \$5 c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; ^^^ input.y:14.14-16: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.10-49: warning: unset value: \$\$ d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: \$3 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:14.30-32: warning: unused value: \$5 d: INT | INT { } INT { \$1; } INT { \$2; }; ^^^ input.y:15.10-37: warning: unset value: \$\$ e: INT | INT { } INT { } INT { \$1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: \$3 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:15.27-29: warning: unused value: \$5 e: INT | INT { } INT { } INT { \$1; }; ^^^ input.y:17.10-58: warning: unset value: \$\$ g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: \$1 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.14-29: warning: unused value: \$2 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.31-33: warning: unused value: \$3 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:17.35-50: warning: unused value: \$4 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.52-54: warning: unused value: \$5 g: INT | INT { \$\$; } INT { \$\$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: \$\$ h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: \$1 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: \$3 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:18.35-64: warning: unused value: \$4 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.66-68: warning: unused value: \$5 h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; ^^^ input.y:20.18-37: warning: unused value: \$3 j: INT | INT INT { \$\$ = 1; } { \$\$ = \$1 + \$2; }; ^^^^^^^^^^^^^^^^^^^^ input.y:21.10-68: warning: unset value: \$\$ k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: \$1 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.14-16: warning: unused value: \$2 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^ input.y:21.35-64: warning: unused value: \$4 k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" "input.at:297" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:11.10-32: warning: unset value: $$ a: INT | INT { } INT { } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^ input.y:11.10-12: warning: unused value: $1 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.18-20: warning: unused value: $3 a: INT | INT { } INT { } INT { }; ^^^ input.y:11.26-28: warning: unused value: $5 a: INT | INT { } INT { } INT { }; ^^^ input.y:12.9: warning: empty rule for typed nonterminal, and no action b: INT | /* empty */; ^ input.y:13.14-20: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^ input.y:13.26-41: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^ input.y:13.10-62: warning: unset value: $$ c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:13.22-24: warning: unused value: $3 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:13.43-45: warning: unused value: $5 c: INT | INT { $1; } INT { $2; } INT { $4; }; ^^^ input.y:14.14-16: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.10-49: warning: unset value: $$ d: INT | INT { } INT { $1; } INT { $2; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:14.18-20: warning: unused value: $3 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:14.30-32: warning: unused value: $5 d: INT | INT { } INT { $1; } INT { $2; }; ^^^ input.y:15.10-37: warning: unset value: $$ e: INT | INT { } INT { } INT { $1; }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:15.18-20: warning: unused value: $3 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:15.27-29: warning: unused value: $5 e: INT | INT { } INT { } INT { $1; }; ^^^ input.y:17.10-58: warning: unset value: $$ g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:17.10-12: warning: unused value: $1 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.14-29: warning: unused value: $2 g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.31-33: warning: unused value: $3 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:17.35-50: warning: unused value: $4 g: INT | INT { $$; } INT { $$; } INT { }; ^^^^^^^^^^^^^^^^ input.y:17.52-54: warning: unused value: $5 g: INT | INT { $$; } INT { $$; } INT { }; ^^^ input.y:18.10-72: warning: unset value: $$ h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.10-12: warning: unused value: $1 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.31-33: warning: unused value: $3 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:18.35-64: warning: unused value: $4 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:18.66-68: warning: unused value: $5 h: INT | INT { $$; } INT { $$ = $2; } INT { }; ^^^ input.y:20.18-37: warning: unused value: $3 j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; ^^^^^^^^^^^^^^^^^^^^ input.y:21.10-68: warning: unset value: $$ k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ input.y:21.10-12: warning: unused value: $1 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.14-16: warning: unused value: $2 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^ input.y:21.35-64: warning: unused value: $4 k: INT | INT INT { $$; } { $$ = $3; } { }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:297: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:297" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:297" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:297" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:297" ( $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 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:297" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_6 #AT_START_7 at_fn_group_banner 7 'input.at:305' \ "Default %printer and %destructor redeclared" " " 1 at_xfail=no ( $as_echo "7. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { destroy ($$); } <*> <*> %printer { print ($$); } <*> <*> %destructor { destroy ($$); } <*> %printer { print ($$); } <*> %destructor { destroy ($$); } <> <> %printer { print ($$); } <> <> %destructor { destroy ($$); } <> %printer { print ($$); } <> %% start: ; %destructor { destroy ($$); } <*>; %printer { print ($$); } <*>; %destructor { destroy ($$); } <>; %printer { print ($$); } <>; _ATEOF { set +x $as_echo "$at_srcdir/input.at:331: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:331" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: redeclaration for default tagged %destructor input.y:1.13-29: previous declaration input.y:2.10-24: error: redeclaration for default tagged %printer input.y:2.10-24: previous declaration input.y:4.13-29: error: redeclaration for default tagged %destructor input.y:1.13-29: previous declaration input.y:5.10-24: error: redeclaration for default tagged %printer input.y:2.10-24: previous declaration input.y:7.13-29: error: redeclaration for default tagless %destructor input.y:7.13-29: previous declaration input.y:8.10-24: error: redeclaration for default tagless %printer input.y:8.10-24: previous declaration input.y:10.13-29: error: redeclaration for default tagless %destructor input.y:7.13-29: previous declaration input.y:11.10-24: error: redeclaration for default tagless %printer input.y:8.10-24: previous declaration input.y:17.13-29: error: redeclaration for default tagged %destructor input.y:4.13-29: previous declaration input.y:18.10-24: error: redeclaration for default tagged %printer input.y:5.10-24: previous declaration input.y:20.13-29: error: redeclaration for default tagless %destructor input.y:10.13-29: previous declaration input.y:21.10-24: error: redeclaration for default tagless %printer input.y:11.10-24: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:331" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 at_fn_group_banner 8 'input.at:365' \ "Per-type %printer and %destructor redeclared" " " 1 at_xfail=no ( $as_echo "8. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { destroy ($$); } %printer { print ($$); } %destructor { destroy ($$); } %printer { print ($$); } %% start: ; %destructor { destroy ($$); } ; %printer { print ($$); } ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:382" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.13-29: error: %destructor redeclaration for input.y:1.13-29: previous declaration input.y:4.13-29: error: %destructor redeclaration for input.y:4.13-29: previous declaration input.y:5.10-24: error: %printer redeclaration for input.y:2.10-24: previous declaration input.y:5.10-24: error: %printer redeclaration for input.y:5.10-24: previous declaration input.y:11.13-29: error: %destructor redeclaration for input.y:4.13-29: previous declaration input.y:11.13-29: error: %destructor redeclaration for input.y:1.13-29: previous declaration input.y:12.10-24: error: %printer redeclaration for input.y:2.10-24: previous declaration input.y:12.10-24: error: %printer redeclaration for input.y:5.10-24: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:382" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_8 #AT_START_9 at_fn_group_banner 9 'input.at:408' \ "Unused values with default %destructor" " " 1 at_xfail=no ( $as_echo "9. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { destroy ($$); } <> %type tagged %% start: end end tagged tagged { $1; $3; } ; end: { } ; tagged: { } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:421: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:421" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:421: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:421" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:421: bison input.y" at_fn_check_prepare_trace "input.at:421" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$ input.y:6.12-14: warning: unused value: \$2 input.y:7.6-8: warning: unset value: \$\$ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:6.8-45: warning: unset value: $$ input.y:6.12-14: warning: unused value: $2 input.y:7.6-8: warning: unset value: $$ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:421: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:421" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:421" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.y <<'_ATEOF' %destructor { destroy ($$); } <*> %type tagged %% start: end end tagged tagged { $1; $3; } ; end: { } ; tagged: { } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:438: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:438" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:438: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:438" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:438: bison input.y" at_fn_check_prepare_trace "input.at:438" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.23-28: warning: unused value: \$4 input.y:8.9-11: warning: unset value: \$\$ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:6.23-28: warning: unused value: $4 input.y:8.9-11: warning: unset value: $$ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:438: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:438" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:438" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 at_fn_group_banner 10 'input.at:450' \ "Unused values with per-type %destructor" " " 1 at_xfail=no ( $as_echo "10. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { destroy ($$); } %type start end %% start: end end { $1; } ; end: { } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:462: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:462" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:462: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:462" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:462: bison input.y" at_fn_check_prepare_trace "input.at:462" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$ input.y:6.12-14: warning: unused value: \$2 input.y:7.6-8: warning: unset value: \$\$ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:6.8-22: warning: unset value: $$ input.y:6.12-14: warning: unused value: $2 input.y:7.6-8: warning: unset value: $$ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:462: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:462" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } { set +x $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" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:462" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:462" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_10 #AT_START_11 at_fn_group_banner 11 'input.at:475' \ "Incompatible Aliases" " " 1 at_xfail=no ( $as_echo "11. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token foo "foo" %type foo %printer {bar} foo %destructor {bar} foo %left foo %type "foo" %printer {baz} "foo" %destructor {baz} "foo" %left "foo" %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:494" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:8.7-11: error: %type redeclaration for foo input.y:3.7-11: previous declaration input.y:10.13-17: error: %destructor redeclaration for foo input.y:5.13-17: previous declaration input.y:9.10-14: error: %printer redeclaration for foo input.y:4.10-14: previous declaration input.y:11.1-5: error: %left redeclaration for foo input.y:6.1-5: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:494" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_11 #AT_START_12 at_fn_group_banner 12 'input.at:516' \ "Torturing the Scanner" " " 1 at_xfail=no ( $as_echo "12. $at_setup_line: testing $at_desc ..." $at_traceon : >input.y { set +x $as_echo "$at_srcdir/input.at:520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:520" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1: error: syntax error, unexpected end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:520" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' {} _ATEOF { set +x $as_echo "$at_srcdir/input.at:528: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:528" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: syntax error, unexpected {...} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:528" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ /* This is seen in GCC: a %{ and %} in middle of a comment. */ const char *foo = "So %{ and %} can be here too."; #if 0 /* These examples test Bison while not stressing C compilers too much. Many C compilers mishandle backslash-newlines, so this part of the test is inside "#if 0". The comment and string are written so that the "#endif" will be seen regardless of the C compiler bugs that we know about, namely: HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a comment. The Apple Darwin compiler (as of late 2002) mishandles \\[newline]' within a character constant. */ /\ * A comment with backslash-newlines in it. %} *\ \ / /* { Close the above comment, if the C compiler mishandled it. */ char str[] = "\\ " A string with backslash-newlines in it %{ %} \\ \ ""; char apostrophe = '\''; #endif #include #include #include %} /* %{ and %} can be here too. */ %{ /* Exercise pre-prologue dependency to %union. */ typedef int value; %} /* Exercise M4 quoting: ']]', 0. */ /* Also exercise %union. */ %union { value ival; /* A comment to exercise an old bug. */ }; /* Exercise post-prologue dependency to %union. */ %{ static YYSTYPE value_as_yystype (value val); /* Exercise quotes in declarations. */ char quote[] = "]],"; %} %{ static void yyerror ( const char *msg); static int yylex (void); %} %type '[' /* Exercise quotes in strings. */ %token FAKE "fake [] \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/?? \x1\1" %% /* Exercise M4 quoting: ']]', [, 1. */ exp: '[' '\1' two '$' '@' '{' oline output.or.oline.opt { /* Exercise quotes in braces. */ char tmp[] = "[%c],\n"; printf (tmp, $1); } ; two: '\x000000000000000000000000000000000000000000000000000000000000000000002'; oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_'; output.or.oline.opt: ;|oline;;|output;;; output: '#' 'o' 'u' 't' 'p' 'u' 't' ' '; %% /* Exercise M4 quoting: ']]', [, 2. */ static YYSTYPE value_as_yystype (value val) { YYSTYPE res; res.ival = val; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static char const input[] = "[\1\2$@{@oline@__oline__\ #output "; /* " */ static size_t toknum; assert (toknum < sizeof input); yylval = value_as_yystype (input[toknum]); return input[toknum++]; } _ATEOF # Pacify Emacs' font-lock-mode: " cat >main.c <<'_ATEOF' typedef int value; #include "input.h" int yyparse (void); int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:659" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "input.at:659" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:659" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:659" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:659" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:659: bison -d -v -o input.c input.y" at_fn_check_prepare_trace "input.at:659" ( $at_check_trace; bison -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:660: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:660" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:660: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:660" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:661: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:661" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:661" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:661: \$CC \$CFLAGS \$CPPFLAGS -c -o main.o main.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o main.o main.c " "input.at:661" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o main.o main.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:661" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:662: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:662" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:662" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:662: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.o main.o \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS" "input.at:662" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:662" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:663: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:663" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "[[], " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:663" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:663: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "input.at:663" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:663" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_12 #AT_START_13 at_fn_group_banner 13 'input.at:674' \ "Typed symbol aliases" " " 1 at_xfail=no ( $as_echo "13. $at_setup_line: testing $at_desc ..." $at_traceon # Bison 2.0 broke typed symbol aliases - ensure they work. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %union { int val; }; %token MY_TOKEN "MY TOKEN" %type exp %% exp: "MY TOKEN"; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:690" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:690" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:690" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:690" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:690: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:690" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:690" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:690: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:690" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:690" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:690: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:690" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:690" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_13 #AT_START_14 at_fn_group_banner 14 'input.at:710' \ "Require 1.0" " " 1 at_xfail=no ( $as_echo "14. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %require "1.0"; %% empty_file:; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:710" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:710" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:710" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:710: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:710" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:710" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:710: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:710" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:710" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:710: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:710" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:710" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_14 #AT_START_15 at_fn_group_banner 15 'input.at:711' \ "Require 2.7" " " 1 at_xfail=no ( $as_echo "15. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %require "2.7"; %% empty_file:; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:711" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:711" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:711" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:711: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:711" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:711" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:711: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:711" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:711" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:711: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:711" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:711" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_15 #AT_START_16 at_fn_group_banner 16 'input.at:713' \ "Require 100.0" " " 1 at_xfail=no ( $as_echo "16. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %require "100.0"; %% empty_file:; _ATEOF { set +x $as_echo "$at_srcdir/input.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:713" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 63 $at_status "$at_srcdir/input.at:713" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_16 #AT_START_17 at_fn_group_banner 17 'input.at:720' \ "String aliases for character tokens" " " 1 at_xfail=no ( $as_echo "17. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once thought a character token and its alias were different symbols # with the same user token number. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token 'a' "a" %% start: 'a'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:732: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:732" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:732" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:732: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:732" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:732" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:732: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:732" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:732" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:732: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:732" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:732" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:732: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:732" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:732" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_17 #AT_START_18 at_fn_group_banner 18 'input.at:741' \ "Symbols" " " 1 at_xfail=no ( $as_echo "18. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token WITH-DASH %token WITHOUT_DASH "WITHOUT-DASH" %token WITH.PERIOD %token WITHOUT_PERIOD "WITHOUT.PERIOD" %code { static void yyerror ( const char *msg); static int yylex (void); } %% start: with-dash without_dash with.period without_period; with-dash: WITH-DASH; without_dash: "WITHOUT-DASH"; with.period: WITH.PERIOD; without_period: "WITHOUT.PERIOD"; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF # POSIX Yacc accept periods, but not dashes. { set +x $as_echo "$at_srcdir/input.at:766: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --yacc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --yacc input.y" "input.at:766" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:9.8-16: POSIX Yacc forbids dashes in symbol names: WITH-DASH input.y:18.8-16: POSIX Yacc forbids dashes in symbol names: with-dash " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:766" $at_failed && at_fn_log_failure $at_traceon; } # So warn about them. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wyacc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wyacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y" "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:772: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:772" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:772: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:772" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:772: bison -Wyacc input.y" at_fn_check_prepare_trace "input.at:772" ( $at_check_trace; bison -Wyacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror" "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:772: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:772" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error" "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror" "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror" "input.at:772" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:772" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # Dashes are fine for GNU Bison. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:778: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:778" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:778" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:778: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:778" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:778" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:778" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:778" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:778: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:778" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:778" $at_failed && at_fn_log_failure $at_traceon; } # Make sure we don't export silly token identifiers with periods or dashes. { set +x $as_echo "$at_srcdir/input.at:781: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:781" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:781" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:781: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:781" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:781" $at_failed && at_fn_log_failure $at_traceon; } # Periods are genuine letters, they can start identifiers. # Digits and dashes cannot. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token .GOOD -GOOD 1NV4L1D -123 %% start: .GOOD GOOD _ATEOF { set +x $as_echo "$at_srcdir/input.at:794: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:794" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:10.10: error: invalid character: '-' input.y:11.10-16: error: invalid identifier: '1NV4L1D' input.y:12.10: error: invalid character: '-' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:794" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_18 #AT_START_19 at_fn_group_banner 19 'input.at:807' \ "Numbered tokens" " " 1 at_xfail=no ( $as_echo "19. $at_setup_line: testing $at_desc ..." $at_traceon cat >redecl.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token DECIMAL_1 11259375 HEXADECIMAL_1 0xabcdef HEXADECIMAL_2 0xFEDCBA DECIMAL_2 16702650 %% start: DECIMAL_1 HEXADECIMAL_2; _ATEOF { set +x $as_echo "$at_srcdir/input.at:818: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison redecl.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison redecl.y" "input.at:818" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison redecl.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "redecl.y:10.10-22: error: user token number 11259375 redeclaration for HEXADECIMAL_1 redecl.y:9.8-16: previous declaration for DECIMAL_1 redecl.y:12.10-18: error: user token number 16702650 redeclaration for DECIMAL_2 redecl.y:11.10-22: previous declaration for HEXADECIMAL_2 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >too-large.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token TOO_LARGE_DEC 999999999999999999999 TOO_LARGE_HEX 0xFFFFFFFFFFFFFFFFFFF %% start: TOO_LARGE_DEC TOO_LARGE_HEX %% _ATEOF { set +x $as_echo "$at_srcdir/input.at:833: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison too-large.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison too-large.y" "input.at:833" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison too-large.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "too-large.y:9.22-42: error: integer out of range: '999999999999999999999' too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:833" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_19 #AT_START_20 at_fn_group_banner 20 'input.at:845' \ "Unclosed constructs" " " 1 at_xfail=no ( $as_echo "20. $at_setup_line: testing $at_desc ..." $at_traceon # Bison's scan-gram.l once forgot to STRING_FINISH some unclosed constructs, so # they were prepended to whatever it STRING_GROW'ed next. It also threw them # away rather than returning them to the parser. The effect was confusing # subsequent error messages. cat >input.y <<'_ATEOF' %token A "a %token B "b" %token AB "ab" // Used to complain that "ab" was already used. %token C '1 %token TWO "2" %token TICK_TWELVE "'12" // Used to complain that "'12" was already used. %% start: ; // Used to report a syntax error because it didn't see any kind of symbol // identifier. %type 'a ; %type "a ; // Used to report a syntax error because it didn't see braced code. %destructor { free ($$) _ATEOF { set +x $as_echo "$at_srcdir/input.at:874: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:874" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line input.y:4.10-5.0: error: missing \"'\" at end of line input.y:14.11-15.0: error: missing \"'\" at end of line input.y:16.11-17.0: error: missing '\"' at end of line input.y:19.13-20.0: error: missing '}' at end of file input.y:20.1: error: syntax error, unexpected end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:874" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:883: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y" "input.at:883" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line %token A \"a ^^ input.y:4.10-5.0: error: missing \"'\" at end of line %token C '1 ^^ input.y:14.11-15.0: error: missing \"'\" at end of line %type 'a ^^ input.y:16.11-17.0: error: missing '\"' at end of line %type \"a ^^ input.y:19.13-20.0: error: missing '}' at end of file %destructor { free (\$\$) ^^^^^^^^^^^ input.y:20.1: error: syntax error, unexpected end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:883" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_20 #AT_START_21 at_fn_group_banner 21 'input.at:909' \ "%start after first rule" " " 1 at_xfail=no ( $as_echo "21. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once complained that a %start after the first rule was a redeclaration # of the start symbol. cat >input.y <<'_ATEOF' %% false_start: ; start: false_start ; %start start; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:921: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:921" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:921" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:921: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:921" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:921" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:921: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:921" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:921" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:921: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:921" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:921" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:921: bison -o input.c input.y" at_fn_check_prepare_trace "input.at:921" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:921" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_21 #AT_START_22 at_fn_group_banner 22 'input.at:930' \ "%prec takes a token" " " 1 at_xfail=no ( $as_echo "22. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once allowed %prec sym where sym was a nonterminal. cat >input.y <<'_ATEOF' %% start: PREC %prec PREC ; PREC: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:940: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:940" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-4: error: rule given for PREC, which is a token " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:940" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_22 #AT_START_23 at_fn_group_banner 23 'input.at:951' \ "%prec's token must be defined" " " 1 at_xfail=no ( $as_echo "23. $at_setup_line: testing $at_desc ..." $at_traceon # According to POSIX, a %prec token must be defined separately. cat >input.y <<'_ATEOF' %% start: %prec PREC ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:960: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:960" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:960: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:960" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:960: bison input.y" at_fn_check_prepare_trace "input.at:960" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-17: warning: token for %prec is not defined: PREC " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:2.8-17: warning: token for %prec is not defined: PREC _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:960: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:960" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:960" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_23 #AT_START_24 at_fn_group_banner 24 'input.at:971' \ "Reject unused %code qualifiers" " " 1 at_xfail=no ( $as_echo "24. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-c.y <<'_ATEOF' %code q {} %code bad {} %code bad {} %code format {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:981: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c.y" "input.at:981" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c.y:1.7: error: %code qualifier 'q' is not used input-c.y:2.7-9: error: %code qualifier 'bad' is not used input-c.y:3.7-9: error: %code qualifier 'bad' is not used input-c.y:4.7-12: error: %code qualifier 'format' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:981" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c-glr.y <<'_ATEOF' %code q {} %code bad {} %code bad {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:995: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c-glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c-glr.y" "input.at:995" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c-glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c-glr.y:1.7: error: %code qualifier 'q' is not used input-c-glr.y:2.7-9: error: %code qualifier 'bad' is not used input-c-glr.y:3.8-10: error: %code qualifier 'bad' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:995" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c++.y <<'_ATEOF' %code q {} %code bad {} %code q {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1008: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++.y" "input.at:1008" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c++.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c++.y:1.7: error: %code qualifier 'q' is not used input-c++.y:2.7-9: error: %code qualifier 'bad' is not used input-c++.y:3.8: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1008" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c++-glr.y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++-glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++-glr.y" "input.at:1021" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c++-glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c++-glr.y:1.7-9: error: %code qualifier 'bad' is not used input-c++-glr.y:2.7: error: %code qualifier 'q' is not used input-c++-glr.y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1021" $at_failed && at_fn_log_failure $at_traceon; } cat >special-char-@@.y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1034: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-@@.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-@@.y" "input.at:1034" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison special-char-@@.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "special-char-@@.y:1.7-9: error: %code qualifier 'bad' is not used special-char-@@.y:2.7: error: %code qualifier 'q' is not used special-char-@@.y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1034" $at_failed && at_fn_log_failure $at_traceon; } cat >special-char-].y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-].y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-].y" "input.at:1047" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison special-char-].y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "special-char-].y:1.7-9: error: %code qualifier 'bad' is not used special-char-].y:2.7: error: %code qualifier 'q' is not used special-char-].y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1047" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_24 #AT_START_25 at_fn_group_banner 25 'input.at:1060' \ "%define errors" " " 1 at_xfail=no ( $as_echo "25. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-redefined.y <<'_ATEOF' %define var "value1" %define var "value1" %define var "value2" %define special1 "]" %define special2 "[" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1072: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-redefined.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-redefined.y" "input.at:1072" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-redefined.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-redefined.y:2.9-11: error: %define variable 'var' redefined input-redefined.y:1.9-11: previous definition input-redefined.y:3.10-12: error: %define variable 'var' redefined input-redefined.y:2.9-11: previous definition " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1072" $at_failed && at_fn_log_failure $at_traceon; } cat >input-unused.y <<'_ATEOF' %define var "value" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1085: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-unused.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-unused.y" "input.at:1085" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-unused.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-unused.y:1.9-11: error: %define variable 'var' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1085" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_25 #AT_START_26 at_fn_group_banner 26 'input.at:1096' \ "%define, --define, --force-define" " " 1 at_xfail=no ( $as_echo "26. $at_setup_line: testing $at_desc ..." $at_traceon cat >skel.c <<'_ATEOF' m4_divert_push(0)@ @output(b4_parser_file_name@)@ [var-dd: ]b4_percent_define_get([[var-dd]])[ var-ff: ]b4_percent_define_get([[var-ff]])[ var-dfg: ]b4_percent_define_get([[var-dfg]])[ var-fd: ]b4_percent_define_get([[var-fd]]) m4_divert_pop(0) _ATEOF cat >input.y <<'_ATEOF' %define var-dfg "gram" %% start: ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1112: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \\ --skeleton ./skel.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \ --skeleton ./skel.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1112: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \\ --skeleton ./skel.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \ --skeleton ./skel.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1112: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1112" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1112: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1112" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1112: bison -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \\ --skeleton ./skel.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112" ( $at_check_trace; bison -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \ --skeleton ./skel.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1117: cat input.tab.c" at_fn_check_prepare_trace "input.at:1117" ( $at_check_trace; cat input.tab.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "var-dd: cmd-d2 var-ff: cmd-f2 var-dfg: cmd-f var-fd: cmd-d " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1117" $at_failed && at_fn_log_failure $at_traceon; } cat >input-dg.y <<'_ATEOF' %define var "gram" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1129: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y" "input.at:1129" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined :1: previous definition " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1129" $at_failed && at_fn_log_failure $at_traceon; } cat >input-dg.y <<'_ATEOF' %define var "gram" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y" "input.at:1139" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined %define var \"gram\" ^^^ :2: previous definition " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1139" $at_failed && at_fn_log_failure $at_traceon; } cat >input-unused.y <<'_ATEOF' %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y" "input.at:1150" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":1: error: %define variable 'unused-d' is not used :2: error: %define variable 'unused-f' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1150" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_26 #AT_START_27 at_fn_group_banner 27 'input.at:1161' \ "%define Boolean variables" " " 1 at_xfail=no ( $as_echo "27. $at_setup_line: testing $at_desc ..." $at_traceon cat >Input.y <<'_ATEOF' %language "Java" %define public "maybe" %define parser_class_name "Input" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y" "input.at:1171" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison Input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Input.y:2.9-14: error: invalid value for %define Boolean variable 'public' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1171" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_27 #AT_START_28 at_fn_group_banner 28 'input.at:1181' \ "%define enum variables" " " 1 at_xfail=no ( $as_echo "28. $at_setup_line: testing $at_desc ..." $at_traceon # Front-end. cat >input.y <<'_ATEOF' %define lr.default-reductions bogus %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1189" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-29: error: invalid value for %define variable 'lr.default-reductions': 'bogus' input.y:1.9-29: accepted value: 'most' input.y:1.9-29: accepted value: 'consistent' input.y:1.9-29: accepted value: 'accepting' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1189" $at_failed && at_fn_log_failure $at_traceon; } # Back-end. # FIXME: these should be indented, but we shouldn't mess with the m4 yet cat >input.y <<'_ATEOF' %define api.push-pull neither %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1203" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' input.y:1.9-21: error: accepted value: 'pull' input.y:1.9-21: error: accepted value: 'push' input.y:1.9-21: error: accepted value: 'both' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1203" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_28 #AT_START_29 at_fn_group_banner 29 'input.at:1216' \ "%define backward compatibility" " " 1 at_xfail=no ( $as_echo "29. $at_setup_line: testing $at_desc ..." $at_traceon # The error messages tell us whether underscores in these variables are # being converted to dashes. cat >input.y <<'_ATEOF' %define api.push_pull "neither" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1226" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' input.y:1.9-21: error: accepted value: 'pull' input.y:1.9-21: error: accepted value: 'push' input.y:1.9-21: error: accepted value: 'both' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1226" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define lr.keep_unreachable_states maybe %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1238: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1238" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-34: error: invalid value for %define Boolean variable 'lr.keep-unreachable-states' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1238" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define foo_bar "baz" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1247" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-15: error: %define variable 'foo_bar' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1247" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_29 #AT_START_30 at_fn_group_banner 30 'input.at:1257' \ "Unused %define api.pure" " " 1 at_xfail=no ( $as_echo "30. $at_setup_line: testing $at_desc ..." $at_traceon # AT_CHECK_API_PURE(DECLS, VALUE) # ------------------------------- # Make sure Bison reports that `%define api.pure VALUE' is unused when DECLS # are specified. cat >input.y <<'_ATEOF' %define api.pure %language "c++" %defines %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1277" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1277" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "c++" %defines %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1278" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1278" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure "" %language "c++" %defines %glr-parser %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1279" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "c++" %defines %glr-parser %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1280: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1280" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1280" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure true %language "java" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1281" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1281" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "java" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1282: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1282" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1282" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_30 #AT_START_31 at_fn_group_banner 31 'input.at:1290' \ "C++ namespace reference errors" " " 1 at_xfail=no ( $as_echo "31. $at_setup_line: testing $at_desc ..." $at_traceon # AT_CHECK_NAMESPACE_ERROR(NAMESPACE-DECL, ERROR, [ERROR], ...) # ------------------------------------------------------------- # Make sure Bison reports all ERROR's for %define namespace "NAMESPACE-DECL". cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1311: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1311" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1311" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace " " %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1313" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1313" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "foo::::bar" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1315: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1315" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1315" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "foo:: ::bar" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1317: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1317" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1317" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "::::bar" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1319" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1319" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace ":: ::bar" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1321: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1321" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1321" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "foo::bar:: ::" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1323: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1323" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\" input.y:3.9-17: error: namespace reference has a trailing \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1323" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "foo::bar::" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1326: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1326" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1326" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "foo::bar:: " %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1328" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1328" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define namespace "::" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1330" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1330" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_31 #AT_START_32 at_fn_group_banner 32 'input.at:1346' \ "Bad character literals" " " 1 at_xfail=no ( $as_echo "32. $at_setup_line: testing $at_desc ..." $at_traceon cat >empty.y <<'_ATEOF' %% start: ''; start: ' _ATEOF { set +x $as_echo "$at_srcdir/input.at:1353: \$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77" at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77" "input.at:1353" ( $at_check_trace; $PERL -e "print 'start: \'';" >> empty.y || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1353" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison empty.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison empty.y" "input.at:1355" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison empty.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "empty.y:2.8-9: warning: empty character literal empty.y:3.8-4.0: warning: empty character literal empty.y:3.8-4.0: error: missing \"'\" at end of line empty.y:4.8: warning: empty character literal empty.y:4.8: error: missing \"'\" at end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1355" $at_failed && at_fn_log_failure $at_traceon; } cat >two.y <<'_ATEOF' %% start: 'ab'; start: 'ab _ATEOF { set +x $as_echo "$at_srcdir/input.at:1368: \$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77" at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77" "input.at:1368" ( $at_check_trace; $PERL -e "print 'start: \'ab';" >> two.y || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1368" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1370: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison two.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison two.y" "input.at:1370" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison two.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "two.y:2.8-11: warning: extra characters in character literal two.y:3.8-4.0: warning: extra characters in character literal two.y:3.8-4.0: error: missing \"'\" at end of line two.y:4.8-10: warning: extra characters in character literal two.y:4.8-10: error: missing \"'\" at end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1370" $at_failed && at_fn_log_failure $at_traceon; } cat >three.y <<'_ATEOF' %% start: 'abc'; start: 'abc _ATEOF { set +x $as_echo "$at_srcdir/input.at:1383: \$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77" at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77" "input.at:1383" ( $at_check_trace; $PERL -e "print 'start: \'abc';" >> three.y || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison three.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison three.y" "input.at:1385" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison three.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "three.y:2.8-12: warning: extra characters in character literal three.y:3.8-4.0: warning: extra characters in character literal three.y:3.8-4.0: error: missing \"'\" at end of line three.y:4.8-11: warning: extra characters in character literal three.y:4.8-11: error: missing \"'\" at end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1385" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_32 #AT_START_33 at_fn_group_banner 33 'input.at:1399' \ "Bad escapes in literals" " " 1 at_xfail=no ( $as_echo "33. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% start: '\777' '\0' '\xfff' '\x0' '\uffff' '\u0000' '\Uffffffff' '\U00000000' '\ ' '\A'; _ATEOF # It is not easy to create special characters, we cannot even trust tr. # Beside we cannot even expect "echo '\0'" to output two characters # (well three with \n): at least Bash 3.2 converts the two-character # sequence "\0" into a single NUL character. { set +x $as_echo "$at_srcdir/input.at:1412: \$PERL -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y \\ || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1412" ( $at_check_trace; $PERL -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \ || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1412" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1415" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.9-12: error: invalid number after \\-escape: 777 input.y:2.8-13: warning: empty character literal input.y:2.16-17: error: invalid number after \\-escape: 0 input.y:2.15-18: warning: empty character literal input.y:2.21-25: error: invalid number after \\-escape: xfff input.y:2.20-26: warning: empty character literal input.y:2.29-31: error: invalid number after \\-escape: x0 input.y:2.28-32: warning: empty character literal input.y:3.9-14: error: invalid number after \\-escape: uffff input.y:3.8-15: warning: empty character literal input.y:3.18-23: error: invalid number after \\-escape: u0000 input.y:3.17-24: warning: empty character literal input.y:3.27-36: error: invalid number after \\-escape: Uffffffff input.y:3.26-37: warning: empty character literal input.y:3.40-49: error: invalid number after \\-escape: U00000000 input.y:3.39-50: warning: empty character literal input.y:4.9-10: error: invalid character after \\-escape: ' ' input.y:4.8-11: warning: empty character literal input.y:4.14-15: error: invalid character after \\-escape: A input.y:4.13-16: warning: empty character literal input.y:5.9-16: error: invalid character after \\-escape: \\t input.y:5.17: error: invalid character after \\-escape: \\f input.y:5.18: error: invalid character after \\-escape: \\0 input.y:5.19: error: invalid character after \\-escape: \\001 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1415" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_33 #AT_START_34 at_fn_group_banner 34 'input.at:1448' \ "LAC: Errors for %define" " " 1 at_xfail=no ( $as_echo "34. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% start: ; _ATEOF # parse.lac.* options are useless if LAC isn't actually activated. { set +x $as_echo "$at_srcdir/input.at:1456: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y" "input.at:1456" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":1: error: %define variable 'parse.lac.es-capacity-initial' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1456" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y" "input.at:1460" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":1: error: %define variable 'parse.lac.memory-trace' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1460" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_34 #AT_START_35 at_fn_group_banner 35 'input.at:1471' \ "-Werror is not affected by -Wnone and -Wall" " " 1 at_xfail=no ( $as_echo "35. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% foo-bar: ; _ATEOF # -Werror is not enabled by -Wall or equivalent. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wall input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y" "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1479: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1479" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1479: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1479" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1479: bison -Wall input.y" at_fn_check_prepare_trace "input.at:1479" ( $at_check_trace; bison -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Werror" "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:1479: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1479" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error" "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror" "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror" "input.at:1479" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -W input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -W input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y" "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1482: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1482" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1482: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1482" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1482: bison -W input.y" at_fn_check_prepare_trace "input.at:1482" ( $at_check_trace; bison -W input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Werror" "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:1482: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1482" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=error" "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror" "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror" "input.at:1482" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wno-none input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wno-none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y" "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1485: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1485" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1485: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1485" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1485: bison -Wno-none input.y" at_fn_check_prepare_trace "input.at:1485" ( $at_check_trace; bison -Wno-none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror" "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:1485: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1485" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error" "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror" "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror" "input.at:1485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # -Werror is not disabled by -Wnone or equivalent. { set +x $as_echo "$at_srcdir/input.at:1490: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y" "input.at:1490" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1490" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1491: sed 's/^.*bison:/bison:/' stderr" at_fn_check_prepare_trace "input.at:1491" ( $at_check_trace; sed 's/^.*bison:/bison:/' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "bison: warnings being treated as errors input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1491" $at_failed && at_fn_log_failure $at_traceon; } mv stderr experr { set +x $as_echo "$at_srcdir/input.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y" "input.at:1496" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1496" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_35 #AT_START_36 at_fn_group_banner 36 'input.at:1505' \ "%name-prefix and %define api.prefix are incompatible" "" 1 at_xfail=no ( $as_echo "36. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION) # -------------------------------------------- cat >input.y <<'_ATEOF' %define api.prefix foo %name-prefix "bar" %% exp:; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1520" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-18: error: '%name-prefix' and '%define api.prefix' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1520" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %% exp:; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y" "input.at:1521" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":1: error: '%name-prefix' and '%define api.prefix' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1521" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %name-prefix "bar" %% exp:; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y" "input.at:1522" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":1: error: '%name-prefix' and '%define api.prefix' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1522" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.prefix foo %% exp:; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1523: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -p bar input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -p bar input.y" "input.at:1523" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -p bar input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.9-18: error: '%name-prefix' and '%define api.prefix' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1523" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_36 #AT_START_37 at_fn_group_banner 37 'input.at:1534' \ "Stray \$ or @" " " 1 at_xfail=no ( $as_echo "37. $at_setup_line: testing $at_desc ..." $at_traceon # Give %printer and %destructor "<*> exp TOK" instead of "<*>" to # check that the warnings are reported once, not three times. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token TOK %destructor { $%; @%; } <*> exp TOK; %initial-action { $%; @%; }; %printer { $%; @%; } <*> exp TOK; %% exp: TOK { $%; @%; $$ = $1; }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1548: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1548" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1548: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1548" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1548: bison input.y" at_fn_check_prepare_trace "input.at:1548" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:10.19: warning: stray '\$' input.y:10.23: warning: stray '@' input.y:11.19: warning: stray '\$' input.y:11.23: warning: stray '@' input.y:12.19: warning: stray '\$' input.y:12.23: warning: stray '@' input.y:14.19: warning: stray '\$' input.y:14.23: warning: stray '@' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:10.19: warning: stray '$' input.y:10.23: warning: stray '@' input.y:11.19: warning: stray '$' input.y:11.23: warning: stray '@' input.y:12.19: warning: stray '$' input.y:12.23: warning: stray '@' input.y:14.19: warning: stray '$' input.y:14.23: warning: stray '@' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/input.at:1548: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1548" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:1548" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_37 #AT_START_38 at_fn_group_banner 38 'input.at:1568' \ "Code injection" " " 1 at_xfail=no ( $as_echo "38. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST([MACRO]) # ---------------- # Try to have MACRO be run by bison. cat >input.y <<'_ATEOF' %type exp %token a %initial-action { $$; $$ }; %printer { $$ $$ } <> <*>; %lex-param { m4_errprintn(DEAD %lex-param) }; %parse-param { m4_errprintn(DEAD %parse-param) }; %% exp: a a[last] { $$; $1; $$ $1 $last $0 ; }; _ATEOF # FIXME: Provide a means to iterate over all the skeletons. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y" "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1619: bison -d input.y" at_fn_check_prepare_trace "input.at:1619" ( $at_check_trace; bison -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S glr.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y" "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1619: bison -d -S glr.c input.y" at_fn_check_prepare_trace "input.at:1619" ( $at_check_trace; bison -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S lalr1.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y" "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1619: bison -d -S lalr1.cc input.y" at_fn_check_prepare_trace "input.at:1619" ( $at_check_trace; bison -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S glr.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y" "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1619: bison -d -S glr.cc input.y" at_fn_check_prepare_trace "input.at:1619" ( $at_check_trace; bison -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -S lalr1.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y" "input.at:1619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1619: bison -S lalr1.java input.y" at_fn_check_prepare_trace "input.at:1619" ( $at_check_trace; bison -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %type <]m4_errprintn(DEAD %type)> exp %token <]m4_errprintn(DEAD %token)> a %initial-action { $$; $<]m4_errprintn(DEAD %initial-action)>$ }; %printer { $$ $<]m4_errprintn(DEAD %printer)>$ } <> <*>; %lex-param { ]m4_errprintn(DEAD %lex-param) }; %parse-param { ]m4_errprintn(DEAD %parse-param) }; %% exp: a a[last] { $$; $1; $<]m4_errprintn(DEAD action 1)>$ $<]m4_errprintn(DEAD action 2)>1 $<]m4_errprintn(DEAD action 3)>last $<]m4_errprintn(DEAD action 4)>0 ; }; _ATEOF # FIXME: Provide a means to iterate over all the skeletons. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y" "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1620: bison -d input.y" at_fn_check_prepare_trace "input.at:1620" ( $at_check_trace; bison -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S glr.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y" "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1620: bison -d -S glr.c input.y" at_fn_check_prepare_trace "input.at:1620" ( $at_check_trace; bison -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S lalr1.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y" "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1620: bison -d -S lalr1.cc input.y" at_fn_check_prepare_trace "input.at:1620" ( $at_check_trace; bison -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -S glr.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y" "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1620: bison -d -S glr.cc input.y" at_fn_check_prepare_trace "input.at:1620" ( $at_check_trace; bison -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -S lalr1.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y" "input.at:1620" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1620: bison -S lalr1.java input.y" at_fn_check_prepare_trace "input.at:1620" ( $at_check_trace; bison -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_38 #AT_START_39 at_fn_group_banner 39 'named-refs.at:21' \ "Tutorial calculator" " " 2 at_xfail=no ( $as_echo "39. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #include typedef int semantic_value; FILE *input; static semantic_value global_result = 0; static int global_count = 0; static int power (int base, int exponent); static void yyerror ( const char *msg); static int yylex (void); %} %union { semantic_value ival; }; %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ %% input: line | input line {} ; line: '\n' | exp '\n' {} ; exp: NUM { $$ = $NUM; } | exp[l] '=' exp[r] { if ($l != $r) fprintf (stderr, "calc: error: %d != %d\n", $l, $r); $$ = $l; } | exp[x] '+' { $$ = $x; } [l] exp[r] { $$ = $l + $r; } | exp[l] '-' exp[r] { $$ = $l - $r; } | exp[l] '*' exp[r] { $$ = $l * $r; } | exp[l] '/' exp[r] { $$ = $l / $r; } | '-' exp %prec NEG { $$ = -$2; } | exp[l] '^' exp[r] { $$ = power ($l, $r); } | '(' exp[e] ')' { $$ = $e; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int get_char (void) { int res = getc (input); return res; } static void unget_char (int c) { ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } static int yylex (void) { int c; /* Skip white space. */ while ((c = get_char ()) == ' ' || c == '\t') {} /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); fclose (input); assert (global_result == result); assert (global_count == count); return status; } _ATEOF cat >input.txt <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:184" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:184" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/named-refs.at:184: bison -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:184" ( $at_check_trace; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:185: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "named-refs.at:185" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:185: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "named-refs.at:185" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:186: \$PREPARSER ./test input.txt" at_fn_check_prepare_dynamic " $PREPARSER ./test input.txt" "named-refs.at:186" ( $at_check_trace; $PREPARSER ./test input.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:186" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:186: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "named-refs.at:186" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:186" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_39 #AT_START_40 at_fn_group_banner 40 'named-refs.at:195' \ "Undefined and ambiguous references" " " 2 at_xfail=no ( $as_echo "40. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ static int power (int base, int exponent); static void yyerror ( const char *msg); static int yylex (void); %} %union { int ival; }; %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ %% input: line | input line {} ; line: '\n' | exp '\n' {} ; exp: NUM { $$ = $NUM; } | exp[l] '=' exp[r] { if ($l != $r) fprintf (stderr, "calc: error: %d != %d\n", $l, $r); $$ = $l; } | exp[x] '+' { $$ = $x; } [l] exp[r] { $$ = $lo9 + $r; } | exp[x] '-' { $$ = $x; } [l] exp[r] { $$ = $exp - $r; } | exp[x] '*' { $$ = $x; } [l] exp[r] { $$ = $l * $r; } | exp[l] '/' exp[r] { $$ = $l / $r; } | '-' exp %prec NEG { $$ = -$2; } | exp[l] '^' exp[r] { $$ = power ($l, $r12); } | '(' exp ')' { $$ = $expo; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:253" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:50.51-60: error: invalid reference: '\$lo9' test.y:50.3-68: symbol not found in production: lo9 test.y:51.51-60: warning: misleading reference: '\$exp' test.y:42.1-3: refers to: \$exp at \$\$ test.y:51.7: possibly meant: \$x, hiding \$exp at \$1 test.y:51.41: possibly meant: \$r, hiding \$exp at \$4 test.y:52.51-52: error: \$l of 'exp' has no declared type test.y:55.40-43: error: invalid reference: '\$r12' test.y:55.3-47: symbol not found in production: r12 test.y:56.29-33: error: invalid reference: '\$expo' test.y:56.3-46: symbol not found in production: expo " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:253" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_40 #AT_START_41 at_fn_group_banner 41 'named-refs.at:271' \ "Misleading references" " " 2 at_xfail=no ( $as_echo "41. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start: foo foo.bar { $foo.bar; } foo: '1' foo.bar: '2' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:279: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:279" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/named-refs.at:279: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:279" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/named-refs.at:279: bison -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:279" ( $at_check_trace; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.22-29: warning: misleading reference: '\$foo.bar' test.y:11.8-10: refers to: \$foo at \$1 test.y:11.12-18: possibly meant: \$[foo.bar] at \$2 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Werror" "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' test.y:11.22-29: warning: misleading reference: '$foo.bar' test.y:11.8-10: refers to: $foo at $1 test.y:11.12-18: possibly meant: $[foo.bar] at $2 _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/named-refs.at:279: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:279" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error" "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror" "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror" "named-refs.at:279" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_41 #AT_START_42 at_fn_group_banner 42 'named-refs.at:288' \ "Many kinds of errors" " " 2 at_xfail=no ( $as_echo "42. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %token IDENT %token NUMBER %token ASSIGNOP %token IF %token IF1 %token THEN %token ELSE %token FI %token WHILE %token DO %token OD %start program %% if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI { $if_stmt1 = new IfStmt($cond1, $then.f1, $else); }; if_stmt2: IF expr[cond] THEN stmt[then] FI { $if_stmt2 = new IfStmt($cond, $stmt.field, 0); }; if_stmt3: IF expr[cond] THEN stmt.list FI { $if_stmt3 = new IfStmt($cond, $stmt.list, 0); }; if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI { $if_stmt4 = new IfStmt($cond, $xyz, $cond); }; if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI { $if_stmt5 = new IfStmt($cond, $stmt.list, $else); }; if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI { $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); }; if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI { $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); }; if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI { $if_stmt8 = new IfStmt($cond, $then.1, $else); }; if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI { $if_stmt9 = new IfStmt($cond, $then.1.field, $else); }; if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI { $if_stmt10 = new IfStmt($cond, $stmt.x, 0); }; if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI { $if-stmt-a = new IfStmt($cond, $then, $else); }; if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI { $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); }; program: stmt.list; stmt.list: stmt ';' stmt.list { $3->insert($stmt); $$ = $3; } | stmt ';' { SL = new StmtList(); SL->insert($1); $$ = SL; } ; stmt: assign_stmt { $$ = $1; } | if_stmt { $$ = $1; } | if_stmt1 { $$ = $1; } | while_stmt { $$ = $1; } ; assign_stmt: IDENT ASSIGNOP expr { $$ = new AssignStmt(string($1),$3); }; if_stmt: IF expr[cond] THEN stmt.list FI { $if_stmt = new IfStmt($cond, $[stmt.list], 0); }; while_stmt[res]: WHILE expr DO stmt.list OD { $res = new WhileStmt($[expr], $[stmt.list]); }; expr: expr '+' term { $$ = new Plus($1,$3); } | expr '-' term { $$ = new Minus($1,$3); } | term { $$ = $1; } ; term: term '*' factor { $$ = new Times($1,$3); } | factor { $$ = $1; } ; factor: '(' expr ')' { $$ = $2; } | NUMBER { $$ = new Number($1); } | IDENT { $$ = new Ident(string($1)); } ; _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:355" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1' test.y:23.11-24.62: symbol not found in production: cond1 test.y:26.43-53: error: invalid reference: '\$stmt.field' test.y:25.11-26.60: symbol not found in production: stmt test.y:25.35-38: possibly meant: \$then.field, hiding \$stmt.field at \$4 test.y:28.43-52: error: invalid reference: '\$stmt.list' test.y:27.11-28.59: symbol not found in production: stmt test.y:27.30-38: possibly meant: \$[stmt.list] at \$4 test.y:30.43-46: error: ambiguous reference: '\$xyz' test.y:29.35-37: refers to: \$xyz at \$4 test.y:29.50-52: refers to: \$xyz at \$6 test.y:32.43-52: error: invalid reference: '\$stmt.list' test.y:31.11-32.63: symbol not found in production: stmt test.y:31.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 test.y:31.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 test.y:34.43-58: error: invalid reference: '\$stmt.list.field' test.y:33.11-34.69: symbol not found in production: stmt test.y:33.40-43: possibly meant: \$then.field, hiding \$[stmt.list].field at \$4 test.y:33.61-64: possibly meant: \$else.field, hiding \$[stmt.list].field at \$6 test.y:36.43-54: error: invalid reference: '\$[stmt.list]' test.y:35.11-36.71: symbol not found in production: stmt.list test.y:35.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 test.y:35.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 test.y:38.43-49: error: invalid reference: '\$then.1' test.y:37.11-38.60: symbol not found in production: then test.y:37.40-45: possibly meant: \$[then.1] at \$4 test.y:40.43-55: error: invalid reference: '\$then.1.field' test.y:39.11-40.66: symbol not found in production: then test.y:39.40-45: possibly meant: \$[then.1].field at \$4 test.y:42.44-50: error: invalid reference: '\$stmt.x' test.y:41.12-42.57: symbol not found in production: stmt test.y:41.36-41: possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4 test.y:41.36-41: possibly meant: \$[stmt.x] at \$4 test.y:44.13-22: error: invalid reference: '\$if-stmt-a' test.y:43.12-44.59: symbol not found in production: if test.y:43.1-9: possibly meant: \$[if-stmt-a] at \$\$ test.y:46.46-54: error: invalid reference: '\$then-a.f' test.y:45.12-46.65: symbol not found in production: then test.y:45.41-46: possibly meant: \$[then-a].f at \$4 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:355" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y" "named-refs.at:397" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1' { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); }; ^^^^^^ test.y:23.11-24.62: symbol not found in production: cond1 if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:26.43-53: error: invalid reference: '\$stmt.field' { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); }; ^^^^^^^^^^^ test.y:25.11-26.60: symbol not found in production: stmt if_stmt2: IF expr[cond] THEN stmt[then] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:25.35-38: possibly meant: \$then.field, hiding \$stmt.field at \$4 if_stmt2: IF expr[cond] THEN stmt[then] FI ^^^^ test.y:28.43-52: error: invalid reference: '\$stmt.list' { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); }; ^^^^^^^^^^ test.y:27.11-28.59: symbol not found in production: stmt if_stmt3: IF expr[cond] THEN stmt.list FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:27.30-38: possibly meant: \$[stmt.list] at \$4 if_stmt3: IF expr[cond] THEN stmt.list FI ^^^^^^^^^ test.y:30.43-46: error: ambiguous reference: '\$xyz' { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); }; ^^^^ test.y:29.35-37: refers to: \$xyz at \$4 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI ^^^ test.y:29.50-52: refers to: \$xyz at \$6 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI ^^^ test.y:32.43-52: error: invalid reference: '\$stmt.list' { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); }; ^^^^^^^^^^ test.y:31.11-32.63: symbol not found in production: stmt if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:31.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:31.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:34.43-58: error: invalid reference: '\$stmt.list.field' { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); }; ^^^^^^^^^^^^^^^^ test.y:33.11-34.69: symbol not found in production: stmt if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:33.40-43: possibly meant: \$then.field, hiding \$[stmt.list].field at \$4 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:33.61-64: possibly meant: \$else.field, hiding \$[stmt.list].field at \$6 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:36.43-54: error: invalid reference: '\$[stmt.list]' { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); }; ^^^^^^^^^^^^ test.y:35.11-36.71: symbol not found in production: stmt.list if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:35.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:35.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^ test.y:38.43-49: error: invalid reference: '\$then.1' { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); }; ^^^^^^^ test.y:37.11-38.60: symbol not found in production: then if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:37.40-45: possibly meant: \$[then.1] at \$4 if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI ^^^^^^ test.y:40.43-55: error: invalid reference: '\$then.1.field' { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); }; ^^^^^^^^^^^^^ test.y:39.11-40.66: symbol not found in production: then if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:39.40-45: possibly meant: \$[then.1].field at \$4 if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI ^^^^^^ test.y:42.44-50: error: invalid reference: '\$stmt.x' { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); }; ^^^^^^^ test.y:41.12-42.57: symbol not found in production: stmt if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:41.36-41: possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI ^^^^^^ test.y:41.36-41: possibly meant: \$[stmt.x] at \$4 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI ^^^^^^ test.y:44.13-22: error: invalid reference: '\$if-stmt-a' { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); }; ^^^^^^^^^^ test.y:43.12-44.59: symbol not found in production: if if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:43.1-9: possibly meant: \$[if-stmt-a] at \$\$ if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI ^^^^^^^^^ test.y:46.46-54: error: invalid reference: '\$then-a.f' { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); }; ^^^^^^^^^ test.y:45.12-46.65: symbol not found in production: then if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test.y:45.41-46: possibly meant: \$[then-a].f at \$4 if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI ^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:397" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_42 #AT_START_43 at_fn_group_banner 43 'named-refs.at:521' \ "Missing identifiers in brackets" " " 2 at_xfail=no ( $as_echo "43. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start: foo[] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:528: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:528" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.12: error: an identifier expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:528" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_43 #AT_START_44 at_fn_group_banner 44 'named-refs.at:535' \ "Redundant words in brackets" " " 2 at_xfail=no ( $as_echo "44. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start: foo[ a d ] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:542" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.15: error: unexpected identifier in bracketed name: 'd' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:542" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_44 #AT_START_45 at_fn_group_banner 45 'named-refs.at:549' \ "Comments in brackets" " " 2 at_xfail=no ( $as_echo "45. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start: foo[/* comment */] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:556" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.25: error: an identifier expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:556" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_45 #AT_START_46 at_fn_group_banner 46 'named-refs.at:563' \ "Stray symbols in brackets" " " 2 at_xfail=no ( $as_echo "46. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:570: \$PERL -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' test.y || exit 77" at_fn_check_prepare_dynamic "$PERL -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' test.y || exit 77" "named-refs.at:570" ( $at_check_trace; $PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:570" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:571: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:571" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.13: error: invalid character in bracketed name: '%' test.y:11.25-27: error: invalid characters in bracketed name: '*&-' test.y:11.29-30: error: invalid characters in bracketed name: '+\\0\\001\\002\\377' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:571" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_46 #AT_START_47 at_fn_group_banner 47 'named-refs.at:580' \ "Redundant words in LHS brackets" " " 2 at_xfail=no ( $as_echo "47. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start[a s]: foo; _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:586: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:586" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.9: error: unexpected identifier in bracketed name: 's' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:586" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_47 #AT_START_48 at_fn_group_banner 48 'named-refs.at:595' \ "Factored LHS" " " 2 at_xfail=no ( $as_echo "48. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% start[a]: "foo" | "bar"; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/named-refs.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:601" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:601" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:601: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:601" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/named-refs.at:601: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:601" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/named-refs.at:601: bison -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:601" ( $at_check_trace; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_48 #AT_START_49 at_fn_group_banner 49 'named-refs.at:606' \ "Unresolved references" " " 2 at_xfail=no ( $as_echo "49. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %% stat: sym_a sym_b { func($sym.field); } | sym_a sym_b { func($sym.field); } | sym_a sym_b { func($[sym.field]); } | sym_a sym_b { func($[sym.field]); } | sym_a sym_b { func($sym); } | sym_a sym_b { func($sym); } | sym_a sym_b { func($[sym]); } sym_a sym_b { func($[sym]); } ; stat1: sym_a sym_b { func($sym-field); } | sym_a sym_b { func($sym-field); } | sym_a sym_b { func($[sym-field]); } | sym_a sym_b { func($[sym-field]); } | sym_a sym_b { func($sym); } | sym_a sym_b { func($sym); } | sym_a sym_b { func($[sym]); } sym_a sym_b { func($[sym]); } ; sym_a: 'a'; sym_b: 'b'; _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:633: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:633" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:12.22-31: error: invalid reference: '\$sym.field' test.y:12.3-35: symbol not found in production: sym test.y:13.22-35: error: invalid reference: '\$sym.field' test.y:13.3-39: symbol not found in production: sym test.y:14.22-33: error: invalid reference: '\$[sym.field]' test.y:14.3-37: symbol not found in production: sym.field test.y:15.22-37: error: invalid reference: '\$[sym.field]' test.y:15.3-41: symbol not found in production: sym.field test.y:16.22-25: error: invalid reference: '\$sym' test.y:16.3-29: symbol not found in production: sym test.y:17.22-29: error: invalid reference: '\$sym' test.y:17.3-33: symbol not found in production: sym test.y:18.22-27: error: invalid reference: '\$[sym]' test.y:18.3-65: symbol not found in production before \$3: sym test.y:18.52-61: error: invalid reference: '\$[sym]' test.y:18.3-65: symbol not found in production: sym test.y:22.22-31: error: invalid reference: '\$sym-field' test.y:22.3-35: symbol not found in production: sym test.y:23.22-35: error: invalid reference: '\$sym-field' test.y:23.3-39: symbol not found in production: sym test.y:24.22-33: error: invalid reference: '\$[sym-field]' test.y:24.3-37: symbol not found in production: sym-field test.y:25.22-37: error: invalid reference: '\$[sym-field]' test.y:25.3-41: symbol not found in production: sym-field test.y:26.22-25: error: invalid reference: '\$sym' test.y:26.3-29: symbol not found in production: sym test.y:27.22-29: error: invalid reference: '\$sym' test.y:27.3-33: symbol not found in production: sym test.y:28.22-27: error: invalid reference: '\$[sym]' test.y:28.3-65: symbol not found in production before \$3: sym test.y:28.52-61: error: invalid reference: '\$[sym]' test.y:28.3-65: symbol not found in production: sym " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:633" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_49 #AT_START_50 at_fn_group_banner 50 'named-refs.at:671' \ "\$ or @ followed by . or -" " " 2 at_xfail=no ( $as_echo "50. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %% start: .field { $.field; } | 'a' { @.field; } ; .field: ; _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y" "named-refs.at:681" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:4.12-18: error: invalid reference: '\$.field' test.y:4.13: syntax error after '\$', expecting integer, letter, '_', '[', or '\$' test.y:4.3-8: possibly meant: \$[.field] at \$1 test.y:5.12-18: error: invalid reference: '@.field' test.y:5.13: syntax error after '@', expecting integer, letter, '_', '[', or '\$' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >test.y <<'_ATEOF' %% start: 'a' { $-field; } | 'b' { @-field; } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y" "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:696: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:696" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/named-refs.at:696: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:696" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/named-refs.at:696: bison test.y" at_fn_check_prepare_trace "named-refs.at:696" ( $at_check_trace; bison test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:4.9: warning: stray '\$' test.y:5.9: warning: stray '@' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Werror" "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' test.y:4.9: warning: stray '$' test.y:5.9: warning: stray '@' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/named-refs.at:696: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:696" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=error" "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Wnone -Werror" "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror" "named-refs.at:696" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_50 #AT_START_51 at_fn_group_banner 51 'output.at:44' \ "Output files: -dv " " " 3 at_xfail=no ( $as_echo "51. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.output foo.tab.c foo.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y " "output.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:44: bison -dv foo.y " at_fn_check_prepare_trace "output.at:44" ( $at_check_trace; bison -dv foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:44: ls foo.output foo.tab.c foo.tab.h" at_fn_check_prepare_trace "output.at:44" ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:44" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_51 #AT_START_52 at_fn_group_banner 52 'output.at:50' \ "Output files: -dv >&-" " " 3 at_xfail=no ( $as_echo "52. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/output.at:50: case \"\$PREBISON\" in *valgrind*) exit 77;; esac" at_fn_check_prepare_dynamic "case \"$PREBISON\" in *valgrind*) exit 77;; esac" "output.at:50" ( $at_check_trace; case "$PREBISON" in *valgrind*) exit 77;; esac ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } for file in foo.y foo.output foo.tab.c foo.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:50: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv foo.y >&-" at_fn_check_prepare_notrace 'an embedded newline' "output.at:50" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv foo.y >&- ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:50: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&-" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&-" "output.at:50" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&- ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:50: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:50" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:50: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:50" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:50: bison -dv foo.y >&-" at_fn_check_prepare_trace "output.at:50" ( $at_check_trace; bison -dv foo.y >&- ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:50: ls foo.output foo.tab.c foo.tab.h" at_fn_check_prepare_trace "output.at:50" ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:50" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_52 #AT_START_53 at_fn_group_banner 53 'output.at:55' \ "Output files: -dv -o foo.c " " " 3 at_xfail=no ( $as_echo "53. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.c foo.h foo.output; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:55: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv -o foo.c foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:55" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:55: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y " "output.at:55" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:55: bison -dv -o foo.c foo.y " at_fn_check_prepare_trace "output.at:55" ( $at_check_trace; bison -dv -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:55: ls foo.c foo.h foo.output" at_fn_check_prepare_trace "output.at:55" ( $at_check_trace; ls foo.c foo.h foo.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:55" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_53 #AT_START_54 at_fn_group_banner 54 'output.at:57' \ "Output files: -dv -o foo.tab.c " " " 3 at_xfail=no ( $as_echo "54. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.output foo.tab.c foo.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:57" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y " "output.at:57" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:57: bison -dv -o foo.tab.c foo.y " at_fn_check_prepare_trace "output.at:57" ( $at_check_trace; bison -dv -o foo.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:57: ls foo.output foo.tab.c foo.tab.h" at_fn_check_prepare_trace "output.at:57" ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:57" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_54 #AT_START_55 at_fn_group_banner 55 'output.at:59' \ "Output files: -dv -y " " " 3 at_xfail=no ( $as_echo "55. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.output y.tab.c y.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv -y foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:59" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y " "output.at:59" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:59: bison -dv -y foo.y " at_fn_check_prepare_trace "output.at:59" ( $at_check_trace; bison -dv -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:59: ls y.output y.tab.c y.tab.h" at_fn_check_prepare_trace "output.at:59" ( $at_check_trace; ls y.output y.tab.c y.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:59" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_55 #AT_START_56 at_fn_group_banner 56 'output.at:61' \ "Output files: -dv -b bar " " " 3 at_xfail=no ( $as_echo "56. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.output bar.tab.c bar.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:61: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv -b bar foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:61" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv -b bar foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:61: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y " "output.at:61" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:61: bison -dv -b bar foo.y " at_fn_check_prepare_trace "output.at:61" ( $at_check_trace; bison -dv -b bar foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:61: ls bar.output bar.tab.c bar.tab.h" at_fn_check_prepare_trace "output.at:61" ( $at_check_trace; ls bar.output bar.tab.c bar.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:61" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_56 #AT_START_57 at_fn_group_banner 57 'output.at:63' \ "Output files: -dv -g -o foo.c " " " 3 at_xfail=no ( $as_echo "57. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.c foo.dot foo.h foo.output; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -dv -g -o foo.c foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:63" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -dv -g -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y " "output.at:63" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:63: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:63" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:63: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:63" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:63: bison -dv -g -o foo.c foo.y " at_fn_check_prepare_trace "output.at:63" ( $at_check_trace; bison -dv -g -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:63: ls foo.c foo.dot foo.h foo.output" at_fn_check_prepare_trace "output.at:63" ( $at_check_trace; ls foo.c foo.dot foo.h foo.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:63" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_57 #AT_START_58 at_fn_group_banner 58 'output.at:67' \ "Output files: %defines %verbose " " " 3 at_xfail=no ( $as_echo "58. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.output foo.tab.c foo.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:67" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " "output.at:67" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:67" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:67" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:67: bison foo.y " at_fn_check_prepare_trace "output.at:67" ( $at_check_trace; bison foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:67: ls foo.output foo.tab.c foo.tab.h" at_fn_check_prepare_trace "output.at:67" ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:67" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_58 #AT_START_59 at_fn_group_banner 59 'output.at:69' \ "Output files: %defines %verbose %yacc " " " 3 at_xfail=no ( $as_echo "59. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.output y.tab.c y.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %defines %verbose %yacc %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:69" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " "output.at:69" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:69" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:69" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:69: bison foo.y " at_fn_check_prepare_trace "output.at:69" ( $at_check_trace; bison foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:69: ls y.output y.tab.c y.tab.h" at_fn_check_prepare_trace "output.at:69" ( $at_check_trace; ls y.output y.tab.c y.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:69" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_59 #AT_START_60 at_fn_group_banner 60 'output.at:72' \ "Output files: %defines %verbose %yacc " " " 3 at_xfail=no ( $as_echo "60. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy y.output y.tab.c y.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %defines %verbose %yacc %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:72" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " "output.at:72" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:72: bison foo.yy " at_fn_check_prepare_trace "output.at:72" ( $at_check_trace; bison foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:72: ls y.output y.tab.c y.tab.h" at_fn_check_prepare_trace "output.at:72" ( $at_check_trace; ls y.output y.tab.c y.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:72" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_60 #AT_START_61 at_fn_group_banner 61 'output.at:76' \ "Output files: %file-prefix \"bar\" %defines %verbose " "" 3 at_xfail=no ( $as_echo "61. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.output bar.tab.c bar.tab.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %file-prefix "bar" %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:76: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:76" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:76: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " "output.at:76" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:76: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:76" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:76: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:76" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:76: bison foo.y " at_fn_check_prepare_trace "output.at:76" ( $at_check_trace; bison foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:76: ls bar.output bar.tab.c bar.tab.h" at_fn_check_prepare_trace "output.at:76" ( $at_check_trace; ls bar.output bar.tab.c bar.tab.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:76" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_61 #AT_START_62 at_fn_group_banner 62 'output.at:78' \ "Output files: %output=\"bar.c\" %defines %verbose %yacc " "" 3 at_xfail=no ( $as_echo "62. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.output bar.c bar.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %output="bar.c" %defines %verbose %yacc %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:78" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " "output.at:78" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:78" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:78" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:78: bison foo.y " at_fn_check_prepare_trace "output.at:78" ( $at_check_trace; bison foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:78: ls bar.output bar.c bar.h" at_fn_check_prepare_trace "output.at:78" ( $at_check_trace; ls bar.output bar.c bar.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:78" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_62 #AT_START_63 at_fn_group_banner 63 'output.at:80' \ "Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc " "" 3 at_xfail=no ( $as_echo "63. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.output bar.c bar.h; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.y <<'_ATEOF' %file-prefix="baz" %output "bar.c" %defines %verbose %yacc %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.y " at_fn_check_prepare_notrace 'an embedded newline' "output.at:80" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y " "output.at:80" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:80" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:80" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:80: bison foo.y " at_fn_check_prepare_trace "output.at:80" ( $at_check_trace; bison foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:80: ls bar.output bar.c bar.h" at_fn_check_prepare_trace "output.at:80" ( $at_check_trace; ls bar.output bar.c bar.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:80" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_63 #AT_START_64 at_fn_group_banner 64 'output.at:87' \ "Output files: %defines %verbose " " " 3 at_xfail=no ( $as_echo "64. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.output foo.tab.cc foo.tab.hh; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:87" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " "output.at:87" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:87: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:87: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:87: bison foo.yy " at_fn_check_prepare_trace "output.at:87" ( $at_check_trace; bison foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:87: ls foo.output foo.tab.cc foo.tab.hh" at_fn_check_prepare_trace "output.at:87" ( $at_check_trace; ls foo.output foo.tab.cc foo.tab.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:87" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_64 #AT_START_65 at_fn_group_banner 65 'output.at:90' \ "Output files: %defines %verbose -o foo.c " " " 3 at_xfail=no ( $as_echo "65. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.c foo.h foo.output; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o foo.c foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o foo.c foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy " "output.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:90: bison -o foo.c foo.yy " at_fn_check_prepare_trace "output.at:90" ( $at_check_trace; bison -o foo.c foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:90: ls foo.c foo.h foo.output" at_fn_check_prepare_trace "output.at:90" ( $at_check_trace; ls foo.c foo.h foo.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:90" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_65 #AT_START_66 at_fn_group_banner 66 'output.at:93' \ "Output files: --defines=foo.hpp -o foo.c++ " " " 3 at_xfail=no ( $as_echo "66. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.c++ foo.hpp; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:93" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy " "output.at:93" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:93: bison --defines=foo.hpp -o foo.c++ foo.yy " at_fn_check_prepare_trace "output.at:93" ( $at_check_trace; bison --defines=foo.hpp -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:93: ls foo.c++ foo.hpp" at_fn_check_prepare_trace "output.at:93" ( $at_check_trace; ls foo.c++ foo.hpp ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:93" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_66 #AT_START_67 at_fn_group_banner 67 'output.at:97' \ "Output files: %defines \"foo.hpp\" -o foo.c++ " " " 3 at_xfail=no ( $as_echo "67. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.c++ foo.hpp; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %defines "foo.hpp" %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o foo.c++ foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:97" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy " "output.at:97" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:97: bison -o foo.c++ foo.yy " at_fn_check_prepare_trace "output.at:97" ( $at_check_trace; bison -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:97: ls foo.c++ foo.hpp" at_fn_check_prepare_trace "output.at:97" ( $at_check_trace; ls foo.c++ foo.hpp ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:97" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_67 #AT_START_68 at_fn_group_banner 68 'output.at:101' \ "Output files: -o foo.c++ --graph=foo.gph " " " 3 at_xfail=no ( $as_echo "68. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.c++ foo.gph; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o foo.c++ foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:101" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy " "output.at:101" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:101: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:101" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:101: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:101" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:101: bison -o foo.c++ --graph=foo.gph foo.yy " at_fn_check_prepare_trace "output.at:101" ( $at_check_trace; bison -o foo.c++ --graph=foo.gph foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:101: ls foo.c++ foo.gph" at_fn_check_prepare_trace "output.at:101" ( $at_check_trace; ls foo.c++ foo.gph ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:101" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_68 #AT_START_69 at_fn_group_banner 69 'output.at:116' \ "Output files: %skeleton \"lalr1.cc\" %defines %verbose " "" 3 at_xfail=no ( $as_echo "69. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:116: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:116" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:116: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy " "output.at:116" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:116: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:116: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:116: bison foo.yy " at_fn_check_prepare_trace "output.at:116" ( $at_check_trace; bison foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:116: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh" at_fn_check_prepare_trace "output.at:116" ( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:116" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_69 #AT_START_70 at_fn_group_banner 70 'output.at:119' \ "Output files: %skeleton \"lalr1.cc\" %defines %verbose " "" 3 at_xfail=no ( $as_echo "70. $at_setup_line: testing $at_desc ..." $at_traceon for file in subdir/foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >subdir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot subdir/foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:119" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml subdir/foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml subdir/foo.yy " "output.at:119" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:119: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:119" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:119: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:119" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:119: bison subdir/foo.yy " at_fn_check_prepare_trace "output.at:119" ( $at_check_trace; bison subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:119: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh" at_fn_check_prepare_trace "output.at:119" ( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } # Also make sure that the includes do not refer to the subdirectory. { set +x $as_echo "$at_srcdir/output.at:119: grep 'include .subdir/' foo.tab.cc" at_fn_check_prepare_trace "output.at:119" ( $at_check_trace; grep 'include .subdir/' foo.tab.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:119: grep 'include .subdir/' foo.tab.hh" at_fn_check_prepare_trace "output.at:119" ( $at_check_trace; grep 'include .subdir/' foo.tab.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:119" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_70 #AT_START_71 at_fn_group_banner 71 'output.at:123' \ "Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc " "" 3 at_xfail=no ( $as_echo "71. $at_setup_line: testing $at_desc ..." $at_traceon for file in subdir/foo.yy subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >subdir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:123" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy " "output.at:123" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:123: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:123" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:123: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:123" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:123: bison -o subdir/foo.cc subdir/foo.yy " at_fn_check_prepare_trace "output.at:123" ( $at_check_trace; bison -o subdir/foo.cc subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:123: ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh" at_fn_check_prepare_trace "output.at:123" ( $at_check_trace; ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } # Also make sure that the includes do not refer to the subdirectory. { set +x $as_echo "$at_srcdir/output.at:123: grep 'include .subdir/' subdir/foo.cc" at_fn_check_prepare_trace "output.at:123" ( $at_check_trace; grep 'include .subdir/' subdir/foo.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:123: grep 'include .subdir/' subdir/foo.hh" at_fn_check_prepare_trace "output.at:123" ( $at_check_trace; grep 'include .subdir/' subdir/foo.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:123" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_71 #AT_START_72 at_fn_group_banner 72 'output.at:128' \ "Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\" " "" 3 at_xfail=no ( $as_echo "72. $at_setup_line: testing $at_desc ..." $at_traceon for file in gram_dir/foo.yy output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh; do case "$file" in */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;; esac done cat >gram_dir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo" %% foo: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot gram_dir/foo.yy " at_fn_check_prepare_notrace 'an embedded newline' "output.at:128" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml gram_dir/foo.yy " at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml gram_dir/foo.yy " "output.at:128" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:128: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:128" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:128: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:128" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:128: bison gram_dir/foo.yy " at_fn_check_prepare_trace "output.at:128" ( $at_check_trace; bison gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:128: ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh" at_fn_check_prepare_trace "output.at:128" ( $at_check_trace; ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:128" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_72 #AT_START_73 at_fn_group_banner 73 'output.at:158' \ "Conflicting output files: --graph=\"foo.tab.c\"" " " 3 at_xfail=no ( $as_echo "73. $at_setup_line: testing $at_desc ..." $at_traceon case "foo.y" in */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;; esac cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF cp foo.y expout # Because an output file name conflict is still a warning, Bison exits # with status 0, so AT_BISON_CHECK does not realize that there may be no # output file against which to check the XML. AT_BISON_CHECK_NO_XML # avoids that problem. { set +x $as_echo "$at_srcdir/output.at:158: bison --graph=\"foo.tab.c\" foo.y" at_fn_check_prepare_trace "output.at:158" ( $at_check_trace; bison --graph="foo.tab.c" foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.tab.c' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Werror" "output.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' foo.y: warning: conflicting outputs to file 'foo.tab.c' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/output.at:158: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "output.at:158" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=error" "output.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Wnone -Werror" "output.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=none -Werror" "output.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:158: cat foo.y" at_fn_check_prepare_trace "output.at:158" ( $at_check_trace; cat foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:158" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_73 #AT_START_74 at_fn_group_banner 74 'output.at:163' \ "Conflicting output files: %defines \"foo.output\" -v" "" 3 at_xfail=no ( $as_echo "74. $at_setup_line: testing $at_desc ..." $at_traceon case "foo.y" in */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;; esac cat >foo.y <<'_ATEOF' %defines "foo.output" %% foo: {}; _ATEOF cp foo.y expout # Because an output file name conflict is still a warning, Bison exits # with status 0, so AT_BISON_CHECK does not realize that there may be no # output file against which to check the XML. AT_BISON_CHECK_NO_XML # avoids that problem. { set +x $as_echo "$at_srcdir/output.at:163: bison -v foo.y" at_fn_check_prepare_trace "output.at:163" ( $at_check_trace; bison -v foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.output' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Werror" "output.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' foo.y: warning: conflicting outputs to file 'foo.output' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/output.at:163: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "output.at:163" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=error" "output.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror" "output.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror" "output.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:163: cat foo.y" at_fn_check_prepare_trace "output.at:163" ( $at_check_trace; cat foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:163" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_74 #AT_START_75 at_fn_group_banner 75 'output.at:168' \ "Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\"" "" 3 at_xfail=no ( $as_echo "75. $at_setup_line: testing $at_desc ..." $at_traceon case "foo.y" in */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;; esac cat >foo.y <<'_ATEOF' %skeleton "lalr1.cc" %defines %% foo: {}; _ATEOF cp foo.y expout # Because an output file name conflict is still a warning, Bison exits # with status 0, so AT_BISON_CHECK does not realize that there may be no # output file against which to check the XML. AT_BISON_CHECK_NO_XML # avoids that problem. { set +x $as_echo "$at_srcdir/output.at:168: bison --graph=\"location.hh\" foo.y" at_fn_check_prepare_trace "output.at:168" ( $at_check_trace; bison --graph="location.hh" foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'location.hh' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Werror" "output.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' foo.y: warning: conflicting outputs to file 'location.hh' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/output.at:168: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "output.at:168" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=error" "output.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Wnone -Werror" "output.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=none -Werror" "output.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:168: cat foo.y" at_fn_check_prepare_trace "output.at:168" ( $at_check_trace; cat foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:168" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_75 #AT_START_76 at_fn_group_banner 76 'output.at:173' \ "Conflicting output files: -o foo.y" " " 3 at_xfail=no ( $as_echo "76. $at_setup_line: testing $at_desc ..." $at_traceon case "foo.y" in */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;; esac cat >foo.y <<'_ATEOF' %% foo: {}; _ATEOF cp foo.y expout # Because an output file name conflict is still a warning, Bison exits # with status 0, so AT_BISON_CHECK does not realize that there may be no # output file against which to check the XML. AT_BISON_CHECK_NO_XML # avoids that problem. { set +x $as_echo "$at_srcdir/output.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y" "output.at:173" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o foo.y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: error: refusing to overwrite the input file 'foo.y' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:173: cat foo.y" at_fn_check_prepare_trace "output.at:173" ( $at_check_trace; cat foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_76 #AT_START_77 at_fn_group_banner 77 'output.at:219' \ "Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 3 at_xfail=no ( $as_echo "77. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:219: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; touch "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\"" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:219" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" " at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\"" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:219" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:219: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" " at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:219" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_77 #AT_START_78 at_fn_group_banner 78 'output.at:226' \ "Output file name: (" " " 3 at_xfail=no ( $as_echo "78. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:226: touch \"(.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:226" ( $at_check_trace; touch "(.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:226" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "(.c" --defines="(.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" "output.at:226" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_trace "output.at:226" ( $at_check_trace; bison -o "(.c" --defines="(.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: ls \"(.c\" \"(.h\"" at_fn_check_prepare_trace "output.at:226" ( $at_check_trace; ls "(.c" "(.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:226" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"(.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"(.c\" " "output.at:226" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "(.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:226" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "(.c" --defines="(.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" cxx.y" "output.at:226" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" cxx.y" at_fn_check_prepare_trace "output.at:226" ( $at_check_trace; bison -o "(.c" --defines="(.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: ls \"(.c\" \"(.h\"" at_fn_check_prepare_trace "output.at:226" ( $at_check_trace; ls "(.c" "(.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:226" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:226: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"(.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"(.c\" " "output.at:226" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "(.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:226" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_78 #AT_START_79 at_fn_group_banner 79 'output.at:227' \ "Output file name: )" " " 3 at_xfail=no ( $as_echo "79. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:227: touch \").tmp\" || exit 77" at_fn_check_prepare_trace "output.at:227" ( $at_check_trace; touch ").tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o ").c" --defines=").h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" "output.at:227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_trace "output.at:227" ( $at_check_trace; bison -o ").c" --defines=").h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: ls \").c\" \").h\"" at_fn_check_prepare_trace "output.at:227" ( $at_check_trace; ls ").c" ").h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:227" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \").c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \").c\" " "output.at:227" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c ").c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o ").c" --defines=").h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" cxx.y" "output.at:227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" cxx.y" at_fn_check_prepare_trace "output.at:227" ( $at_check_trace; bison -o ").c" --defines=").h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: ls \").c\" \").h\"" at_fn_check_prepare_trace "output.at:227" ( $at_check_trace; ls ").c" ").h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:227" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:227: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \").c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \").c\" " "output.at:227" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c ").c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:227" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_79 #AT_START_80 at_fn_group_banner 80 'output.at:228' \ "Output file name: #" " " 3 at_xfail=no ( $as_echo "80. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:228: touch \"#.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:228" ( $at_check_trace; touch "#.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:228" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "#.c" --defines="#.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" "output.at:228" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_trace "output.at:228" ( $at_check_trace; bison -o "#.c" --defines="#.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: ls \"#.c\" \"#.h\"" at_fn_check_prepare_trace "output.at:228" ( $at_check_trace; ls "#.c" "#.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:228" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"#.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"#.c\" " "output.at:228" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "#.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:228" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "#.c" --defines="#.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" cxx.y" "output.at:228" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" cxx.y" at_fn_check_prepare_trace "output.at:228" ( $at_check_trace; bison -o "#.c" --defines="#.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: ls \"#.c\" \"#.h\"" at_fn_check_prepare_trace "output.at:228" ( $at_check_trace; ls "#.c" "#.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:228" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:228: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"#.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"#.c\" " "output.at:228" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "#.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:228" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_80 #AT_START_81 at_fn_group_banner 81 'output.at:229' \ "Output file name: @@" " " 3 at_xfail=no ( $as_echo "81. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:229: touch \"@@.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:229" ( $at_check_trace; touch "@@.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:229" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" "output.at:229" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_trace "output.at:229" ( $at_check_trace; bison -o "@@.c" --defines="@@.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: ls \"@@.c\" \"@@.h\"" at_fn_check_prepare_trace "output.at:229" ( $at_check_trace; ls "@@.c" "@@.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:229" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@@.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@@.c\" " "output.at:229" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@@.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:229" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" cxx.y" "output.at:229" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" cxx.y" at_fn_check_prepare_trace "output.at:229" ( $at_check_trace; bison -o "@@.c" --defines="@@.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: ls \"@@.c\" \"@@.h\"" at_fn_check_prepare_trace "output.at:229" ( $at_check_trace; ls "@@.c" "@@.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:229" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:229: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@@.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@@.c\" " "output.at:229" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@@.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:229" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_81 #AT_START_82 at_fn_group_banner 82 'output.at:230' \ "Output file name: @{" " " 3 at_xfail=no ( $as_echo "82. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:230: touch \"@{.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:230" ( $at_check_trace; touch "@{.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:230" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" "output.at:230" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_trace "output.at:230" ( $at_check_trace; bison -o "@{.c" --defines="@{.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: ls \"@{.c\" \"@{.h\"" at_fn_check_prepare_trace "output.at:230" ( $at_check_trace; ls "@{.c" "@{.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:230" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@{.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@{.c\" " "output.at:230" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@{.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:230" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" cxx.y" "output.at:230" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" cxx.y" at_fn_check_prepare_trace "output.at:230" ( $at_check_trace; bison -o "@{.c" --defines="@{.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: ls \"@{.c\" \"@{.h\"" at_fn_check_prepare_trace "output.at:230" ( $at_check_trace; ls "@{.c" "@{.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:230" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:230: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@{.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@{.c\" " "output.at:230" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@{.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:230" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_82 #AT_START_83 at_fn_group_banner 83 'output.at:231' \ "Output file name: @}" " " 3 at_xfail=no ( $as_echo "83. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:231: touch \"@}.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:231" ( $at_check_trace; touch "@}.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:231" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" "output.at:231" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_trace "output.at:231" ( $at_check_trace; bison -o "@}.c" --defines="@}.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: ls \"@}.c\" \"@}.h\"" at_fn_check_prepare_trace "output.at:231" ( $at_check_trace; ls "@}.c" "@}.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:231" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@}.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@}.c\" " "output.at:231" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@}.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:231" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" cxx.y" "output.at:231" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" cxx.y" at_fn_check_prepare_trace "output.at:231" ( $at_check_trace; bison -o "@}.c" --defines="@}.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: ls \"@}.c\" \"@}.h\"" at_fn_check_prepare_trace "output.at:231" ( $at_check_trace; ls "@}.c" "@}.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:231" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:231: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@}.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@}.c\" " "output.at:231" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@}.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:231" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_83 #AT_START_84 at_fn_group_banner 84 'output.at:232' \ "Output file name: [" " " 3 at_xfail=no ( $as_echo "84. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:232: touch \"[.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:232" ( $at_check_trace; touch "[.tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "[.c" --defines="[.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" "output.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_trace "output.at:232" ( $at_check_trace; bison -o "[.c" --defines="[.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: ls \"[.c\" \"[.h\"" at_fn_check_prepare_trace "output.at:232" ( $at_check_trace; ls "[.c" "[.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:232" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"[.c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"[.c\" " "output.at:232" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "[.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "[.c" --defines="[.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" cxx.y" "output.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" cxx.y" at_fn_check_prepare_trace "output.at:232" ( $at_check_trace; bison -o "[.c" --defines="[.h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: ls \"[.c\" \"[.h\"" at_fn_check_prepare_trace "output.at:232" ( $at_check_trace; ls "[.c" "[.h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:232" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:232: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"[.c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"[.c\" " "output.at:232" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "[.c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:232" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_84 #AT_START_85 at_fn_group_banner 85 'output.at:233' \ "Output file name: ]" " " 3 at_xfail=no ( $as_echo "85. $at_setup_line: testing $at_desc ..." $at_traceon # Skip if platform doesn't support file name. For example, Cygwin # doesn't support file names containing ":" or "\". { set +x $as_echo "$at_srcdir/output.at:233: touch \"].tmp\" || exit 77" at_fn_check_prepare_trace "output.at:233" ( $at_check_trace; touch "].tmp" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %code { void yyerror ( const char *msg); int yylex (void); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:233" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "].c" --defines="].h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" "output.at:233" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_trace "output.at:233" ( $at_check_trace; bison -o "].c" --defines="].h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: ls \"].c\" \"].h\"" at_fn_check_prepare_trace "output.at:233" ( $at_check_trace; ls "].c" "].h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:233" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"].c\" " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"].c\" " "output.at:233" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "].c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %code { int yylex (yy::parser::semantic_type*); } %% start: {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:233" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o "].c" --defines="].h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" cxx.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" cxx.y" "output.at:233" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" cxx.y" at_fn_check_prepare_trace "output.at:233" ( $at_check_trace; bison -o "].c" --defines="].h" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: ls \"].c\" \"].h\"" at_fn_check_prepare_trace "output.at:233" ( $at_check_trace; ls "].c" "].h" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:233" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:233: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"].c\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"].c\" " "output.at:233" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "].c" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:233" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_85 #AT_START_86 at_fn_group_banner 86 'output.at:260' \ "Graph with no conflicts" " " 3 at_xfail=no ( $as_echo "86. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: a '?' b; a: ; b: 'b'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:260: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:260" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:260: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:260" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:260: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:260" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:260: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:260" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:260: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:260" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:260: grep -v // input.dot" at_fn_check_prepare_trace "output.at:260" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a '?' b\\l 2 a: .\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> \"0R2\" [style=solid] \"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 3 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a . '?' b\\l\"] 2 -> 4 [style=solid label=\"'?'\"] 3 [label=\"State 3\\n\\l 0 \$accept: exp \$end .\\l\"] 3 -> \"3R0\" [style=solid] \"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 1 exp: a '?' . b\\l 3 b: . 'b'\\l\"] 4 -> 5 [style=solid label=\"'b'\"] 4 -> 6 [style=dashed label=\"b\"] 5 [label=\"State 5\\n\\l 3 b: 'b' .\\l\"] 5 -> \"5R3\" [style=solid] \"5R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 1 exp: a '?' b .\\l\"] 6 -> \"6R1\" [style=solid] \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:260" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_86 #AT_START_87 at_fn_group_banner 87 'output.at:294' \ "Graph with unsolved S/R" " " 3 at_xfail=no ( $as_echo "87. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% start: 'a' | empty_a 'a' | 'b' | empty_b 'b' | 'c' | empty_c 'c' ; empty_a: %prec 'a'; empty_b: %prec 'b'; empty_c: %prec 'c'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:294: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:294" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:294: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:294" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:294: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:294" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:294: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:294" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:294: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:294" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:294: grep -v // input.dot" at_fn_check_prepare_trace "output.at:294" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . start \$end\\l 1 start: . 'a'\\l 2 | . empty_a 'a'\\l 3 | . 'b'\\l 4 | . empty_b 'b'\\l 5 | . 'c'\\l 6 | . empty_c 'c'\\l 7 empty_a: . ['a']\\l 8 empty_b: . ['b']\\l 9 empty_c: . ['c']\\l\"] 0 -> 1 [style=solid label=\"'a'\"] 0 -> 2 [style=solid label=\"'b'\"] 0 -> 3 [style=solid label=\"'c'\"] 0 -> 4 [style=dashed label=\"start\"] 0 -> 5 [style=dashed label=\"empty_a\"] 0 -> 6 [style=dashed label=\"empty_b\"] 0 -> 7 [style=dashed label=\"empty_c\"] 0 -> \"0R7d\" [label=\"['a']\", style=solid] \"0R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled] 0 -> \"0R8d\" [label=\"['b']\", style=solid] \"0R8d\" [label=\"R8\", fillcolor=5, shape=diamond, style=filled] 0 -> \"0R9d\" [label=\"['c']\", style=solid] \"0R9d\" [label=\"R9\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 1 start: 'a' .\\l\"] 1 -> \"1R1\" [style=solid] \"1R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 2 [label=\"State 2\\n\\l 3 start: 'b' .\\l\"] 2 -> \"2R3\" [style=solid] \"2R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 5 start: 'c' .\\l\"] 3 -> \"3R5\" [style=solid] \"3R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 0 \$accept: start . \$end\\l\"] 4 -> 8 [style=solid label=\"\$end\"] 5 [label=\"State 5\\n\\l 2 start: empty_a . 'a'\\l\"] 5 -> 9 [style=solid label=\"'a'\"] 6 [label=\"State 6\\n\\l 4 start: empty_b . 'b'\\l\"] 6 -> 10 [style=solid label=\"'b'\"] 7 [label=\"State 7\\n\\l 6 start: empty_c . 'c'\\l\"] 7 -> 11 [style=solid label=\"'c'\"] 8 [label=\"State 8\\n\\l 0 \$accept: start \$end .\\l\"] 8 -> \"8R0\" [style=solid] \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 2 start: empty_a 'a' .\\l\"] 9 -> \"9R2\" [style=solid] \"9R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 4 start: empty_b 'b' .\\l\"] 10 -> \"10R4\" [style=solid] \"10R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 11 [label=\"State 11\\n\\l 6 start: empty_c 'c' .\\l\"] 11 -> \"11R6\" [style=solid] \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:294" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_87 #AT_START_88 at_fn_group_banner 88 'output.at:358' \ "Graph with solved S/R" " " 3 at_xfail=no ( $as_echo "88. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %left 'a' %right 'b' %right 'c' %% start: 'a' | empty_a 'a' | 'b' | empty_b 'b' | 'c' | empty_c 'c' ; empty_a: %prec 'a'; empty_b: %prec 'b'; empty_c: %prec 'c'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:358: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:358" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:358: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:358" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:358: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:358" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:358: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:358" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:358: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:358" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:358: grep -v // input.dot" at_fn_check_prepare_trace "output.at:358" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . start \$end\\l 1 start: . 'a'\\l 2 | . empty_a 'a'\\l 3 | . 'b'\\l 4 | . empty_b 'b'\\l 5 | . 'c'\\l 6 | . empty_c 'c'\\l 7 empty_a: . ['a']\\l 8 empty_b: . []\\l 9 empty_c: . []\\l\"] 0 -> 1 [style=solid label=\"'b'\"] 0 -> 2 [style=solid label=\"'c'\"] 0 -> 3 [style=dashed label=\"start\"] 0 -> 4 [style=dashed label=\"empty_a\"] 0 -> 5 [style=dashed label=\"empty_b\"] 0 -> 6 [style=dashed label=\"empty_c\"] 0 -> \"0R7\" [style=solid] \"0R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 3 start: 'b' .\\l\"] 1 -> \"1R3\" [style=solid] \"1R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 2 [label=\"State 2\\n\\l 5 start: 'c' .\\l\"] 2 -> \"2R5\" [style=solid] \"2R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 0 \$accept: start . \$end\\l\"] 3 -> 7 [style=solid label=\"\$end\"] 4 [label=\"State 4\\n\\l 2 start: empty_a . 'a'\\l\"] 4 -> 8 [style=solid label=\"'a'\"] 5 [label=\"State 5\\n\\l 4 start: empty_b . 'b'\\l\"] 5 -> 9 [style=solid label=\"'b'\"] 6 [label=\"State 6\\n\\l 6 start: empty_c . 'c'\\l\"] 6 -> 10 [style=solid label=\"'c'\"] 7 [label=\"State 7\\n\\l 0 \$accept: start \$end .\\l\"] 7 -> \"7R0\" [style=solid] \"7R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 8 [label=\"State 8\\n\\l 2 start: empty_a 'a' .\\l\"] 8 -> \"8R2\" [style=solid] \"8R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 4 start: empty_b 'b' .\\l\"] 9 -> \"9R4\" [style=solid] \"9R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 6 start: empty_c 'c' .\\l\"] 10 -> \"10R6\" [style=solid] \"10R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:358" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_88 #AT_START_89 at_fn_group_banner 89 'output.at:417' \ "Graph with R/R" " " 3 at_xfail=no ( $as_echo "89. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: a | b; a: ; b: ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:417" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:417" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:417: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:417" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:417: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:417" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:417: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:417" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:417: grep -v // input.dot" at_fn_check_prepare_trace "output.at:417" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a\\l 2 | . b\\l 3 a: . [\$end]\\l 4 b: . [\$end]\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> 3 [style=dashed label=\"b\"] 0 -> \"0R3\" [style=solid] \"0R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R4d\" [label=\"[\$end]\", style=solid] \"0R4d\" [label=\"R4\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 4 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a .\\l\"] 2 -> \"2R1\" [style=solid] \"2R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 2 exp: b .\\l\"] 3 -> \"3R2\" [style=solid] \"3R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 0 \$accept: exp \$end .\\l\"] 4 -> \"4R0\" [style=solid] \"4R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:417" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_89 #AT_START_90 at_fn_group_banner 90 'output.at:449' \ "Graph with reductions with multiple LAT" " " 3 at_xfail=no ( $as_echo "90. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: a ';' | a ';' | a '.' | b '?' | b '!' | c '?' | c ';'; a: ; b: ; c: ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:449" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:449" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:449: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:449" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:449: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:449" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:449: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:449" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:449: grep -v // input.dot" at_fn_check_prepare_trace "output.at:449" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a ';'\\l 2 | . a ';'\\l 3 | . a '.'\\l 4 | . b '?'\\l 5 | . b '!'\\l 6 | . c '?'\\l 7 | . c ';'\\l 8 a: . [';', '.']\\l 9 b: . ['?', '!']\\l 10 c: . [';', '?']\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> 3 [style=dashed label=\"b\"] 0 -> 4 [style=dashed label=\"c\"] 0 -> \"0R8\" [style=solid] \"0R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R9\" [label=\"['?', '!']\", style=solid] \"0R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R10d\" [label=\"[';', '?']\", style=solid] \"0R10d\" [label=\"R10\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 5 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a . ';'\\l 2 | a . ';'\\l 3 | a . '.'\\l\"] 2 -> 6 [style=solid label=\"';'\"] 2 -> 7 [style=solid label=\"'.'\"] 3 [label=\"State 3\\n\\l 4 exp: b . '?'\\l 5 | b . '!'\\l\"] 3 -> 8 [style=solid label=\"'?'\"] 3 -> 9 [style=solid label=\"'!'\"] 4 [label=\"State 4\\n\\l 6 exp: c . '?'\\l 7 | c . ';'\\l\"] 4 -> 10 [style=solid label=\"';'\"] 4 -> 11 [style=solid label=\"'?'\"] 5 [label=\"State 5\\n\\l 0 \$accept: exp \$end .\\l\"] 5 -> \"5R0\" [style=solid] \"5R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 1 exp: a ';' . [\$end]\\l 2 | a ';' . [\$end]\\l\"] 6 -> \"6R1\" [style=solid] \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 6 -> \"6R2d\" [label=\"[\$end]\", style=solid] \"6R2d\" [label=\"R2\", fillcolor=5, shape=diamond, style=filled] 7 [label=\"State 7\\n\\l 3 exp: a '.' .\\l\"] 7 -> \"7R3\" [style=solid] \"7R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 8 [label=\"State 8\\n\\l 4 exp: b '?' .\\l\"] 8 -> \"8R4\" [style=solid] \"8R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 5 exp: b '!' .\\l\"] 9 -> \"9R5\" [style=solid] \"9R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 7 exp: c ';' .\\l\"] 10 -> \"10R7\" [style=solid] \"10R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 11 [label=\"State 11\\n\\l 6 exp: c '?' .\\l\"] 11 -> \"11R6\" [style=solid] \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:449" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_90 #AT_START_91 at_fn_group_banner 91 'output.at:508' \ "Graph with a reduction rule both enabled and disabled" "" 3 at_xfail=no ( $as_echo "91. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: ifexp | opexp | imm; ifexp: "if" exp "then" exp elseexp; elseexp: "else" exp | ; opexp: exp '+' exp; imm: '0'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/output.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:508" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:508" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:508: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:508" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/output.at:508: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:508" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:508: bison -rall --graph input.y" at_fn_check_prepare_trace "output.at:508" ( $at_check_trace; bison -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:508: grep -v // input.dot" at_fn_check_prepare_trace "output.at:508" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 0 -> 1 [style=solid label=\"\\\"if\\\"\"] 0 -> 2 [style=solid label=\"'0'\"] 0 -> 3 [style=dashed label=\"exp\"] 0 -> 4 [style=dashed label=\"ifexp\"] 0 -> 5 [style=dashed label=\"opexp\"] 0 -> 6 [style=dashed label=\"imm\"] 1 [label=\"State 1\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" . exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 1 -> 1 [style=solid label=\"\\\"if\\\"\"] 1 -> 2 [style=solid label=\"'0'\"] 1 -> 7 [style=dashed label=\"exp\"] 1 -> 4 [style=dashed label=\"ifexp\"] 1 -> 5 [style=dashed label=\"opexp\"] 1 -> 6 [style=dashed label=\"imm\"] 2 [label=\"State 2\\n\\l 8 imm: '0' .\\l\"] 2 -> \"2R8\" [style=solid] \"2R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 0 \$accept: exp . \$end\\l 7 opexp: exp . '+' exp\\l\"] 3 -> 8 [style=solid label=\"\$end\"] 3 -> 9 [style=solid label=\"'+'\"] 4 [label=\"State 4\\n\\l 1 exp: ifexp .\\l\"] 4 -> \"4R1\" [style=solid] \"4R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 5 [label=\"State 5\\n\\l 2 exp: opexp .\\l\"] 5 -> \"5R2\" [style=solid] \"5R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 3 exp: imm .\\l\"] 6 -> \"6R3\" [style=solid] \"6R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 7 [label=\"State 7\\n\\l 4 ifexp: \\\"if\\\" exp . \\\"then\\\" exp elseexp\\l 7 opexp: exp . '+' exp\\l\"] 7 -> 10 [style=solid label=\"\\\"then\\\"\"] 7 -> 9 [style=solid label=\"'+'\"] 8 [label=\"State 8\\n\\l 0 \$accept: exp \$end .\\l\"] 8 -> \"8R0\" [style=solid] \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 7 | exp '+' . exp\\l 8 imm: . '0'\\l\"] 9 -> 1 [style=solid label=\"\\\"if\\\"\"] 9 -> 2 [style=solid label=\"'0'\"] 9 -> 11 [style=dashed label=\"exp\"] 9 -> 4 [style=dashed label=\"ifexp\"] 9 -> 5 [style=dashed label=\"opexp\"] 9 -> 6 [style=dashed label=\"imm\"] 10 [label=\"State 10\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" exp \\\"then\\\" . exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 10 -> 1 [style=solid label=\"\\\"if\\\"\"] 10 -> 2 [style=solid label=\"'0'\"] 10 -> 12 [style=dashed label=\"exp\"] 10 -> 4 [style=dashed label=\"ifexp\"] 10 -> 5 [style=dashed label=\"opexp\"] 10 -> 6 [style=dashed label=\"imm\"] 11 [label=\"State 11\\n\\l 7 opexp: exp . '+' exp\\l 7 | exp '+' exp . [\$end, \\\"then\\\", \\\"else\\\", '+']\\l\"] 11 -> 9 [style=solid label=\"'+'\"] 11 -> \"11R7d\" [label=\"['+']\", style=solid] \"11R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled] 11 -> \"11R7\" [style=solid] \"11R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 12 [label=\"State 12\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp . elseexp\\l 5 elseexp: . \\\"else\\\" exp\\l 6 | . [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp . '+' exp\\l\"] 12 -> 13 [style=solid label=\"\\\"else\\\"\"] 12 -> 9 [style=solid label=\"'+'\"] 12 -> 14 [style=dashed label=\"elseexp\"] 12 -> \"12R6d\" [label=\"[\\\"else\\\", '+']\", style=solid] \"12R6d\" [label=\"R6\", fillcolor=5, shape=diamond, style=filled] 12 -> \"12R6\" [style=solid] \"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] 13 [label=\"State 13\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 5 elseexp: \\\"else\\\" . exp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 13 -> 1 [style=solid label=\"\\\"if\\\"\"] 13 -> 2 [style=solid label=\"'0'\"] 13 -> 15 [style=dashed label=\"exp\"] 13 -> 4 [style=dashed label=\"ifexp\"] 13 -> 5 [style=dashed label=\"opexp\"] 13 -> 6 [style=dashed label=\"imm\"] 14 [label=\"State 14\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp elseexp .\\l\"] 14 -> \"14R4\" [style=solid] \"14R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 15 [label=\"State 15\\n\\l 5 elseexp: \\\"else\\\" exp . [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp . '+' exp\\l\"] 15 -> 9 [style=solid label=\"'+'\"] 15 -> \"15R5d\" [label=\"['+']\", style=solid] \"15R5d\" [label=\"R5\", fillcolor=5, shape=diamond, style=filled] 15 -> \"15R5\" [style=solid] \"15R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:508" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_91 #AT_START_92 at_fn_group_banner 92 'skeletons.at:24' \ "Relative skeleton file names" " " 4 at_xfail=no ( $as_echo "92. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/skeletons.at:26: mkdir tmp" at_fn_check_prepare_trace "skeletons.at:26" ( $at_check_trace; mkdir tmp ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:26" $at_failed && at_fn_log_failure $at_traceon; } cat >tmp/skel.c <<'_ATEOF' m4_divert_push(0)dnl @output(b4_parser_file_name@)dnl b4_percent_define_get([[test]]) m4_divert_pop(0) _ATEOF cat >skel.c <<'_ATEOF' m4_divert_push(0)dnl @output(b4_parser_file_name@)dnl b4_percent_define_get([[test]]) -- Local m4_divert_pop(0) _ATEOF cat >tmp/input-gram.y <<'_ATEOF' %skeleton "./skel.c" %define test "Hello World" %% start: ; _ATEOF cat >input-gram.y <<'_ATEOF' %skeleton "./skel.c" %define test "Hello World" %% start: ; _ATEOF cat >tmp/input-cmd-line.y <<'_ATEOF' %define test "Hello World" %% start: ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot tmp/input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:62" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot tmp/input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y" "skeletons.at:62" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:62" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:62" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/skeletons.at:62: bison tmp/input-gram.y" at_fn_check_prepare_trace "skeletons.at:62" ( $at_check_trace; bison tmp/input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:63: cat input-gram.tab.c" at_fn_check_prepare_trace "skeletons.at:63" ( $at_check_trace; cat input-gram.tab.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Hello World " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:67" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y" "skeletons.at:67" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:67" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:67" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/skeletons.at:67: bison input-gram.y" at_fn_check_prepare_trace "skeletons.at:67" ( $at_check_trace; bison input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:68: cat input-gram.tab.c" at_fn_check_prepare_trace "skeletons.at:68" ( $at_check_trace; cat input-gram.tab.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Hello World -- Local " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:72" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" "skeletons.at:72" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:72" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:72" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/skeletons.at:72: bison --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_trace "skeletons.at:72" ( $at_check_trace; bison --skeleton=tmp/skel.c tmp/input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:73: cat input-cmd-line.tab.c" at_fn_check_prepare_trace "skeletons.at:73" ( $at_check_trace; cat input-cmd-line.tab.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Hello World " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_92 #AT_START_93 at_fn_group_banner 93 'skeletons.at:84' \ "Installed skeleton file names" " " 4 at_xfail=no ( $as_echo "93. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-cmd-line.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include static void yyerror ( const char *msg); int yylex (void); %} %error-verbose %token 'a' %% start: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'a'; } int main (void) { return yyparse (); } _ATEOF cat >input-gram.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "yacc.c" %{ #include static void yyerror ( const char *msg); int yylex (void); %} %error-verbose %token 'a' %% start: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'a'; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:124" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" "skeletons.at:124" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:124: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:124" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/skeletons.at:124: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:124" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/skeletons.at:124: bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_trace "skeletons.at:124" ( $at_check_trace; bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:125: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:125" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:125" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:125: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-cmd-line input-cmd-line.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS" "skeletons.at:125" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:125" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:126: \$PREPARSER ./input-cmd-line" at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:126" ( $at_check_trace; $PREPARSER ./input-cmd-line ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:126" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:126: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "skeletons.at:126" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:130: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input-gram.c input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:130" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input-gram.c input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:130: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y" "skeletons.at:130" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:130: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:130" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/skeletons.at:130: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:130" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/skeletons.at:130: bison -o input-gram.c input-gram.y" at_fn_check_prepare_trace "skeletons.at:130" ( $at_check_trace; bison -o input-gram.c input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:131: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:131" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:131" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:131: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-gram input-gram.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS" "skeletons.at:131" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:131" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:132: \$PREPARSER ./input-gram" at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:132" ( $at_check_trace; $PREPARSER ./input-gram ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:132" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:132: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "skeletons.at:132" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:132" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_93 #AT_START_94 at_fn_group_banner 94 'skeletons.at:146' \ "%define Boolean variables: invalid skeleton defaults" "" 4 at_xfail=no ( $as_echo "94. $at_setup_line: testing $at_desc ..." $at_traceon cat >skel.c <<'_ATEOF' b4_percent_define_default([[foo]], [[bogus value]]) b4_percent_define_flag_if([[foo]]) _ATEOF cat >input.y <<'_ATEOF' %skeleton "./skel.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:159: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:159" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ": error: invalid value for %define Boolean variable 'foo' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:159" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_94 #AT_START_95 at_fn_group_banner 95 'skeletons.at:170' \ "Complaining during macro argument expansion" " " 4 at_xfail=no ( $as_echo "95. $at_setup_line: testing $at_desc ..." $at_traceon cat >skel1.c <<'_ATEOF' m4_define([foow], [b4_warn([[foow fubar]])]) m4_define([foowat], [b4_warn_at([[foow.y:2.3]], [[foow.y:5.4]], [[foowat fubar]])]) m4_define([fooc], [b4_complain([[fooc fubar]])]) m4_define([foocat], [b4_complain_at([[fooc.y:1.1]], [[fooc.y:10.6]], [[foocat fubar]])]) m4_define([foof], [b4_fatal([[foof fubar]])]) m4_if(foow, [1], [yes]) m4_if(foowat, [1], [yes]) m4_if(fooc, [1], [yes]) m4_if(foocat, [1], [yes]) m4_if(foof, [1], [yes]) _ATEOF cat >input1.y <<'_ATEOF' %skeleton "./skel1.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:193: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:193" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input1.y: warning: foow fubar foow.y:2.3-5.3: warning: foowat fubar input1.y: error: fooc fubar fooc.y:1.1-10.5: error: foocat fubar input1.y: fatal error: foof fubar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:193" $at_failed && at_fn_log_failure $at_traceon; } cat >skel2.c <<'_ATEOF' m4_define([foofat], [b4_fatal_at([[foof.y:12.11]], [[foof.y:100.123]], [[foofat fubar]])]) m4_if(foofat, [1], [yes]) _ATEOF cat >input2.y <<'_ATEOF' %skeleton "./skel2.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:213" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foof.y:12.11-100.122: fatal error: foofat fubar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:213" $at_failed && at_fn_log_failure $at_traceon; } cat >skel3.c <<'_ATEOF' b4_complain_at(b4_percent_define_get_loc([[bogus]]), [[bad value]]) _ATEOF cat >input3.y <<'_ATEOF' %skeleton "./skel3.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y" "skeletons.at:227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input3.y: fatal error: b4_percent_define_get_loc: undefined %define variable 'bogus' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:227" $at_failed && at_fn_log_failure $at_traceon; } cat >skel4.c <<'_ATEOF' b4_warn_at(b4_percent_define_get_syncline([[bogus]]), [[bad value]]) _ATEOF cat >input4.y <<'_ATEOF' %skeleton "./skel4.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y" "skeletons.at:241" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input4.y: fatal error: b4_percent_define_get_syncline: undefined %define variable 'bogus' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:241" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_95 #AT_START_96 at_fn_group_banner 96 'skeletons.at:252' \ "Fatal errors make M4 exit immediately" " " 4 at_xfail=no ( $as_echo "96. $at_setup_line: testing $at_desc ..." $at_traceon cat >skel1.c <<'_ATEOF' b4_complain([[non-fatal error]]) b4_fatal([[M4 should exit immediately here]]) m4_fatal([this should never be evaluated]) _ATEOF cat >input1.y <<'_ATEOF' %skeleton "./skel1.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:266: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:266" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input1.y: error: non-fatal error input1.y: fatal error: M4 should exit immediately here " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:266" $at_failed && at_fn_log_failure $at_traceon; } cat >skel2.c <<'_ATEOF' b4_warn([[morning]]) b4_fatal_at([[foo.y:1.5]], [[foo.y:1.7]], [[M4 should exit immediately here]]) m4_fatal([this should never be evaluated]) _ATEOF cat >input2.y <<'_ATEOF' %skeleton "./skel2.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:283: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:283" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input2.y: warning: morning foo.y:1.5-6: fatal error: M4 should exit immediately here " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:283" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_96 #AT_START_97 at_fn_group_banner 97 'skeletons.at:306' \ "Fatal errors but M4 continues producing output" " " 4 at_xfail=no ( $as_echo "97. $at_setup_line: testing $at_desc ..." $at_traceon cat >gen-skel.pl <<'_ATEOF' use warnings; use strict; my $M4 = "m4"; my $DNL = "d"."nl"; print "${M4}_divert_push(0)$DNL\n"; print '@output(@,@)', "\n"; (print "garbage"x10, "\n") for (1..1000); print "${M4}_divert_pop(0)\n"; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:318: \$PERL gen-skel.pl > skel.c || exit 77" at_fn_check_prepare_dynamic "$PERL gen-skel.pl > skel.c || exit 77" "skeletons.at:318" ( $at_check_trace; $PERL gen-skel.pl > skel.c || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:318" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %skeleton "./skel.c" %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/skeletons.at:326: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:326" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: fatal error: too many arguments for @output directive in skeleton " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:326" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_97 #AT_START_98 at_fn_group_banner 98 'sets.at:66' \ "Nullable" " " 5 at_xfail=no ( $as_echo "98. $at_setup_line: testing $at_desc ..." $at_traceon # At some point, nullable had been smoking grass, and managed to say: # # Entering set_nullable # NULLABLE # 'e': yes # (null): no # ... cat >input.y <<'_ATEOF' %% e: 'e' | /* Nothing */; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:81" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:81" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:81" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:81" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/sets.at:81: bison --trace=sets input.y" at_fn_check_prepare_trace "sets.at:81" ( $at_check_trace; bison --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81" $at_failed && at_fn_log_failure $at_traceon; } cat >extract.sed <<'_ATEOF' #n /^NULLABLE$/ { :null p n /^[ ]*$/ !b null } /^FIRSTS$/ { :firsts p n /^[ ]*$/ !b firsts } /^FDERIVES$/ { :fderiv p n /^[ ]*$/ !b fderiv } /^DERIVES$/ { :deriv p n /^[ ]*$/ !b deriv } _ATEOF { set +x $as_echo "$at_srcdir/sets.at:82: sed -f extract.sed stderr" at_fn_check_prepare_trace "sets.at:82" ( $at_check_trace; sed -f extract.sed stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:82: mv stdout sets" at_fn_check_prepare_trace "sets.at:82" ( $at_check_trace; mv stdout sets ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:83: cat sets" at_fn_check_prepare_trace "sets.at:83" ( $at_check_trace; cat sets ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "DERIVES \$accept derives 0 e \$end e derives 1 'e' 2 /* empty */ NULLABLE \$accept: no e: yes FIRSTS \$accept firsts \$accept e e firsts e FDERIVES \$accept derives 0 e \$end 1 'e' 2 /* empty */ e derives 1 'e' 2 /* empty */ " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:83" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_98 #AT_START_99 at_fn_group_banner 99 'sets.at:151' \ "Broken Closure" " " 5 at_xfail=no ( $as_echo "99. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% a: b; b: c; c: d; d: e; e: f; f: g; g: h; h: 'h'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:165" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:165" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/sets.at:165: bison --trace=sets input.y" at_fn_check_prepare_trace "sets.at:165" ( $at_check_trace; bison --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:167: sed -n 's/[ ]*\$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr" at_fn_check_prepare_dynamic "sed -n 's/[ ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr" "sets.at:167" ( $at_check_trace; sed -n 's/[ ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "RTC: Firsts Output BEGIN 012345678 .---------. 0|111111111| 1| 11111111| 2| 1111111| 3| 111111| 4| 11111| 5| 1111| 6| 111| 7| 11| 8| 1| \`---------' RTC: Firsts Output END " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:167" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_99 #AT_START_100 at_fn_group_banner 100 'sets.at:193' \ "Firsts" " " 5 at_xfail=no ( $as_echo "100. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %nonassoc '<' '>' %left '+' '-' %right '^' '=' %% exp: exp '<' exp | exp '>' exp | exp '+' exp | exp '-' exp | exp '^' exp | exp '=' exp | "exp" ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/sets.at:211: bison --trace=sets input.y" at_fn_check_prepare_trace "sets.at:211" ( $at_check_trace; bison --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211" $at_failed && at_fn_log_failure $at_traceon; } cat >extract.sed <<'_ATEOF' #n /^NULLABLE$/ { :null p n /^[ ]*$/ !b null } /^FIRSTS$/ { :firsts p n /^[ ]*$/ !b firsts } /^FDERIVES$/ { :fderiv p n /^[ ]*$/ !b fderiv } /^DERIVES$/ { :deriv p n /^[ ]*$/ !b deriv } _ATEOF { set +x $as_echo "$at_srcdir/sets.at:212: sed -f extract.sed stderr" at_fn_check_prepare_trace "sets.at:212" ( $at_check_trace; sed -f extract.sed stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:212: mv stdout sets" at_fn_check_prepare_trace "sets.at:212" ( $at_check_trace; mv stdout sets ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:213: cat sets" at_fn_check_prepare_trace "sets.at:213" ( $at_check_trace; cat sets ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "DERIVES \$accept derives 0 exp \$end exp derives 1 exp '<' exp 2 exp '>' exp 3 exp '+' exp 4 exp '-' exp 5 exp '^' exp 6 exp '=' exp 7 \"exp\" NULLABLE \$accept: no exp: no FIRSTS \$accept firsts \$accept exp exp firsts exp FDERIVES \$accept derives 0 exp \$end 1 exp '<' exp 2 exp '>' exp 3 exp '+' exp 4 exp '-' exp 5 exp '^' exp 6 exp '=' exp 7 \"exp\" exp derives 1 exp '<' exp 2 exp '>' exp 3 exp '+' exp 4 exp '-' exp 5 exp '^' exp 6 exp '=' exp 7 \"exp\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:213" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_100 #AT_START_101 at_fn_group_banner 101 'sets.at:269' \ "Accept" " " 5 at_xfail=no ( $as_echo "101. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token END 0 %% input: 'a' | '(' input ')' | '(' error END ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:281" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "sets.at:281" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:281" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:281" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/sets.at:281: bison -v -o input.c input.y" at_fn_check_prepare_trace "sets.at:281" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281" $at_failed && at_fn_log_failure $at_traceon; } # Get the final state in the parser. { set +x $as_echo "$at_srcdir/sets.at:284: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c" at_fn_check_prepare_trace "sets.at:284" ( $at_check_trace; sed -n 's/.*define YYFINAL *\([0-9][0-9]*\)/final state \1/p' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:284" $at_failed && at_fn_log_failure $at_traceon; } mv stdout expout # Get the final state in the report, from the "accept" action.. { set +x $as_echo "$at_srcdir/sets.at:289: sed -n ' /^State \\(.*\\)/{ s//final state \\1/ x } / accept/{ x p q } ' input.output" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:289" ( $at_check_trace; sed -n ' /^State \(.*\)/{ s//final state \1/ x } / accept/{ x p q } ' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:289" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_101 #AT_START_102 at_fn_group_banner 102 'reduce.at:25' \ "Useless Terminals" " " 6 at_xfail=no ( $as_echo "102. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %verbose %output "input.c" %token useless1 %token useless2 %token useless3 %token useless4 %token useless5 %token useless6 %token useless7 %token useless8 %token useless9 %token useful %% exp: useful; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:46" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:46" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:46" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:46" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:46: bison input.y" at_fn_check_prepare_trace "reduce.at:46" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:48: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:48" ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Terminals unused in grammar useless1 useless2 useless3 useless4 useless5 useless6 useless7 useless8 useless9 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:48" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_102 #AT_START_103 at_fn_group_banner 103 'reduce.at:69' \ "Useless Nonterminals" " " 6 at_xfail=no ( $as_echo "103. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %verbose %output "input.c" %nterm useless1 %nterm useless2 %nterm useless3 %nterm useless4 %nterm useless5 %nterm useless6 %nterm useless7 %nterm useless8 %nterm useless9 %token useful %% exp: useful; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:90: bison input.y" at_fn_check_prepare_trace "reduce.at:90" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar input.y:4.8-15: warning: nonterminal useless in grammar: useless1 input.y:5.8-15: warning: nonterminal useless in grammar: useless2 input.y:6.8-15: warning: nonterminal useless in grammar: useless3 input.y:7.8-15: warning: nonterminal useless in grammar: useless4 input.y:8.8-15: warning: nonterminal useless in grammar: useless5 input.y:9.8-15: warning: nonterminal useless in grammar: useless6 input.y:10.8-15: warning: nonterminal useless in grammar: useless7 input.y:11.8-15: warning: nonterminal useless in grammar: useless8 input.y:12.8-15: warning: nonterminal useless in grammar: useless9 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: warning: 9 nonterminals useless in grammar input.y:4.8-15: warning: nonterminal useless in grammar: useless1 input.y:5.8-15: warning: nonterminal useless in grammar: useless2 input.y:6.8-15: warning: nonterminal useless in grammar: useless3 input.y:7.8-15: warning: nonterminal useless in grammar: useless4 input.y:8.8-15: warning: nonterminal useless in grammar: useless5 input.y:9.8-15: warning: nonterminal useless in grammar: useless6 input.y:10.8-15: warning: nonterminal useless in grammar: useless7 input.y:11.8-15: warning: nonterminal useless in grammar: useless8 input.y:12.8-15: warning: nonterminal useless in grammar: useless9 _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:90: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:90" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:103: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:103" ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar useless1 useless2 useless3 useless4 useless5 useless6 useless7 useless8 useless9 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:103" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_103 #AT_START_104 at_fn_group_banner 104 'reduce.at:124' \ "Useless Rules" " " 6 at_xfail=no ( $as_echo "104. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %verbose %output "input.c" %token useful %% exp: useful; useless1: '1'; useless2: '2'; useless3: '3'; useless4: '4'; useless5: '5'; useless6: '6'; useless7: '7'; useless8: '8'; useless9: '9'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:145" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:145" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:145: bison -fcaret input.y" at_fn_check_prepare_trace "reduce.at:145" ( $at_check_trace; bison -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar input.y: warning: 9 rules useless in grammar input.y:6.1-8: warning: nonterminal useless in grammar: useless1 useless1: '1'; ^^^^^^^^ input.y:7.1-8: warning: nonterminal useless in grammar: useless2 useless2: '2'; ^^^^^^^^ input.y:8.1-8: warning: nonterminal useless in grammar: useless3 useless3: '3'; ^^^^^^^^ input.y:9.1-8: warning: nonterminal useless in grammar: useless4 useless4: '4'; ^^^^^^^^ input.y:10.1-8: warning: nonterminal useless in grammar: useless5 useless5: '5'; ^^^^^^^^ input.y:11.1-8: warning: nonterminal useless in grammar: useless6 useless6: '6'; ^^^^^^^^ input.y:12.1-8: warning: nonterminal useless in grammar: useless7 useless7: '7'; ^^^^^^^^ input.y:13.1-8: warning: nonterminal useless in grammar: useless8 useless8: '8'; ^^^^^^^^ input.y:14.1-8: warning: nonterminal useless in grammar: useless9 useless9: '9'; ^^^^^^^^ input.y:6.11-13: warning: rule useless in grammar useless1: '1'; ^^^ input.y:7.11-13: warning: rule useless in grammar useless2: '2'; ^^^ input.y:8.11-13: warning: rule useless in grammar useless3: '3'; ^^^ input.y:9.11-13: warning: rule useless in grammar useless4: '4'; ^^^ input.y:10.11-13: warning: rule useless in grammar useless5: '5'; ^^^ input.y:11.11-13: warning: rule useless in grammar useless6: '6'; ^^^ input.y:12.11-13: warning: rule useless in grammar useless7: '7'; ^^^ input.y:13.11-13: warning: rule useless in grammar useless8: '8'; ^^^ input.y:14.11-13: warning: rule useless in grammar useless9: '9'; ^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: warning: 9 nonterminals useless in grammar input.y: warning: 9 rules useless in grammar input.y:6.1-8: warning: nonterminal useless in grammar: useless1 useless1: '1'; ^^^^^^^^ input.y:7.1-8: warning: nonterminal useless in grammar: useless2 useless2: '2'; ^^^^^^^^ input.y:8.1-8: warning: nonterminal useless in grammar: useless3 useless3: '3'; ^^^^^^^^ input.y:9.1-8: warning: nonterminal useless in grammar: useless4 useless4: '4'; ^^^^^^^^ input.y:10.1-8: warning: nonterminal useless in grammar: useless5 useless5: '5'; ^^^^^^^^ input.y:11.1-8: warning: nonterminal useless in grammar: useless6 useless6: '6'; ^^^^^^^^ input.y:12.1-8: warning: nonterminal useless in grammar: useless7 useless7: '7'; ^^^^^^^^ input.y:13.1-8: warning: nonterminal useless in grammar: useless8 useless8: '8'; ^^^^^^^^ input.y:14.1-8: warning: nonterminal useless in grammar: useless9 useless9: '9'; ^^^^^^^^ input.y:6.11-13: warning: rule useless in grammar useless1: '1'; ^^^ input.y:7.11-13: warning: rule useless in grammar useless2: '2'; ^^^ input.y:8.11-13: warning: rule useless in grammar useless3: '3'; ^^^ input.y:9.11-13: warning: rule useless in grammar useless4: '4'; ^^^ input.y:10.11-13: warning: rule useless in grammar useless5: '5'; ^^^ input.y:11.11-13: warning: rule useless in grammar useless6: '6'; ^^^ input.y:12.11-13: warning: rule useless in grammar useless7: '7'; ^^^ input.y:13.11-13: warning: rule useless in grammar useless8: '8'; ^^^ input.y:14.11-13: warning: rule useless in grammar useless9: '9'; ^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:145: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:145" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "reduce.at:145" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:204: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:204" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:204: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:204" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:204: bison input.y" at_fn_check_prepare_trace "reduce.at:204" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar input.y: warning: 9 rules useless in grammar input.y:6.1-8: warning: nonterminal useless in grammar: useless1 input.y:7.1-8: warning: nonterminal useless in grammar: useless2 input.y:8.1-8: warning: nonterminal useless in grammar: useless3 input.y:9.1-8: warning: nonterminal useless in grammar: useless4 input.y:10.1-8: warning: nonterminal useless in grammar: useless5 input.y:11.1-8: warning: nonterminal useless in grammar: useless6 input.y:12.1-8: warning: nonterminal useless in grammar: useless7 input.y:13.1-8: warning: nonterminal useless in grammar: useless8 input.y:14.1-8: warning: nonterminal useless in grammar: useless9 input.y:6.11-13: warning: rule useless in grammar: useless1: '1' input.y:7.11-13: warning: rule useless in grammar: useless2: '2' input.y:8.11-13: warning: rule useless in grammar: useless3: '3' input.y:9.11-13: warning: rule useless in grammar: useless4: '4' input.y:10.11-13: warning: rule useless in grammar: useless5: '5' input.y:11.11-13: warning: rule useless in grammar: useless6: '6' input.y:12.11-13: warning: rule useless in grammar: useless7: '7' input.y:13.11-13: warning: rule useless in grammar: useless8: '8' input.y:14.11-13: warning: rule useless in grammar: useless9: '9' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: warning: 9 nonterminals useless in grammar input.y: warning: 9 rules useless in grammar input.y:6.1-8: warning: nonterminal useless in grammar: useless1 input.y:7.1-8: warning: nonterminal useless in grammar: useless2 input.y:8.1-8: warning: nonterminal useless in grammar: useless3 input.y:9.1-8: warning: nonterminal useless in grammar: useless4 input.y:10.1-8: warning: nonterminal useless in grammar: useless5 input.y:11.1-8: warning: nonterminal useless in grammar: useless6 input.y:12.1-8: warning: nonterminal useless in grammar: useless7 input.y:13.1-8: warning: nonterminal useless in grammar: useless8 input.y:14.1-8: warning: nonterminal useless in grammar: useless9 input.y:6.11-13: warning: rule useless in grammar: useless1: '1' input.y:7.11-13: warning: rule useless in grammar: useless2: '2' input.y:8.11-13: warning: rule useless in grammar: useless3: '3' input.y:9.11-13: warning: rule useless in grammar: useless4: '4' input.y:10.11-13: warning: rule useless in grammar: useless5: '5' input.y:11.11-13: warning: rule useless in grammar: useless6: '6' input.y:12.11-13: warning: rule useless in grammar: useless7: '7' input.y:13.11-13: warning: rule useless in grammar: useless8: '8' input.y:14.11-13: warning: rule useless in grammar: useless9: '9' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:204: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:204" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:204" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:227: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:227" ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar useless1 useless2 useless3 useless4 useless5 useless6 useless7 useless8 useless9 Terminals unused in grammar '1' '2' '3' '4' '5' '6' '7' '8' '9' Rules useless in grammar 2 useless1: '1' 3 useless2: '2' 4 useless3: '3' 5 useless4: '4' 6 useless5: '5' 7 useless6: '6' 8 useless7: '7' 9 useless8: '8' 10 useless9: '9' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:227" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_104 #AT_START_105 at_fn_group_banner 105 'reduce.at:271' \ "Reduced Automaton" " " 6 at_xfail=no ( $as_echo "105. $at_setup_line: testing $at_desc ..." $at_traceon # The non reduced grammar. # ------------------------ cat >not-reduced.y <<'_ATEOF' /* A useless token. */ %token useless_token /* A useful one. */ %token useful %verbose %output "not-reduced.c" %% exp: useful { /* A useful action. */ } | non_productive { /* A non productive action. */ } ; not_reachable: useful { /* A not reachable action. */ } ; non_productive: non_productive useless_token { /* Another non productive action. */ } ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret not-reduced.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y" "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:300: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:300" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:300: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:300" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:300: bison -fcaret not-reduced.y" at_fn_check_prepare_trace "reduce.at:300" ( $at_check_trace; bison -fcaret not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar not-reduced.y: warning: 3 rules useless in grammar not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable not_reachable: useful { /* A not reachable action. */ } ^^^^^^^^^^^^^ not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive | non_productive { /* A non productive action. */ } ^^^^^^^^^^^^^^ not-reduced.y:11.6-57: warning: rule useless in grammar | non_productive { /* A non productive action. */ } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not-reduced.y:14.16-56: warning: rule useless in grammar not_reachable: useful { /* A not reachable action. */ } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not-reduced.y:17.17-18.63: warning: rule useless in grammar non_productive: non_productive useless_token ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror" "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' not-reduced.y: warning: 2 nonterminals useless in grammar not-reduced.y: warning: 3 rules useless in grammar not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable not_reachable: useful { /* A not reachable action. */ } ^^^^^^^^^^^^^ not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive | non_productive { /* A non productive action. */ } ^^^^^^^^^^^^^^ not-reduced.y:11.6-57: warning: rule useless in grammar | non_productive { /* A non productive action. */ } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not-reduced.y:14.16-56: warning: rule useless in grammar not_reachable: useful { /* A not reachable action. */ } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not-reduced.y:17.17-18.63: warning: rule useless in grammar non_productive: non_productive useless_token ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:300: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:300" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error" "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror" "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror" "reduce.at:300" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot not-reduced.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y" "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:320: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:320" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:320: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:320" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:320: bison not-reduced.y" at_fn_check_prepare_trace "reduce.at:320" ( $at_check_trace; bison not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar not-reduced.y: warning: 3 rules useless in grammar not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful not-reduced.y:17.17-18.63: warning: rule useless in grammar: non_productive: non_productive useless_token " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Werror" "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' not-reduced.y: warning: 2 nonterminals useless in grammar not-reduced.y: warning: 3 rules useless in grammar not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful not-reduced.y:17.17-18.63: warning: rule useless in grammar: non_productive: non_productive useless_token _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:320: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:320" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error" "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror" "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror" "reduce.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:330: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:330" ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' not-reduced.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar not_reachable non_productive Terminals unused in grammar useless_token Rules useless in grammar 2 exp: non_productive 3 not_reachable: useful 4 non_productive: non_productive useless_token " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:330" $at_failed && at_fn_log_failure $at_traceon; } # The reduced grammar. # -------------------- cat >reduced.y <<'_ATEOF' /* A useless token. */ %token useless_token /* A useful one. */ %token useful %verbose %output "reduced.c" %% exp: useful { /* A useful action. */ } // | non_productive { /* A non productive action. */ } */ ; //not_reachable: useful { /* A not reachable action. */ } // ; //non_productive: non_productive useless_token // { /* Another non productive action. */ } // ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot reduced.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:367" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y" "reduce.at:367" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:367: bison reduced.y" at_fn_check_prepare_trace "reduce.at:367" ( $at_check_trace; bison reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367" $at_failed && at_fn_log_failure $at_traceon; } # Comparing the parsers. cp reduced.c expout { set +x $as_echo "$at_srcdir/reduce.at:371: sed 's/not-reduced/reduced/g' not-reduced.c" at_fn_check_prepare_trace "reduce.at:371" ( $at_check_trace; sed 's/not-reduced/reduced/g' not-reduced.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:371" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_105 #AT_START_106 at_fn_group_banner 106 'reduce.at:381' \ "Underivable Rules" " " 6 at_xfail=no ( $as_echo "106. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %verbose %output "input.c" %token useful %% exp: useful | underivable; underivable: indirection; indirection: underivable; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:395: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:395" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:395: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:395" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:395: bison input.y" at_fn_check_prepare_trace "reduce.at:395" ( $at_check_trace; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar input.y: warning: 3 rules useless in grammar input.y:5.15-25: warning: nonterminal useless in grammar: underivable input.y:6.14-24: warning: nonterminal useless in grammar: indirection input.y:5.15-25: warning: rule useless in grammar: exp: underivable input.y:6.14-24: warning: rule useless in grammar: underivable: indirection input.y:7.14-24: warning: rule useless in grammar: indirection: underivable " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: warning: 2 nonterminals useless in grammar input.y: warning: 3 rules useless in grammar input.y:5.15-25: warning: nonterminal useless in grammar: underivable input.y:6.14-24: warning: nonterminal useless in grammar: indirection input.y:5.15-25: warning: rule useless in grammar: exp: underivable input.y:6.14-24: warning: rule useless in grammar: underivable: indirection input.y:7.14-24: warning: rule useless in grammar: indirection: underivable _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/reduce.at:395: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:395" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:405: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:405" ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar underivable indirection Rules useless in grammar 2 exp: underivable 3 underivable: indirection 4 indirection: underivable " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:405" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_106 #AT_START_107 at_fn_group_banner 107 'reduce.at:423' \ "Empty Language" " " 6 at_xfail=no ( $as_echo "107. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %output "input.c" %% exp: exp; _ATEOF { set +x $as_echo "$at_srcdir/reduce.at:431: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "reduce.at:431" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar input.y: warning: 2 rules useless in grammar input.y:3.1-3: fatal error: start symbol exp does not derive any sentence " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:431" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_107 #AT_START_108 at_fn_group_banner 108 'reduce.at:474' \ "no %define lr.type: Single State Split" " " 6 at_xfail=no ( $as_echo "108. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %left 'a' // Conflict resolution renders state 12 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 5 | . 'a' 6 c: . 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 5 | 'a' . ['a', 'b'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 5 | 'a' . [\$end] 6 c: 'a' . 'b' 'a' shift, and go to state 12 'b' shift, and go to state 15 \$default reduce using rule 5 (A) State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . \$default reduce using rule 4 (A) State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 6 c: 'a' 'b' . \$default reduce using rule 6 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_108 #AT_START_109 at_fn_group_banner 109 'reduce.at:474' \ "%define lr.type lalr: Single State Split" " " 6 at_xfail=no ( $as_echo "109. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %left 'a' // Conflict resolution renders state 12 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 5 | . 'a' 6 c: . 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 5 | 'a' . ['a', 'b'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 5 | 'a' . [\$end] 6 c: 'a' . 'b' 'a' shift, and go to state 12 'b' shift, and go to state 15 \$default reduce using rule 5 (A) State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . \$default reduce using rule 4 (A) State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 6 c: 'a' 'b' . \$default reduce using rule 6 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_109 #AT_START_110 at_fn_group_banner 110 'reduce.at:474' \ "%define lr.type ielr: Single State Split" " " 6 at_xfail=no ( $as_echo "110. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %left 'a' // Conflict resolution renders state 12 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 16 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 5 | . 'a' 6 c: . 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 5 | 'a' . ['a'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 5 | 'a' . [\$end] 6 c: 'a' . 'b' 'a' shift, and go to state 12 'b' shift, and go to state 15 \$default reduce using rule 5 (A) State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . \$default reduce using rule 4 (A) State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 6 c: 'a' 'b' . \$default reduce using rule 6 (c) State 16 4 A: 'a' . 'a' 5 | 'a' . ['b'] 'a' shift, and go to state 12 \$default reduce using rule 5 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_110 #AT_START_111 at_fn_group_banner 111 'reduce.at:474' \ "%define lr.type canonical-lr: Single State Split" "" 6 at_xfail=no ( $as_echo "111. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %left 'a' // Conflict resolution renders state 12 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 5 | . 'a' 'a' shift, and go to state 16 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 5 | . 'a' 6 c: . 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 5 | 'a' . ['a'] 'a' reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 5 | 'a' . [\$end] 6 c: 'a' . 'b' 'a' shift, and go to state 17 'b' shift, and go to state 15 \$end reduce using rule 5 (A) State 9 7 c: A . [\$end] \$end reduce using rule 7 (c) State 10 3 S: 'c' c . [\$end] \$end reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . ['a'] 'a' reduce using rule 4 (A) State 13 1 S: 'a' A 'a' . [\$end] \$end reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . [\$end] \$end reduce using rule 2 (S) State 15 6 c: 'a' 'b' . [\$end] \$end reduce using rule 6 (c) State 16 4 A: 'a' . 'a' 5 | 'a' . ['b'] 'a' shift, and go to state 18 'b' reduce using rule 5 (A) State 17 4 A: 'a' 'a' . [\$end] \$end reduce using rule 4 (A) State 18 4 A: 'a' 'a' . ['b'] 'b' reduce using rule 4 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:474" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_111 #AT_START_112 at_fn_group_banner 112 'reduce.at:707' \ "no %define lr.type: Lane Split" " " 6 at_xfail=no ( $as_echo "112. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 6 c: . 'a' 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 6 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['a', 'b'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . [\$end] 6 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 17 \$default reduce using rule 5 (A) State 16 4 A: 'a' 'a' 'a' . \$default reduce using rule 4 (A) State 17 6 c: 'a' 'a' 'b' . \$default reduce using rule 6 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_112 #AT_START_113 at_fn_group_banner 113 'reduce.at:707' \ "%define lr.type lalr: Lane Split" " " 6 at_xfail=no ( $as_echo "113. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 6 c: . 'a' 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 6 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['a', 'b'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . [\$end] 6 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 17 \$default reduce using rule 5 (A) State 16 4 A: 'a' 'a' 'a' . \$default reduce using rule 4 (A) State 17 6 c: 'a' 'a' 'b' . \$default reduce using rule 6 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_113 #AT_START_114 at_fn_group_banner 114 'reduce.at:707' \ "%define lr.type ielr: Lane Split" " " 6 at_xfail=no ( $as_echo "114. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 18 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 6 c: . 'a' 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 6 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 7 c: A . \$default reduce using rule 7 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['a'] \$default reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . [\$end] 6 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 17 \$default reduce using rule 5 (A) State 16 4 A: 'a' 'a' 'a' . \$default reduce using rule 4 (A) State 17 6 c: 'a' 'a' 'b' . \$default reduce using rule 6 (c) State 18 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 19 State 19 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['b'] 'a' shift, and go to state 16 \$default reduce using rule 5 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_114 #AT_START_115 at_fn_group_banner 115 'reduce.at:707' \ "%define lr.type canonical-lr: Lane Split" " " 6 at_xfail=no ( $as_echo "115. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 'a' shift, and go to state 18 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' 'a' 5 | . 'a' 'a' 6 c: . 'a' 'a' 'b' 7 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 6 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 7 c: A . [\$end] \$end reduce using rule 7 (c) State 10 3 S: 'c' c . [\$end] \$end reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['a'] 'a' reduce using rule 5 (A) Conflict between rule 5 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . [\$end] \$end reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . [\$end] \$end reduce using rule 2 (S) State 15 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . [\$end] 6 c: 'a' 'a' . 'b' 'a' shift, and go to state 19 'b' shift, and go to state 17 \$end reduce using rule 5 (A) State 16 4 A: 'a' 'a' 'a' . ['a'] 'a' reduce using rule 4 (A) State 17 6 c: 'a' 'a' 'b' . [\$end] \$end reduce using rule 6 (c) State 18 4 A: 'a' . 'a' 'a' 5 | 'a' . 'a' 'a' shift, and go to state 20 State 19 4 A: 'a' 'a' 'a' . [\$end] \$end reduce using rule 4 (A) State 20 4 A: 'a' 'a' . 'a' 5 | 'a' 'a' . ['b'] 'a' shift, and go to state 21 'b' reduce using rule 5 (A) State 21 4 A: 'a' 'a' 'a' . ['b'] 'b' reduce using rule 4 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:707" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_115 #AT_START_116 at_fn_group_banner 116 'reduce.at:951' \ "no %define lr.type: Complex Lane Split" " " 6 at_xfail=no ( $as_echo "116. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %prec 'a' ; c: 'a' 'a' 'b' | A ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['a', 'b'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_116 #AT_START_117 at_fn_group_banner 117 'reduce.at:951' \ "%define lr.type lalr: Complex Lane Split" " " 6 at_xfail=no ( $as_echo "117. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %prec 'a' ; c: 'a' 'a' 'b' | A ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['a', 'b'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_117 #AT_START_118 at_fn_group_banner 118 'reduce.at:951' \ "%define lr.type ielr: Complex Lane Split" " " 6 at_xfail=no ( $as_echo "118. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %prec 'a' ; c: 'a' 'a' 'b' | A ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 19 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['a'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) State 19 4 A: 'a' . 'a' B 'a' shift, and go to state 20 State 20 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['b'] 'a' shift, and go to state 16 \$default reduce using rule 6 (B) B go to state 17 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_118 #AT_START_119 at_fn_group_banner 119 'reduce.at:951' \ "%define lr.type canonical-lr: Complex Lane Split" "" 6 at_xfail=no ( $as_echo "119. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %left 'a' // Conflict resolution renders state 16 unreachable for canonical LR(1). We // keep it so that the paser table diff is easier to code. %define lr.keep-unreachable-states %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %prec 'a' ; c: 'a' 'a' 'b' | A ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 19 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . [\$end] \$end reduce using rule 8 (c) State 10 3 S: 'c' c . [\$end] \$end reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['a'] 'a' reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . [\$end] \$end reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . [\$end] \$end reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 20 'b' shift, and go to state 18 \$end reduce using rule 6 (B) B go to state 21 State 16 5 B: 'a' . ['a'] 'a' reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . ['a'] 'a' reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . [\$end] \$end reduce using rule 7 (c) State 19 4 A: 'a' . 'a' B 'a' shift, and go to state 22 State 20 5 B: 'a' . [\$end] \$end reduce using rule 5 (B) State 21 4 A: 'a' 'a' B . [\$end] \$end reduce using rule 4 (A) State 22 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . ['b'] 'a' shift, and go to state 23 'b' reduce using rule 6 (B) B go to state 24 State 23 5 B: 'a' . ['b'] 'b' reduce using rule 5 (B) State 24 4 A: 'a' 'a' B . ['b'] 'b' reduce using rule 4 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:951" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_119 #AT_START_120 at_fn_group_banner 120 'reduce.at:1220' \ "no %define lr.type: Split During Added Lookahead Propagation" "" 6 at_xfail=no ( $as_echo "120. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.keep-unreachable-states %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'f' 2 | . 'a' B 3 | . 'b' A 'f' 4 | . 'b' B 'g' 5 | . 'b' 'd' 6 | . 'c' 'c' A 'g' 7 | . 'c' 'c' B 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'f' 2 | 'a' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 6 B go to state 7 State 2 3 S: 'b' . A 'f' 4 | 'b' . B 'g' 5 | 'b' . 'd' 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 8 A go to state 9 B go to state 10 State 3 6 S: 'c' . 'c' A 'g' 7 | 'c' . 'c' B 'c' shift, and go to state 11 State 4 0 \$accept: S . \$end \$end shift, and go to state 12 State 5 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 State 6 1 S: 'a' A . 'f' 'f' shift, and go to state 14 State 7 2 S: 'a' B . \$default reduce using rule 2 (S) State 8 5 S: 'b' 'd' . [\$end] 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 \$default reduce using rule 5 (S) State 9 3 S: 'b' A . 'f' 'f' shift, and go to state 15 State 10 4 S: 'b' B . 'g' 'g' shift, and go to state 16 State 11 6 S: 'c' 'c' . A 'g' 7 | 'c' 'c' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 17 B go to state 18 State 12 0 \$accept: S \$end . \$default accept State 13 8 A: 'd' 'e' . ['f', 'g'] 9 B: 'd' 'e' . [\$end, 'g'] \$end reduce using rule 9 (B) 'g' reduce using rule 8 (A) 'g' [reduce using rule 9 (B)] \$default reduce using rule 8 (A) State 14 1 S: 'a' A 'f' . \$default reduce using rule 1 (S) State 15 3 S: 'b' A 'f' . \$default reduce using rule 3 (S) State 16 4 S: 'b' B 'g' . \$default reduce using rule 4 (S) State 17 6 S: 'c' 'c' A . 'g' 'g' shift, and go to state 19 State 18 7 S: 'c' 'c' B . \$default reduce using rule 7 (S) State 19 6 S: 'c' 'c' A 'g' . \$default reduce using rule 6 (S) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_120 #AT_START_121 at_fn_group_banner 121 'reduce.at:1220' \ "%define lr.type lalr: Split During Added Lookahead Propagation" "" 6 at_xfail=no ( $as_echo "121. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %define lr.keep-unreachable-states %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'f' 2 | . 'a' B 3 | . 'b' A 'f' 4 | . 'b' B 'g' 5 | . 'b' 'd' 6 | . 'c' 'c' A 'g' 7 | . 'c' 'c' B 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'f' 2 | 'a' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 6 B go to state 7 State 2 3 S: 'b' . A 'f' 4 | 'b' . B 'g' 5 | 'b' . 'd' 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 8 A go to state 9 B go to state 10 State 3 6 S: 'c' . 'c' A 'g' 7 | 'c' . 'c' B 'c' shift, and go to state 11 State 4 0 \$accept: S . \$end \$end shift, and go to state 12 State 5 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 State 6 1 S: 'a' A . 'f' 'f' shift, and go to state 14 State 7 2 S: 'a' B . \$default reduce using rule 2 (S) State 8 5 S: 'b' 'd' . [\$end] 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 \$default reduce using rule 5 (S) State 9 3 S: 'b' A . 'f' 'f' shift, and go to state 15 State 10 4 S: 'b' B . 'g' 'g' shift, and go to state 16 State 11 6 S: 'c' 'c' . A 'g' 7 | 'c' 'c' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 17 B go to state 18 State 12 0 \$accept: S \$end . \$default accept State 13 8 A: 'd' 'e' . ['f', 'g'] 9 B: 'd' 'e' . [\$end, 'g'] \$end reduce using rule 9 (B) 'g' reduce using rule 8 (A) 'g' [reduce using rule 9 (B)] \$default reduce using rule 8 (A) State 14 1 S: 'a' A 'f' . \$default reduce using rule 1 (S) State 15 3 S: 'b' A 'f' . \$default reduce using rule 3 (S) State 16 4 S: 'b' B 'g' . \$default reduce using rule 4 (S) State 17 6 S: 'c' 'c' A . 'g' 'g' shift, and go to state 19 State 18 7 S: 'c' 'c' B . \$default reduce using rule 7 (S) State 19 6 S: 'c' 'c' A 'g' . \$default reduce using rule 6 (S) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_121 #AT_START_122 at_fn_group_banner 122 'reduce.at:1220' \ "%define lr.type ielr: Split During Added Lookahead Propagation" "" 6 at_xfail=no ( $as_echo "122. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %define lr.keep-unreachable-states %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'f' 2 | . 'a' B 3 | . 'b' A 'f' 4 | . 'b' B 'g' 5 | . 'b' 'd' 6 | . 'c' 'c' A 'g' 7 | . 'c' 'c' B 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'f' 2 | 'a' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 6 B go to state 7 State 2 3 S: 'b' . A 'f' 4 | 'b' . B 'g' 5 | 'b' . 'd' 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 8 A go to state 9 B go to state 10 State 3 6 S: 'c' . 'c' A 'g' 7 | 'c' . 'c' B 'c' shift, and go to state 11 State 4 0 \$accept: S . \$end \$end shift, and go to state 12 State 5 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 20 State 6 1 S: 'a' A . 'f' 'f' shift, and go to state 14 State 7 2 S: 'a' B . \$default reduce using rule 2 (S) State 8 5 S: 'b' 'd' . [\$end] 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 \$default reduce using rule 5 (S) State 9 3 S: 'b' A . 'f' 'f' shift, and go to state 15 State 10 4 S: 'b' B . 'g' 'g' shift, and go to state 16 State 11 6 S: 'c' 'c' . A 'g' 7 | 'c' 'c' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 17 B go to state 18 State 12 0 \$accept: S \$end . \$default accept State 13 8 A: 'd' 'e' . ['f'] 9 B: 'd' 'e' . ['g'] 'g' reduce using rule 9 (B) \$default reduce using rule 8 (A) State 14 1 S: 'a' A 'f' . \$default reduce using rule 1 (S) State 15 3 S: 'b' A 'f' . \$default reduce using rule 3 (S) State 16 4 S: 'b' B 'g' . \$default reduce using rule 4 (S) State 17 6 S: 'c' 'c' A . 'g' 'g' shift, and go to state 19 State 18 7 S: 'c' 'c' B . \$default reduce using rule 7 (S) State 19 6 S: 'c' 'c' A 'g' . \$default reduce using rule 6 (S) State 20 8 A: 'd' 'e' . ['f', 'g'] 9 B: 'd' 'e' . [\$end] \$end reduce using rule 9 (B) \$default reduce using rule 8 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_122 #AT_START_123 at_fn_group_banner 123 'reduce.at:1220' \ "%define lr.type canonical-lr: Split During Added Lookahead Propagation" "" 6 at_xfail=no ( $as_echo "123. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %define lr.keep-unreachable-states %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'f' 2 | . 'a' B 3 | . 'b' A 'f' 4 | . 'b' B 'g' 5 | . 'b' 'd' 6 | . 'c' 'c' A 'g' 7 | . 'c' 'c' B 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'f' 2 | 'a' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 5 A go to state 6 B go to state 7 State 2 3 S: 'b' . A 'f' 4 | 'b' . B 'g' 5 | 'b' . 'd' 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 8 A go to state 9 B go to state 10 State 3 6 S: 'c' . 'c' A 'g' 7 | 'c' . 'c' B 'c' shift, and go to state 11 State 4 0 \$accept: S . \$end \$end shift, and go to state 12 State 5 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 13 State 6 1 S: 'a' A . 'f' 'f' shift, and go to state 14 State 7 2 S: 'a' B . [\$end] \$end reduce using rule 2 (S) State 8 5 S: 'b' 'd' . [\$end] 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 20 \$end reduce using rule 5 (S) State 9 3 S: 'b' A . 'f' 'f' shift, and go to state 15 State 10 4 S: 'b' B . 'g' 'g' shift, and go to state 16 State 11 6 S: 'c' 'c' . A 'g' 7 | 'c' 'c' . B 8 A: . 'd' 'e' 9 B: . 'd' 'e' 'd' shift, and go to state 21 A go to state 17 B go to state 18 State 12 0 \$accept: S \$end . \$default accept State 13 8 A: 'd' 'e' . ['f'] 9 B: 'd' 'e' . [\$end] \$end reduce using rule 9 (B) 'f' reduce using rule 8 (A) State 14 1 S: 'a' A 'f' . [\$end] \$end reduce using rule 1 (S) State 15 3 S: 'b' A 'f' . [\$end] \$end reduce using rule 3 (S) State 16 4 S: 'b' B 'g' . [\$end] \$end reduce using rule 4 (S) State 17 6 S: 'c' 'c' A . 'g' 'g' shift, and go to state 19 State 18 7 S: 'c' 'c' B . [\$end] \$end reduce using rule 7 (S) State 19 6 S: 'c' 'c' A 'g' . [\$end] \$end reduce using rule 6 (S) State 20 8 A: 'd' 'e' . ['f'] 9 B: 'd' 'e' . ['g'] 'f' reduce using rule 8 (A) 'g' reduce using rule 9 (B) State 21 8 A: 'd' . 'e' 9 B: 'd' . 'e' 'e' shift, and go to state 22 State 22 8 A: 'd' 'e' . ['g'] 9 B: 'd' 'e' . [\$end] \$end reduce using rule 9 (B) 'g' reduce using rule 8 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1220" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_123 #AT_START_124 at_fn_group_banner 124 'reduce.at:1550' \ "no %define lr.default-reductions" " " 6 at_xfail=no ( $as_echo "124. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: ; c: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . [\$end, 'a'] 6 c: . ['b'] 'b' reduce using rule 6 (c) \$default reduce using rule 5 (b) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$default reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_124 #AT_START_125 at_fn_group_banner 125 'reduce.at:1550' \ "%define lr.default-reductions most" " " 6 at_xfail=no ( $as_echo "125. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.default-reductions most %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: ; c: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . [\$end, 'a'] 6 c: . ['b'] 'b' reduce using rule 6 (c) \$default reduce using rule 5 (b) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$default reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_125 #AT_START_126 at_fn_group_banner 126 'reduce.at:1550' \ "%define lr.default-reductions consistent" " " 6 at_xfail=no ( $as_echo "126. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.default-reductions consistent %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: ; c: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . [\$end, 'a'] 6 c: . ['b'] \$end reduce using rule 5 (b) 'a' reduce using rule 5 (b) 'b' reduce using rule 6 (c) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$end reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_126 #AT_START_127 at_fn_group_banner 127 'reduce.at:1550' \ "%define lr.default-reductions accepting" " " 6 at_xfail=no ( $as_echo "127. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.default-reductions accepting %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: ; c: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . [\$end, 'a', 'b'] \$end reduce using rule 4 (a) 'a' reduce using rule 4 (a) 'b' reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . [\$end, 'a'] 6 c: . ['b'] \$end reduce using rule 5 (b) 'a' reduce using rule 5 (b) 'b' reduce using rule 6 (c) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$end reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . [\$end] \$end reduce using rule 2 (start) State 8 3 start: a c 'b' . [\$end] \$end reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1550" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_127 #AT_START_128 at_fn_group_banner 128 'synclines.at:150' \ "Prologue syncline" " " 7 at_xfail=no ( $as_echo "128. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:150: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:150" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:150: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:150: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %{ #error "2" void yyerror ( const char *msg); int yylex (void); %} %% exp: '0'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:150" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:150: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:150: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:150: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:150" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:150: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:150" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:150: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:150: cat stdout" at_fn_check_prepare_trace "synclines.at:150" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_128 #AT_START_129 at_fn_group_banner 129 'synclines.at:168' \ "%union syncline" " " 7 at_xfail=no ( $as_echo "129. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:168: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:168" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:168: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:168: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %union { #error "2" char dummy; } %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '0'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:168: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:168: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:168: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:168" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:168: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:168" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:168: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:168: cat stdout" at_fn_check_prepare_trace "synclines.at:168" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_129 #AT_START_130 at_fn_group_banner 130 'synclines.at:189' \ "Postprologue syncline" " " 7 at_xfail=no ( $as_echo "130. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:189: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:189" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:189: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:189: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %{ void yyerror ( const char *msg); int yylex (void); %} %union { int ival; } %{ #error "10" %} %% exp: '0'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:189" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:189: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:189: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:189: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:189" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:189: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:189" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:189: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:189: cat stdout" at_fn_check_prepare_trace "synclines.at:189" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:10: #error \"10\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_130 #AT_START_131 at_fn_group_banner 131 'synclines.at:213' \ "Action syncline" " " 7 at_xfail=no ( $as_echo "131. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:213: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:213" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:213: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:213: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: { #error "8" }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:213" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:213: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:213: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:213: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:213" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:213: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:213" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:213: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:213: cat stdout" at_fn_check_prepare_trace "synclines.at:213" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_131 #AT_START_132 at_fn_group_banner 132 'synclines.at:232' \ "Epilogue syncline" " " 7 at_xfail=no ( $as_echo "132. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:232: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:232" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:232: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:232: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '0'; %% #error "8" _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:232" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:232: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:232: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:232" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:232: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:232" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:232: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:232: cat stdout" at_fn_check_prepare_trace "synclines.at:232" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_132 #AT_START_133 at_fn_group_banner 133 'synclines.at:249' \ "%code top syncline" " " 7 at_xfail=no ( $as_echo "133. $at_setup_line: testing $at_desc ..." $at_traceon # It seems impossible to find a generic scheme to check the location # of an error. Even requiring GCC is not sufficient, since for instance # the version modified by Apple: # # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 # | 19991024 (release) configure:2124: $? = 0 # # instead of: # # | input.y:2: #error "2" # # it reports: # # | input.y:2: "2" # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode cat >syncline.c <<'_ATEOF' #error "1" int i; /* avoids -pedantic warning about an empty translation unit. */ _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:249: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:249" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:249: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:249: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #error "2" } %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '0'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:249" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:249: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:249: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:249: bison -o input.c input.y" at_fn_check_prepare_trace "synclines.at:249" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:249: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:249" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } # Transform stderr into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated { set +x $as_echo "$at_srcdir/synclines.at:249: \$PERL -p -0777 - stderr <<\\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\\[\\d+\\] .*\\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; # Function context. s/^[^:]*: In function '[^']+':\\n//gm; # Caret error. s/^ *#error.*\\n *\\^\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249" ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF # 1. Remove useless lines. # distcc clutter. s/^distcc\[\d+\] .*\n//gm; # c vs. c++. s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; # Function context. s/^[^:]*: In function '[^']+':\n//gm; # Caret error. s/^ *#error.*\n *\^\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:249: cat stdout" at_fn_check_prepare_trace "synclines.at:249" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_133 #AT_START_134 at_fn_group_banner 134 'synclines.at:290' \ "%no-lines" " " 7 at_xfail=no ( $as_echo "134. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "yacc.c" %defines %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '0' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:290: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --no-lines -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:290" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:290: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:290" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:290: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:290" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:290: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:290" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:290: bison --no-lines -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:290" ( $at_check_trace; bison --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:290: grep '#line' *.c *.h" at_fn_check_prepare_trace "synclines.at:290" ( $at_check_trace; grep '#line' *.c *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:290" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_134 #AT_START_135 at_fn_group_banner 135 'synclines.at:291' \ "%no-lines" " " 7 at_xfail=no ( $as_echo "135. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "glr.c" %defines %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '0' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:291: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --no-lines -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:291" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:291: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:291" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:291: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:291: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:291: bison --no-lines -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:291" ( $at_check_trace; bison --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:291: grep '#line' *.c *.h" at_fn_check_prepare_trace "synclines.at:291" ( $at_check_trace; grep '#line' *.c *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:291" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_135 #AT_START_136 at_fn_group_banner 136 'synclines.at:292' \ "%no-lines" " " 7 at_xfail=no ( $as_echo "136. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %defines %{ int yylex (yy::parser::semantic_type *lvalp); %} %% exp: '0' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:292: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:292" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:292: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:292" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:292: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:292" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:292: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:292" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:292: bison --no-lines -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:292" ( $at_check_trace; bison --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:292: grep '#line' *.cc *.hh" at_fn_check_prepare_trace "synclines.at:292" ( $at_check_trace; grep '#line' *.cc *.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:292" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_136 #AT_START_137 at_fn_group_banner 137 'synclines.at:293' \ "%no-lines" " " 7 at_xfail=no ( $as_echo "137. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "glr.cc" %defines %{ int yylex (yy::parser::semantic_type *lvalp); %} %% exp: '0' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/synclines.at:293: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:293" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:293: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:293" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:293: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:293" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/synclines.at:293: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:293" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:293: bison --no-lines -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:293" ( $at_check_trace; bison --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:293: grep '#line' *.cc *.hh" at_fn_check_prepare_trace "synclines.at:293" ( $at_check_trace; grep '#line' *.cc *.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:293" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_137 #AT_START_138 at_fn_group_banner 138 'headers.at:57' \ "Invalid CPP guards: --defines=input/input.h" " " 8 at_xfail=no ( $as_echo "138. $at_setup_line: testing $at_desc ..." $at_traceon # Possibly create inner directories. dirname=`$as_dirname -- input/input || $as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ Xinput/input : 'X\(//\)[^/]' \| \ Xinput/input : 'X\(//\)$' \| \ Xinput/input : 'X\(/\)' \| . 2>/dev/null || $as_echo Xinput/input | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirname; as_fn_mkdir_p cat >input/input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include void yyerror ( const char *msg); int yylex (void); %} %% dummy:; %% #include _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:57" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:57" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:57: bison --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_trace "headers.at:57" ( $at_check_trace; bison --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:57: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:57" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:57: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:57" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_138 #AT_START_139 at_fn_group_banner 139 'headers.at:58' \ "Invalid CPP guards: --defines=9foo.h" " " 8 at_xfail=no ( $as_echo "139. $at_setup_line: testing $at_desc ..." $at_traceon # Possibly create inner directories. dirname=`$as_dirname -- 9foo || $as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X9foo : 'X\(//\)[^/]' \| \ X9foo : 'X\(//\)$' \| \ X9foo : 'X\(/\)' \| . 2>/dev/null || $as_echo X9foo | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirname; as_fn_mkdir_p cat >9foo.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include <9foo.h> void yyerror ( const char *msg); int yylex (void); %} %% dummy:; %% #include <9foo.h> _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:58" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:58: bison --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_trace "headers.at:58" ( $at_check_trace; bison --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:58: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:58" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:58: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:58" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_139 #AT_START_140 at_fn_group_banner 140 'headers.at:59' \ "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 8 at_xfail=no ( $as_echo "140. $at_setup_line: testing $at_desc ..." $at_traceon # Possibly create inner directories. dirname=`$as_dirname -- input/input || $as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ Xinput/input : 'X\(//\)[^/]' \| \ Xinput/input : 'X\(//\)$' \| \ Xinput/input : 'X\(/\)' \| . 2>/dev/null || $as_echo Xinput/input | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirname; as_fn_mkdir_p cat >input/input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %{ #include void yyerror ( const char *msg); int yylex (void); %} %% dummy:; %% #include _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:59" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:59" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:59: bison --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_trace "headers.at:59" ( $at_check_trace; bison --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:59: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:59" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:59: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:59" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_140 #AT_START_141 at_fn_group_banner 141 'headers.at:60' \ "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 8 at_xfail=no ( $as_echo "141. $at_setup_line: testing $at_desc ..." $at_traceon # Possibly create inner directories. dirname=`$as_dirname -- 9foo || $as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X9foo : 'X\(//\)[^/]' \| \ X9foo : 'X\(//\)$' \| \ X9foo : 'X\(/\)' \| . 2>/dev/null || $as_echo X9foo | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirname; as_fn_mkdir_p cat >9foo.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %{ #include <9foo.h> void yyerror ( const char *msg); int yylex (void); %} %% dummy:; %% #include <9foo.h> _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:60" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:60" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:60: bison --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_trace "headers.at:60" ( $at_check_trace; bison --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:60: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:60" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:60: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:60" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_141 #AT_START_142 at_fn_group_banner 142 'headers.at:69' \ "export YYLTYPE" " " 8 at_xfail=no ( $as_echo "142. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %locations %name-prefix "my_" %{ #include #include static int my_lex (void) { return EOF; } static void my_error (const char *msg) { fprintf (stderr, "%s\n", msg); } %} %% exp:; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:96: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:96" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:96: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y" "headers.at:96" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:96: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:96" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:96: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:96" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:96: bison --defines -o input.c input.y" at_fn_check_prepare_trace "headers.at:96" ( $at_check_trace; bison --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96" $at_failed && at_fn_log_failure $at_traceon; } # YYLTYPE should be defined, and MY_LLOC declared. cat >caller.c <<'_ATEOF' #include "input.h" YYLTYPE *my_llocp = &my_lloc; int my_parse (void); int main (void) { return my_parse (); } _ATEOF # Link and execute, just to make sure everything is fine (and in # particular, that MY_LLOC is indeed defined somewhere). { set +x $as_echo "$at_srcdir/headers.at:114: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:114" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:114" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o caller.o caller.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c " "headers.at:114" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:114" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:115: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:115" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:115" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:115: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:115" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:115" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:116: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:116" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:116: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o caller caller.o input.o \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS" "headers.at:116" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:117: \$PREPARSER ./caller" at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:117" ( $at_check_trace; $PREPARSER ./caller ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:117" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:117: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:117" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:117" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_142 #AT_START_143 at_fn_group_banner 143 'headers.at:125' \ "Several parsers" " " 8 at_xfail=no ( $as_echo "143. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST([PREFIX], [DIRECTIVES]) # ------------------------------- # Generate and compile to *.o. Make sure there is no (allowed) YY* # nor yy* identifiers in the header. Check that headers are # self-contained, and can be compiled by a C++ compiler. # AT_TEST cat >main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc // If we are compiling with CC=$CXX, then do not load the C headers // inside extern "C", since they were _not_ compiled this way. #if ! CC_IS_CXX extern "C" { #endif #include "x1.h" #include "x2.h" #include "x3.h" #include "x4.h" #include "x6.h" #include "x7.h" #include "x8.h" #if ! CC_IS_CXX } #endif #include "x5.hh" //#include "x6.hh" #define RUN(S) \ do { \ int res = S; \ if (res) \ std::cerr << #S": " << res << std::endl; \ } while (false) int main (void) { RUN(x1_parse()); RUN(x2_parse()); RUN(x3_parse()); RUN(x4_parse()); x5_::parser p5; RUN(p5.parse()); RUN(x6_parse()); RUN(x7_parse()); RUN(x8_parse()); // x6_::parser p6; // RUN(p6.parse()); return 0; } _ATEOF # main.cc cat >x1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x1_" %error-verbose %union { int integer; } %{ #include static void x1_error ( const char *msg); static int x1_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x1_error ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int x1_lex (void) { static char const input[] = "x1"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:218: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x1.c x1.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:218" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:218: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:218" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:218: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:218" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:218: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:218" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:218: bison -d -o x1.c x1.y" at_fn_check_prepare_trace "headers.at:218" ( $at_check_trace; bison -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:218: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:218" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:218: \$CC \$CFLAGS \$CPPFLAGS -c -o x1.o x1.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c " "headers.at:218" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:218: echo \"x1\" >>expout" at_fn_check_prepare_trace "headers.at:218" ( $at_check_trace; echo "x1" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218" $at_failed && at_fn_log_failure $at_traceon; } cat >x2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x2_" %locations %debug %error-verbose %union { int integer; } %{ #include static void x2_error ( const char *msg); static int x2_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x2_error ( const char *msg) { YY_LOCATION_PRINT (stderr, (x2_lloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int x2_lex (void) { static char const input[] = "x2"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (x2_lloc).first_line = (x2_lloc).last_line = 1; (x2_lloc).first_column = (x2_lloc).last_column = toknum; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x2.c x2.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:219" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:219: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:219" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:219: bison -d -o x2.c x2.y" at_fn_check_prepare_trace "headers.at:219" ( $at_check_trace; bison -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:219: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:219" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:219: \$CC \$CFLAGS \$CPPFLAGS -c -o x2.o x2.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c " "headers.at:219" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:219: echo \"x2\" >>expout" at_fn_check_prepare_trace "headers.at:219" ( $at_check_trace; echo "x2" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219" $at_failed && at_fn_log_failure $at_traceon; } cat >x3.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x3_" %glr-parser %error-verbose %union { int integer; } %{ #include static void x3_error ( const char *msg); static int x3_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x3_error ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int x3_lex (void) { static char const input[] = "x3"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x3.c x3.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:220" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:220: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:220" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:220: bison -d -o x3.c x3.y" at_fn_check_prepare_trace "headers.at:220" ( $at_check_trace; bison -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:220: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:220" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:220: \$CC \$CFLAGS \$CPPFLAGS -c -o x3.o x3.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c " "headers.at:220" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:220: echo \"x3\" >>expout" at_fn_check_prepare_trace "headers.at:220" ( $at_check_trace; echo "x3" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220" $at_failed && at_fn_log_failure $at_traceon; } cat >x4.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x4_" %locations %debug %glr-parser %error-verbose %union { int integer; } %{ #include static void x4_error ( const char *msg); static int x4_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x4_error ( const char *msg) { YY_LOCATION_PRINT (stderr, (x4_lloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int x4_lex (void) { static char const input[] = "x4"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (x4_lloc).first_line = (x4_lloc).last_line = 1; (x4_lloc).first_column = (x4_lloc).last_column = toknum; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:221: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x4.c x4.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:221" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:221: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:221" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:221: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:221" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:221: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:221" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:221: bison -d -o x4.c x4.y" at_fn_check_prepare_trace "headers.at:221" ( $at_check_trace; bison -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:221: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:221" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:221: \$CC \$CFLAGS \$CPPFLAGS -c -o x4.o x4.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c " "headers.at:221" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:221: echo \"x4\" >>expout" at_fn_check_prepare_trace "headers.at:221" ( $at_check_trace; echo "x4" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221" $at_failed && at_fn_log_failure $at_traceon; } cat >x5.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x5_" %locations %debug %language "c++" %error-verbose %union { int integer; } %{ #include static int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% /* A C++ error reporting function. */ void x5_::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } #include static int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp) { static char const input[] = "x5"; static size_t toknum = 0; int res; (void) lvalp;(void) llocp; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x5.cc x5.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:222" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:222" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:222: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:222" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:222: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:222" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:222: bison -d -o x5.cc x5.y" at_fn_check_prepare_trace "headers.at:222" ( $at_check_trace; bison -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:222: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:222" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:222: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o x5.o x5.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc " "headers.at:222" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:222: echo \"x5\" >>expout" at_fn_check_prepare_trace "headers.at:222" ( $at_check_trace; echo "x5" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222" $at_failed && at_fn_log_failure $at_traceon; } cat >x6.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x6_" %define api.pure %error-verbose %union { int integer; } %{ #include static void x6_error ( const char *msg); static int x6_lex (X6_STYPE *lvalp); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x6_error ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int x6_lex (X6_STYPE *lvalp) { static char const input[] = "x6"; static size_t toknum = 0; int res; (void) lvalp;; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:223: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x6.c x6.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:223" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:223: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:223" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:223: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:223" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:223: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:223" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:223: bison -d -o x6.c x6.y" at_fn_check_prepare_trace "headers.at:223" ( $at_check_trace; bison -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:223: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:223" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:223: \$CC \$CFLAGS \$CPPFLAGS -c -o x6.o x6.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c " "headers.at:223" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:223: echo \"x6\" >>expout" at_fn_check_prepare_trace "headers.at:223" ( $at_check_trace; echo "x6" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223" $at_failed && at_fn_log_failure $at_traceon; } cat >x7.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x7_" %define api.push-pull both %error-verbose %union { int integer; } %{ #include static void x7_error ( const char *msg); static int x7_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x7_error ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int x7_lex (void) { static char const input[] = "x7"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x7.c x7.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:224" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:224" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:224: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:224" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:224: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:224" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:224: bison -d -o x7.c x7.y" at_fn_check_prepare_trace "headers.at:224" ( $at_check_trace; bison -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:224: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:224" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:224: \$CC \$CFLAGS \$CPPFLAGS -c -o x7.o x7.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c " "headers.at:224" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:224: echo \"x7\" >>expout" at_fn_check_prepare_trace "headers.at:224" ( $at_check_trace; echo "x7" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224" $at_failed && at_fn_log_failure $at_traceon; } cat >x8.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %define api.prefix "x8_" %define api.pure %define api.push-pull both %error-verbose %union { int integer; } %{ #include static void x8_error ( const char *msg); static int x8_lex (X8_STYPE *lvalp); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } ; %% #include /* A C error reporting function. */ static void x8_error ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int x8_lex (X8_STYPE *lvalp) { static char const input[] = "x8"; static size_t toknum = 0; int res; (void) lvalp;; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:225: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -o x8.c x8.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:225" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:225: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:225" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:225: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:225" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/headers.at:225: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:225" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:225: bison -d -o x8.c x8.y" at_fn_check_prepare_trace "headers.at:225" ( $at_check_trace; bison -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:225: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:225" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:225: \$CC \$CFLAGS \$CPPFLAGS -c -o x8.o x8.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c " "headers.at:225" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:225: echo \"x8\" >>expout" at_fn_check_prepare_trace "headers.at:225" ( $at_check_trace; echo "x8" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225" $at_failed && at_fn_log_failure $at_traceon; } #AT_TEST([x5], [%locations %language "c++" %glr-parser]) # Check there is no 'yy' left. # C++ output relies on namespaces and still uses yy a lot. # # Check there is no 'YY' left. # Ignore comments, YYChar (template parameter), YYPARSE_PARAM # (obsolete), YYPUSH_MORE(_DEFINED)? (constant definition), # YY_\w+_INCLUDED (header guards). # # YYDEBUG (not renamed) can be read, but not changed. { set +x $as_echo "$at_srcdir/headers.at:237: \$PERL -n -0777 -e ' s{/\\*.*?\\*/}{}gs; s{//.*}{}g; s{\\b(YYChar |YYPARSE_PARAM |YYPUSH_MORE(_DEFINED)? |YY_\\w+_INCLUDED |YY_NULL |(defined|if)\\ YYDEBUG )\\b}{}gx; while (/^(.*YY.*)\$/gm) { print \"\$ARGV: invalid exported YY: \$1\\n\"; } if (\$ARGV =~ /\\.h\$/) { while (/^(.*yy.*)\$/gm) { print \"\$ARGV: invalid exported yy: \$1\\n\"; } } ' -- *.hh *.h" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:237" ( $at_check_trace; $PERL -n -0777 -e ' s{/\*.*?\*/}{}gs; s{//.*}{}g; s{\b(YYChar |YYPARSE_PARAM |YYPUSH_MORE(_DEFINED)? |YY_\w+_INCLUDED |YY_NULL |(defined|if)\ YYDEBUG )\b}{}gx; while (/^(.*YY.*)$/gm) { print "$ARGV: invalid exported YY: $1\n"; } if ($ARGV =~ /\.h$/) { while (/^(.*yy.*)$/gm) { print "$ARGV: invalid exported yy: $1\n"; } } ' -- *.hh *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:237" $at_failed && at_fn_log_failure $at_traceon; } # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.h *.hh do # No shell expansion with AT_DATA. cat >$h.cc < /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "$h" #include "$h" EOF { set +x $as_echo "$at_srcdir/headers.at:270: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:270" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:270: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o \$h.o \$h.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc " "headers.at:270" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:270" $at_failed && at_fn_log_failure $at_traceon; } done # Do this late, so that other checks have been performed. cat >c-and-cxx.h <<'_ATEOF' #ifdef __cplusplus extern "C" { #endif int fortytwo (void); #ifdef __cplusplus } #endif _ATEOF cat >c-only.c <<'_ATEOF' #include "c-and-cxx.h" int main (void) { return fortytwo () == 42 ? 0 : 1; } _ATEOF cat >cxx-only.cc <<'_ATEOF' #include "c-and-cxx.h" int fortytwo () { return 42; } _ATEOF { set +x $as_echo "$at_srcdir/headers.at:274: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:274" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: \$CC \$CFLAGS \$CPPFLAGS -c -o c-only.o c-only.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c " "headers.at:274" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:274" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx-only.o cxx-only.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc " "headers.at:274" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS c-only.o cxx-only.o -o c-and-cxx || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:274" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS c-only.o cxx-only.o -o c-and-cxx || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_skip $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: \$PREPARSER ./c-and-cxx" at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:274" ( $at_check_trace; $PREPARSER ./c-and-cxx ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:274: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:274" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:276: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:276" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:276: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS" "headers.at:276" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:277: \$PREPARSER ./parser" at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:277" ( $at_check_trace; $PREPARSER ./parser ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:277" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:277: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:277" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:277" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_143 #AT_START_144 at_fn_group_banner 144 'actions.at:24' \ "Mid-rule actions" " " 9 at_xfail=no ( $as_echo "144. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once forgot the mid-rule actions. It was because the action # was attached to the host rule (the one with the mid-rule action), # instead of being attached to the empty rule dedicated to this # action. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %{ static void yyerror ( const char *msg); static int yylex (void); %} %% exp: { putchar ('0'); } '1' { putchar ('1'); } '2' { putchar ('2'); } '3' { putchar ('3'); } '4' { putchar ('4'); } '5' { putchar ('5'); } '6' { putchar ('6'); } '7' { putchar ('7'); } '8' { putchar ('8'); } '9' { putchar ('9'); } { putchar ('\n'); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "123456789"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:63" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:63" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:63: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:63" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:63: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:63" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:63: bison -d -v -o input.c input.y" at_fn_check_prepare_trace "actions.at:63" ( $at_check_trace; bison -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:64: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:64" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:64" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:64: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:64" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:64" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:65: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:65" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0123456789 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:65" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:65: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:65" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:65" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_144 #AT_START_145 at_fn_group_banner 145 'actions.at:133' \ "Initial location: yacc.c " " " 9 at_xfail=no ( $as_echo "145. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %code { # include # include /* getenv */ static void yyerror ( const char *msg); static int yylex (void); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:133" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:133" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:133: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:133: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:133: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:133" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:133: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:133" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:133" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:133: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:133" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:133" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_145 #AT_START_146 at_fn_group_banner 146 'actions.at:134' \ "Initial location: yacc.c %define api.pure full" " " 9 at_xfail=no ( $as_echo "146. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.pure full %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:134" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:134" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:134: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:134" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:134: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:134" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:134" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:134: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:134" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:134" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_146 #AT_START_147 at_fn_group_banner 147 'actions.at:135' \ "Initial location: yacc.c %define api.pure %parse-param { int x }" "" 9 at_xfail=no ( $as_echo "147. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.pure %parse-param { int x } %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, int x, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, int x, const char *msg) { YYUSE(x); YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (0); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:135" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:135" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:135: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:135" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:135: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:135" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:135: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:135" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:135: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:135" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:135: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:135" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:135: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:135" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:135: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:135" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_147 #AT_START_148 at_fn_group_banner 148 'actions.at:136' \ "Initial location: yacc.c %define api.push-pull both" "" 9 at_xfail=no ( $as_echo "148. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.push-pull both %code { # include # include /* getenv */ static void yyerror ( const char *msg); static int yylex (void); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:136" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:136" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:136: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:136" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:136: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:136" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:136: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:136" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:136: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:136" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:136: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:136" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:136: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:136" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_148 #AT_START_149 at_fn_group_banner 149 'actions.at:137' \ "Initial location: yacc.c %define api.push-pull both %define api.pure full" "" 9 at_xfail=no ( $as_echo "149. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.push-pull both %define api.pure full %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:137: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:137" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:137: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:137" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:137: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:137" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:137: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:137" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:137: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:137" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:137: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:137" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:137: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:137" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:137: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:137" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:137: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:137" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_149 #AT_START_150 at_fn_group_banner 150 'actions.at:138' \ "Initial location: glr.c " " " 9 at_xfail=no ( $as_echo "150. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "glr.c" %code { # include # include /* getenv */ static void yyerror ( const char *msg); static int yylex (void); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:138: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:138" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:138: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:138" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:138: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:138" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:138: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:138" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:138: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:138" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:138: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:138" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:138: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:138" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:138: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:138" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:138: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:138" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_150 #AT_START_151 at_fn_group_banner 151 'actions.at:139' \ "Initial location: glr.c %define api.pure" " " 9 at_xfail=no ( $as_echo "151. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "glr.c" %define api.pure %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:139" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:139" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:139: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:139" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:139: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:139" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:139: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:139" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:139" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:139" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:139" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:139" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_151 #AT_START_152 at_fn_group_banner 152 'actions.at:140' \ "Initial location: lalr1.cc " " " 9 at_xfail=no ( $as_echo "152. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "lalr1.cc" %code { # include # include /* getenv */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: { std::cerr << @$ << std::endl; } %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yy::parser p; p.set_debug_level (!!getenv("YYDEBUG")); return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:140: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:140" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:140: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:140" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:140: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:140" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:140: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:140" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:140: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:140" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:140: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:140" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:140: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:140" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:140: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:140" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:140: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:140" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_152 #AT_START_153 at_fn_group_banner 153 'actions.at:141' \ "Initial location: glr.cc " " " 9 at_xfail=no ( $as_echo "153. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "glr.cc" %code { # include # include /* getenv */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: { std::cerr << @$ << std::endl; } %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yy::parser p; p.set_debug_level (!!getenv("YYDEBUG")); return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:141: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:141" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:141: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:141" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:141: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:141" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:141: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:141" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:141: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:141" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:141: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:141" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:141: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:141" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:141: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:141" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:141: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:141" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1 1.1: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_153 #AT_START_154 at_fn_group_banner 154 'actions.at:150' \ "Initial location: yacc.c %define api.pure full" " " 9 at_xfail=no ( $as_echo "154. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.pure full %{ # define YYLTYPE int # define YY_LOCATION_PRINT(Stream, Loc) \ (void) (Loc) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) %} %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:150" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:150" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:150: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:150" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:150: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:150" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:150: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:150" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:150: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:150" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:150: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:150" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:150: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:150" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:150: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:150" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo " : syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_154 #AT_START_155 at_fn_group_banner 155 'actions.at:161' \ "Initial location: yacc.c %define api.pure full" " " 9 at_xfail=no ( $as_echo "155. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %define api.pure full %{ # define YYLTYPE int # define YY_LOCATION_PRINT(Stream, Loc) \ fprintf ((Stream), "%d", (Loc)) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) %} %code { # include # include /* getenv */ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:161" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:161" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:161: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:161: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:161: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:161" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:161" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:161" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:161" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:161" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "0 0: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_155 #AT_START_156 at_fn_group_banner 156 'actions.at:244' \ "Location print: yacc.c " " " 9 at_xfail=no ( $as_echo "156. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "yacc.c" %code { # include # include /* getenv */ static void yyerror ( const char *msg); static int yylex (void); } %% exp:; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { #define TEST(L1, C1, L2, C2) \ (yylloc).first_line = L1; \ (yylloc).first_column = C1; \ (yylloc).last_line = L2; \ (yylloc).last_column = C2; \ YY_LOCATION_PRINT(stdout, (yylloc));\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:244" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:244" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:244" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:244" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:244: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:244" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:244: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:244" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:244: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:244" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:244: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:244" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1.1 2.1-9 3.1-4.0 5.1-6.9 7.2 8.0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:244: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:244" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_156 #AT_START_157 at_fn_group_banner 157 'actions.at:245' \ "Location print: glr.c " " " 9 at_xfail=no ( $as_echo "157. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ %locations %debug %skeleton "glr.c" %code { # include # include /* getenv */ static void yyerror ( const char *msg); static int yylex (void); } %% exp:; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { #define TEST(L1, C1, L2, C2) \ (yylloc).first_line = L1; \ (yylloc).first_column = C1; \ (yylloc).last_line = L2; \ (yylloc).last_column = C2; \ YY_LOCATION_PRINT(stdout, (yylloc));\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:245" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:245" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:245: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:245" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:245: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:245" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:245: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:245" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:245: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:245" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1.1 2.1-9 3.1-4.0 5.1-6.9 7.2 8.0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:245: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:245" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_157 #AT_START_158 at_fn_group_banner 158 'actions.at:257' \ "Exotic Dollars" " " 9 at_xfail=no ( $as_echo "158. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %{ static void yyerror ( const char *msg); static int yylex (void); # define USE(Var) %} %union { int val; }; %type a_1 a_2 a_5 sum_of_the_five_previous_values %% exp: a_1 a_2 { $$ = 3; } { $$ = $3 + 1; } a_5 sum_of_the_five_previous_values { USE (($1, $2, $3, $4, $5)); printf ("%d\n", $6); } ; a_1: { $$ = 1; }; a_2: { $$ = 2; }; a_5: { $$ = 5; }; sum_of_the_five_previous_values: { $$ = $0 + $-1 + $-2 + $-3 + $-4; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:305" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:305" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:305: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:305" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:305: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:305" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:305: bison -d -v -o input.c input.y" at_fn_check_prepare_trace "actions.at:305" ( $at_check_trace; bison -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:306: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:306" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:306: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:306" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:307: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:307" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "15 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:307: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:307" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:307" $at_failed && at_fn_log_failure $at_traceon; } # Make sure that fields after $n or $-n are parsed correctly. At one # point while implementing dashes in symbol names, we were dropping # fields after $-n. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include static void yyerror ( const char *msg); static int yylex (void); typedef struct { int val; } stype; # define YYSTYPE stype %} %% start: one two { $$.val = $1.val + $2.val; } sum ; one: { $$.val = 1; } ; two: { $$.val = 2; } ; sum: { printf ("%d\n", $0.val + $-1.val + $-2.val); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:340: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:340" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:340: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:340" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:340: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:340" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:340: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:340" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:340: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:340" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:340: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:340" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:340: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:340" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:341: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:341" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "6 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:341" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_158 #AT_START_159 at_fn_group_banner 159 'actions.at:751' \ "Printers and Destructors" " " 9 at_xfail=no ( $as_echo "159. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %code { static int yylex (void); static void yyerror ( const char *msg); } /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyoutput, "%d", $$); } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static unsigned int counter = 0; int c = (yylval) = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (yylloc).first_line = (yylloc).first_column = 10 * c; (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:751: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:751" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:751" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:751: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:751" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:751: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:751" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:751: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:751" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:751" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:751: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:751" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:751: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:751" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:751: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:751" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:751: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:751" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. { set +x $as_echo "$at_srcdir/actions.at:751: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:751" ( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: '(' (6@60-69) sending: 'x' (7@70-79) thing (7@70-79): 'x' (7@70-79) sending: ')' (8@80-89) line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89) sending: '(' (9@90-99) sending: 'x' (10@100-109) thing (10@100-109): 'x' (10@100-109) sending: ')' (11@110-119) line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119) sending: '(' (12@120-129) sending: 'x' (13@130-139) thing (13@130-139): 'x' (13@130-139) sending: ')' (14@140-149) line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149) sending: '(' (15@150-159) sending: 'x' (16@160-169) thing (16@160-169): 'x' (16@160-169) sending: ')' (17@170-179) line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179) sending: '(' (18@180-189) sending: 'x' (19@190-199) thing (19@190-199): 'x' (19@190-199) sending: ')' (20@200-209) 200.200-209.208: memory exhausted Freeing nterm thing (19@190-199) Freeing nterm line (15@150-179) Freeing nterm line (12@120-149) Freeing nterm line (9@90-119) Freeing nterm line (6@60-89) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Parsing FAILED (status 2). " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_159 #AT_START_160 at_fn_group_banner 160 'actions.at:752' \ "Printers and Destructors with union" " " 9 at_xfail=no ( $as_echo "160. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %union { int ival; } %code provides { static int yylex (void); static void yyerror ( const char *msg); } %type '(' 'x' 'y' ')' ';' thing line input END /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyoutput, "%d", $$); } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static unsigned int counter = 0; int c = (yylval).ival = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (yylloc).first_line = (yylloc).first_column = 10 * c; (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:752: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:752" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:752" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:752: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:752" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:752: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:752" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:752: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:752" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:752" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:752: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:752" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:752: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:752" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:752: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:752" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:752: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:752" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. { set +x $as_echo "$at_srcdir/actions.at:752: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:752" ( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:752" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: '(' (6@60-69) sending: 'x' (7@70-79) thing (7@70-79): 'x' (7@70-79) sending: ')' (8@80-89) line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89) sending: '(' (9@90-99) sending: 'x' (10@100-109) thing (10@100-109): 'x' (10@100-109) sending: ')' (11@110-119) line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119) sending: '(' (12@120-129) sending: 'x' (13@130-139) thing (13@130-139): 'x' (13@130-139) sending: ')' (14@140-149) line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149) sending: '(' (15@150-159) sending: 'x' (16@160-169) thing (16@160-169): 'x' (16@160-169) sending: ')' (17@170-179) line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179) sending: '(' (18@180-189) sending: 'x' (19@190-199) thing (19@190-199): 'x' (19@190-199) sending: ')' (20@200-209) 200.200-209.208: memory exhausted Freeing nterm thing (19@190-199) Freeing nterm line (15@150-179) Freeing nterm line (12@120-149) Freeing nterm line (9@90-119) Freeing nterm line (6@60-89) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Parsing FAILED (status 2). " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_160 #AT_START_161 at_fn_group_banner 161 'actions.at:754' \ "Printers and Destructors: %defines %skeleton \"lalr1.cc\"" "" 9 at_xfail=no ( $as_echo "161. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %defines %skeleton "lalr1.cc" %define global_tokens_and_yystype %code { typedef yy::location YYLTYPE; static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* FIXME: This %printer isn't actually tested. */ %printer { debug_stream () << $$;; } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static unsigned int counter = 0; int c = (*lvalp) = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (*llocp).begin.line = (*llocp).begin.column = 10 * c; (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); return source[c]; } static bool yydebug; int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:754: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:754" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:754" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:754: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:754" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:754: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:754" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:754: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:754" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:754" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:754" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:754: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:754" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:754" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:754: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:754" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:754" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:754: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:754" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:754" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:754: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:754" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:754" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_161 #AT_START_162 at_fn_group_banner 162 'actions.at:755' \ "Printers and Destructors with union: %defines %skeleton \"lalr1.cc\"" "" 9 at_xfail=no ( $as_echo "162. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %defines %skeleton "lalr1.cc" %union { int ival; } %define global_tokens_and_yystype %code provides { typedef yy::location YYLTYPE; static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %type '(' 'x' 'y' ')' ';' thing line input END /* FIXME: This %printer isn't actually tested. */ %printer { debug_stream () << $$;; } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static unsigned int counter = 0; int c = (*lvalp).ival = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (*llocp).begin.line = (*llocp).begin.column = 10 * c; (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); return source[c]; } static bool yydebug; int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:755" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:755" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:755: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:755" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:755: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:755" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:755: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:755" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:755" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:755" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:755: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:755" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:755" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:755: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:755" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:755" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:755: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:755" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:755" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:755: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:755" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:755" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_162 #AT_START_163 at_fn_group_banner 163 'actions.at:757' \ "Printers and Destructors: %glr-parser" " " 9 at_xfail=no ( $as_echo "163. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %glr-parser %code { static int yylex (void); static void yyerror ( const char *msg); } /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyoutput, "%d", $$); } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static unsigned int counter = 0; int c = (yylval) = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (yylloc).first_line = (yylloc).first_column = 10 * c; (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:757: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:757" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:757" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:757: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:757" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:757: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:757" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:757: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:757" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:757" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:757" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:757: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:757" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:757" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:757: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:757" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:757" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:757: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:757" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:757" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:757: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:757" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:757" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_163 #AT_START_164 at_fn_group_banner 164 'actions.at:758' \ "Printers and Destructors with union: %glr-parser" "" 9 at_xfail=no ( $as_echo "164. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure complex $n work. # Be sure to pass all the %directives to this macro to have correct # helping macros. So don't put any directly in the Bison file. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) } %error-verbose %debug %verbose %locations %glr-parser %union { int ival; } %code provides { static int yylex (void); static void yyerror ( const char *msg); } %type '(' 'x' 'y' ')' ';' thing line input END /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyoutput, "%d", $$); } input line thing 'x' 'y' %destructor { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% /* This grammar is made to exercise error recovery. "Lines" starting with `(' support error recovery, with ')' as synchronizing token. Lines starting with 'x' can never be recovered from if in error. */ input: /* Nothing. */ { $$ = 0; V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; V(input, $$, @$, ": "); V(line, $1, @1, " "); V(input, $2, @2, "\n"); } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE (@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static unsigned int counter = 0; int c = (yylval).ival = counter++; /* As in BASIC, line numbers go from 10 to 10. */ (yylloc).first_line = (yylloc).first_column = 10 * c; (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:758: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:758" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:758" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:758: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:758" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:758: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:758" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:758: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:758" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:758" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:758" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of "empty" # ----------------------------- # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? { set +x $as_echo "$at_srcdir/actions.at:758: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:758" ( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:758" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (0@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Check locations in error recovery # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). { set +x $as_echo "$at_srcdir/actions.at:758: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:758" ( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:758" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'y' (1@10-19) 10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) sending: END (3@30-39) input (0@29-29): /* Nothing */ input (2@0-29): line (-1@0-29) input (0@29-29) Freeing token END (3@30-39) Freeing nterm input (2@0-29) Successful parse. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Syntax errors caught by the parser # ---------------------------------- # Exercise the discarding of stack top and input until `error' # can be reduced. # # '(', 'x', 'x', 'x', 'x', 'x', ')', # # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'y' { set +x $as_echo "$at_srcdir/actions.at:758: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:758" ( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:758" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) 30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) sending: 'x' (4@40-49) Freeing token 'x' (4@40-49) sending: 'x' (5@50-59) Freeing token 'x' (5@50-59) sending: ')' (6@60-69) line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69) sending: '(' (7@70-79) sending: 'x' (8@80-89) thing (8@80-89): 'x' (8@80-89) sending: ')' (9@90-99) line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99) sending: '(' (10@100-109) sending: 'x' (11@110-119) thing (11@110-119): 'x' (11@110-119) sending: ')' (12@120-129) line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129) sending: 'y' (13@130-139) input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) 130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Syntax error caught by the parser where lookahead = END # -------------------------------------------------------- # Load the stack and provoke an error that cannot be caught by the # grammar, to check that the stack is cleared. And make sure the # lookahead is freed. # # '(', 'x', ')', # '(', 'x', ')', # 'x' { set +x $as_echo "$at_srcdir/actions.at:758: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:758" ( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:758" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: ')' (2@20-29) line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29) sending: '(' (3@30-39) sending: 'x' (4@40-49) thing (4@40-49): 'x' (4@40-49) sending: ')' (5@50-59) line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) 70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) Freeing token END (7@70-79) Parsing FAILED. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Check destruction upon stack overflow # ------------------------------------- # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_164 #AT_START_165 at_fn_group_banner 165 'actions.at:769' \ "Default tagless %printer and %destructor" " " 9 at_xfail=no ( $as_echo "165. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %locations %{ # include # include static int yylex (void); static void yyerror ( const char *msg); # define USE(SYM) %} %printer { fprintf (yyoutput, "<*> printer should not be called.\n"); } <*> %printer { fprintf (yyoutput, "<> printer for '%c' @ %d", $$, @$.first_column); } <> %destructor { fprintf (stdout, "<> destructor for '%c' @ %d.\n", $$, @$.first_column); } <> %printer { fprintf (yyoutput, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column); } 'b' 'c' %destructor { fprintf (stdout, "'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column); } 'b' 'c' %destructor { fprintf (yyoutput, "<*> destructor should not be called.\n"); } <*> %% start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abcd"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; yylval = res; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:822" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:822" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:822: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:822" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:822: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:822" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:822: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:822" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:823: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:823" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:823" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:823: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:823" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:823" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:824: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:824" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<> destructor for 'd' @ 4. 'b'/'c' destructor for 'c' @ 3. 'b'/'c' destructor for 'b' @ 2. <> destructor for 'a' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:824" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:824: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:824" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token 'a' (1.1: <> printer for 'a' @ 1) Shifting token 'a' (1.1: <> printer for 'a' @ 1) Entering state 1 Reading a token: Next token is token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) Shifting token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) Entering state 3 Reading a token: Next token is token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) Shifting token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) Entering state 5 Reading a token: Next token is token 'd' (1.4: <> printer for 'd' @ 4) Shifting token 'd' (1.4: <> printer for 'd' @ 4) Entering state 6 Reading a token: Now at end of input. 1.5: syntax error, unexpected \$end, expecting 'e' Error: popping token 'd' (1.4: <> printer for 'd' @ 4) Stack now 0 1 3 5 Error: popping token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) Stack now 0 1 3 Error: popping token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) Stack now 0 1 Error: popping token 'a' (1.1: <> printer for 'a' @ 1) Stack now 0 Cleanup: discarding lookahead token \$end (1.5: ) Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:824" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_165 #AT_START_166 at_fn_group_banner 166 'actions.at:867' \ "Default tagged and per-type %printer and %destructor" "" 9 at_xfail=no ( $as_echo "166. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) %} %printer { fprintf (yyoutput, "<> printer should not be called.\n"); } <> %union { int field0; int field1; int field2; } %type start 'a' 'g' %type 'e' %type 'f' %printer { fprintf (yyoutput, "<*>//e printer"); } <*> 'e' %destructor { fprintf (stdout, "<*>//e destructor.\n"); } <*> 'e' %type 'b' %printer { fprintf (yyoutput, " printer"); } %destructor { fprintf (stdout, " destructor.\n"); } %type 'c' %printer { fprintf (yyoutput, "'c' printer"); } 'c' %destructor { fprintf (stdout, "'c' destructor.\n"); } 'c' %type 'd' %printer { fprintf (yyoutput, "'d' printer"); } 'd' %destructor { fprintf (stdout, "'d' destructor.\n"); } 'd' %destructor { fprintf (yyoutput, "<> destructor should not be called.\n"); } <> %% start: 'a' 'b' 'c' 'd' 'e' 'f' 'g' { USE(($1, $2, $3, $4, $5, $6, $7)); $$ = 'S'; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abcdef"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:934: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:934" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:934: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:934" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:934: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:934" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:934: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:934" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:934: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:934" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:935: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:935" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:935" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:935: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:935" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:935" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:936: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:936" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<*>//e destructor. <*>//e destructor. 'd' destructor. 'c' destructor. destructor. <*>//e destructor. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:936: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:936" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token 'a' (<*>//e printer) Shifting token 'a' (<*>//e printer) Entering state 1 Reading a token: Next token is token 'b' ( printer) Shifting token 'b' ( printer) Entering state 3 Reading a token: Next token is token 'c' ('c' printer) Shifting token 'c' ('c' printer) Entering state 5 Reading a token: Next token is token 'd' ('d' printer) Shifting token 'd' ('d' printer) Entering state 6 Reading a token: Next token is token 'e' (<*>//e printer) Shifting token 'e' (<*>//e printer) Entering state 7 Reading a token: Next token is token 'f' (<*>//e printer) Shifting token 'f' (<*>//e printer) Entering state 8 Reading a token: Now at end of input. syntax error, unexpected \$end, expecting 'g' Error: popping token 'f' (<*>//e printer) Stack now 0 1 3 5 6 7 Error: popping token 'e' (<*>//e printer) Stack now 0 1 3 5 6 Error: popping token 'd' ('d' printer) Stack now 0 1 3 5 Error: popping token 'c' ('c' printer) Stack now 0 1 3 Error: popping token 'b' ( printer) Stack now 0 1 Error: popping token 'a' (<*>//e printer) Stack now 0 Cleanup: discarding lookahead token \$end () Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:936" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_166 #AT_START_167 at_fn_group_banner 167 'actions.at:991' \ "Default %printer and %destructor for user-defined end token" "" 9 at_xfail=no ( $as_echo "167. $at_setup_line: testing $at_desc ..." $at_traceon # _AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN(TYPED) # ------------------------------------------------------------- cat >input0.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %locations %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) %} %destructor { fprintf (yyoutput, "<*> destructor should not be called.\n"); } <*> %token END 0 %printer { fprintf (yyoutput, "<> for '%c' @ %d", $$, @$.first_column); } <> %destructor { fprintf (stdout, "<> for '%c' @ %d.\n", $$, @$.first_column); } <> %printer { fprintf (yyoutput, "<*> printer should not be called.\n"); } <*> %% start: { $$ = 'S'; } ; %% static int yylex (void) { static int called; if (called++) abort (); yylval = 'E'; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; return 0; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1087: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input0.c input0.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1087" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1087: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1087" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1087: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1087" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1087: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1087" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1087: bison -o input0.c input0.y" at_fn_check_prepare_trace "actions.at:1087" ( $at_check_trace; bison -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1087: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1087" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1087: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input0 input0.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS" "actions.at:1087" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1087: \$PREPARSER ./input0" at_fn_check_prepare_dynamic " $PREPARSER ./input0" "actions.at:1087" ( $at_check_trace; $PREPARSER ./input0 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<> for 'E' @ 1. <> for 'S' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1087: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1087" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 42): -> \$\$ = nterm start (1.1: <> for 'S' @ 1) Stack now 0 Entering state 1 Reading a token: Now at end of input. Shifting token END (1.1: <> for 'E' @ 1) Entering state 2 Stack now 0 1 2 Cleanup: popping token END (1.1: <> for 'E' @ 1) Cleanup: popping nterm start (1.1: <> for 'S' @ 1) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" $at_failed && at_fn_log_failure $at_traceon; } cat >input1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %locations %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) %} %destructor { fprintf (yyoutput, "<> destructor should not be called.\n"); } <> %token END 0 %printer { fprintf (yyoutput, "<*> for '%c' @ %d", $$, @$.first_column); } <*> %destructor { fprintf (stdout, "<*> for '%c' @ %d.\n", $$, @$.first_column); } <*> %printer { fprintf (yyoutput, "<> printer should not be called.\n"); } <> %union { char tag; } %type start END %% start: { $$ = 'S'; } ; %% static int yylex (void) { static int called; if (called++) abort (); yylval.tag = 'E'; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; return 0; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input1.c input1.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1088" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1088" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1088" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1088" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1088: bison -o input1.c input1.y" at_fn_check_prepare_trace "actions.at:1088" ( $at_check_trace; bison -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1088: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1088" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1088: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input1 input1.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS" "actions.at:1088" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1088: \$PREPARSER ./input1" at_fn_check_prepare_dynamic " $PREPARSER ./input1" "actions.at:1088" ( $at_check_trace; $PREPARSER ./input1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<*> for 'E' @ 1. <*> for 'S' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1088: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1088" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 42): -> \$\$ = nterm start (1.1: <*> for 'S' @ 1) Stack now 0 Entering state 1 Reading a token: Now at end of input. Shifting token END (1.1: <*> for 'E' @ 1) Entering state 2 Stack now 0 1 2 Cleanup: popping token END (1.1: <*> for 'E' @ 1) Cleanup: popping nterm start (1.1: <*> for 'S' @ 1) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_167 #AT_START_168 at_fn_group_banner 168 'actions.at:1098' \ "Default %printer and %destructor are not for error or \$undefined" "" 9 at_xfail=no ( $as_echo "168. $at_setup_line: testing $at_desc ..." $at_traceon # If Bison were to apply the default %printer and %destructor to the error # token or to $undefined: # - For the error token: # - It would generate warnings for unused $n. # - It would invoke the %printer and %destructor on the error token's # semantic value, which would be initialized from the lookahead, which # would be destroyed separately. # - For $undefined, who knows what the semantic value would be. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %debug %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) %} %printer { fprintf (yyoutput, "'%c'", $$); } <> <*> %destructor { fprintf (stderr, "DESTROY '%c'\n", $$); } <> <*> %% start: { $$ = 'S'; } /* In order to reveal the problems that this bug caused during parsing, add * $2 to USE. */ | 'a' error 'b' 'c' { USE(($1, $3, $4)); $$ = 'S'; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abd"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; yylval = res; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1148" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1148" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1148" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1148" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1148: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1148" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1149: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1149" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1149" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1149: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1149" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1149" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1150: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1150" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1150" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1150: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1150" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token 'a' ('a') Shifting token 'a' ('a') Entering state 1 Reading a token: Next token is token 'b' ('b') syntax error Shifting token error () Entering state 3 Next token is token 'b' ('b') Shifting token 'b' ('b') Entering state 5 Reading a token: Next token is token \$undefined () Error: popping token 'b' ('b') DESTROY 'b' Stack now 0 1 3 Error: popping token error () Stack now 0 1 Shifting token error () Entering state 3 Next token is token \$undefined () Error: discarding token \$undefined () Error: popping token error () Stack now 0 1 Shifting token error () Entering state 3 Reading a token: Now at end of input. Cleanup: discarding lookahead token \$end () Stack now 0 1 3 Cleanup: popping token error () Cleanup: popping token 'a' ('a') DESTROY 'a' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1150" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_168 #AT_START_169 at_fn_group_banner 169 'actions.at:1193' \ "Default %printer and %destructor are not for \$accept" "" 9 at_xfail=no ( $as_echo "169. $at_setup_line: testing $at_desc ..." $at_traceon # If YYSTYPE is a union and Bison were to apply the default %printer and # %destructor to $accept: # - The %printer and %destructor code generated for $accept would always be # dead code because $accept is currently never shifted onto the stack. # - $$ for $accept would always be of type YYSTYPE because it's not possible # to declare `%type $accept'. (Also true for $undefined.) # - Thus, the compiler might complain that the user code assumes the wrong # type for $$ since the code might assume the type associated with a # specific union field, which is especially reasonable in C++ since that # type may be a base type. This test case checks for this problem. (Also # true for $undefined and the error token, so there are three warnings for # %printer and three for %destructor.) cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %debug /* So that %printer is actually compiled. */ %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) %} %printer { char chr = $$; fprintf (yyoutput, "'%c'", chr); } <> <*> %destructor { char chr = $$; fprintf (stderr, "DESTROY '%c'\n", chr); } <> <*> %union { char chr; } %type start %% start: { USE($$); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1247" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1247" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1247" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1247" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1247: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1247" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1248: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1248" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1248" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1248: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1248" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1248" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_169 #AT_START_170 at_fn_group_banner 170 'actions.at:1258' \ "Default %printer and %destructor for mid-rule values" "" 9 at_xfail=no ( $as_echo "170. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %debug /* So that %printer is actually compiled. */ %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define USE(SYM) # define YYLTYPE int # define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs) # define YY_LOCATION_PRINT(File, Loc) %} %printer { fprintf (yyoutput, "%d", @$); } <> %destructor { fprintf (stderr, "DESTROY %d\n", @$); } <> %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*> %destructor { fprintf (yyoutput, "<*> destructor should not be called"); } <*> %% start: { @$ = 1; } // Not set or used. { USE ($$); @$ = 2; } // Both set and used. { USE ($$); @$ = 3; } // Only set. { @$ = 4; } // Only used. 'c' { USE (($$, $2, $4, $5)); @$ = 0; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1303: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1303" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$ input.y:32.3-23: warning: unused value: \$3 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:33.3-23: warning: unset value: $$ input.y:32.3-23: warning: unused value: $3 _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/actions.at:1303: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1308" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1308" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1308: bison -fcaret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1308" ( $at_check_trace; bison -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$ { @\$ = 4; } // Only used. ^^^^^^^^^^^^^^^^^^^^^ input.y:32.3-23: warning: unused value: \$3 { USE (\$\$); @\$ = 3; } // Only set. ^^^^^^^^^^^^^^^^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:33.3-23: warning: unset value: $$ { @$ = 4; } // Only used. ^^^^^^^^^^^^^^^^^^^^^ input.y:32.3-23: warning: unused value: $3 { USE ($$); @$ = 3; } // Only set. ^^^^^^^^^^^^^^^^^^^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/actions.at:1308: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "actions.at:1308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1317: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1317" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1317" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1317: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1317" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1317" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1318: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1318" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1318" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1318: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1318" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 30): -> \$\$ = nterm \$@1 (: ) Stack now 0 Entering state 2 Reducing stack by rule 2 (line 31): -> \$\$ = nterm @2 (: 2) Stack now 0 2 Entering state 4 Reducing stack by rule 3 (line 32): -> \$\$ = nterm @3 (: 3) Stack now 0 2 4 Entering state 5 Reducing stack by rule 4 (line 33): -> \$\$ = nterm @4 (: 4) Stack now 0 2 4 5 Entering state 6 Reading a token: Now at end of input. syntax error Error: popping nterm @4 (: 4) DESTROY 4 Stack now 0 2 4 5 Error: popping nterm @3 (: 3) DESTROY 3 Stack now 0 2 4 Error: popping nterm @2 (: 2) DESTROY 2 Stack now 0 2 Error: popping nterm \$@1 (: ) Stack now 0 Cleanup: discarding lookahead token \$end (: ) Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1318" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_170 #AT_START_171 at_fn_group_banner 171 'actions.at:1406' \ "@\$ in %initial-action implies %locations" " " 9 at_xfail=no ( $as_echo "171. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %debug %initial-action { fprintf (stderr, "%d\n", @$.first_line); } %% start: ; %% static int yylex (void) { return 0; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1406" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1406" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1406" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1406" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1406: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1406" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1406: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1406" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1406: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1406" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_171 #AT_START_172 at_fn_group_banner 172 'actions.at:1407' \ "@\$ in %destructor implies %locations" " " 9 at_xfail=no ( $as_echo "172. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %debug %destructor { fprintf (stderr, "%d\n", @$.first_line); } start %% start: ; %% static int yylex (void) { return 0; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1407" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1407" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1407" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1407" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1407: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1407" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1407: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1407" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1407: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1407" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_172 #AT_START_173 at_fn_group_banner 173 'actions.at:1408' \ "@\$ in %printer implies %locations" " " 9 at_xfail=no ( $as_echo "173. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %debug %printer { fprintf (stderr, "%d\n", @$.first_line); } start %% start: ; %% static int yylex (void) { return 0; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1408" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1408" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1408" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1408" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1408: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1408" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1408: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1408" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1408" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_173 #AT_START_174 at_fn_group_banner 174 'actions.at:1529' \ "Qualified \$\$ in actions: yacc.c" " " 9 at_xfail=no ( $as_echo "174. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "yacc.c" %defines // FIXME: Mandated by lalr1.cc in Bison 2.6. %locations // FIXME: Mandated by lalr1.cc in Bison 2.6. %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include static void report (FILE* yyo, int ival, float fval) { fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); } } %code { static void yyerror ( const char *msg); static int yylex (void); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = {UNTYPED, INT, EOF}; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1529: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1529" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1529: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1529" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1529: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1529" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1529: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1529" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1529: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1529" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. # # Don't care about locations. FIXME: remove their removal when Bison # supports C++ without locations. { set +x $as_echo "$at_srcdir/actions.at:1529: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1529" ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_174 #AT_START_175 at_fn_group_banner 175 'actions.at:1530' \ "Qualified \$\$ in actions: glr.c" " " 9 at_xfail=no ( $as_echo "175. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "glr.c" %defines // FIXME: Mandated by lalr1.cc in Bison 2.6. %locations // FIXME: Mandated by lalr1.cc in Bison 2.6. %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include static void report (FILE* yyo, int ival, float fval) { fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); } } %code { static void yyerror ( const char *msg); static int yylex (void); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = {UNTYPED, INT, EOF}; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1530" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1530" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1530" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1530" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1530: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1530" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1530: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1530" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1530: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1530" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1530: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1530" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1530: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1530" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. # # Don't care about locations. FIXME: remove their removal when Bison # supports C++ without locations. { set +x $as_echo "$at_srcdir/actions.at:1530: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1530" ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_175 #AT_START_176 at_fn_group_banner 176 'actions.at:1531' \ "Qualified \$\$ in actions: lalr1.cc" " " 9 at_xfail=no ( $as_echo "176. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %defines // FIXME: Mandated by lalr1.cc in Bison 2.6. %locations // FIXME: Mandated by lalr1.cc in Bison 2.6. %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include static void report (std::ostream& yyo, int ival, float fval) { yyo << "ival: " << ival << ", fval: " << fval; } } %code { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF}; static size_t toknum = 0; int res; (void) lvalp;(void) llocp; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int main (void) { yy::parser p; p.set_debug_level(1); return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1531: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1531" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1531: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1531" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1531: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1531" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1531: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1531" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1531: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1531" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. # # Don't care about locations. FIXME: remove their removal when Bison # supports C++ without locations. { set +x $as_echo "$at_srcdir/actions.at:1531: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1531" ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_176 #AT_START_177 at_fn_group_banner 177 'actions.at:1532' \ "Qualified \$\$ in actions: glr.cc" " " 9 at_xfail=no ( $as_echo "177. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "glr.cc" %defines // FIXME: Mandated by lalr1.cc in Bison 2.6. %locations // FIXME: Mandated by lalr1.cc in Bison 2.6. %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include static void report (std::ostream& yyo, int ival, float fval) { yyo << "ival: " << ival << ", fval: " << fval; } } %code { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF}; static size_t toknum = 0; int res; (void) lvalp;(void) llocp; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int main (void) { yy::parser p; p.set_debug_level(1); return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1532" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1532" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1532" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1532" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1532: bison -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1532" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1532: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1532" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1532: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1532" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1532: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1532" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1532" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. # # Don't care about locations. FIXME: remove their removal when Bison # supports C++ without locations. { set +x $as_echo "$at_srcdir/actions.at:1532: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1532" ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_177 #AT_START_178 at_fn_group_banner 178 'actions.at:1540' \ "Fix user actions without a trailing semicolon" " " 9 at_xfail=no ( $as_echo "178. $at_setup_line: testing $at_desc ..." $at_traceon # This feature is undocumented, but we accidentally broke it in 2.3a, # and there was a complaint at: # . cat >input.y <<'_ATEOF' %% start: test2 test1 test0 testc; test2 : 'a' { semi; /* TEST:N:2 */ } | 'b' { if (0) {no_semi} /* TEST:N:2 */ } | 'c' { if (0) {semi;} /* TEST:N:2 */ } | 'd' { semi; no_semi /* TEST:Y:2 */ } | 'e' { semi(); no_semi() /* TEST:Y:2 */ } | 'f' { semi[]; no_semi[] /* TEST:Y:2 */ } | 'g' { semi++; no_semi++ /* TEST:Y:2 */ } | 'h' { {no_semi} no_semi /* TEST:Y:2 */ } | 'i' { {semi;} no_semi /* TEST:Y:2 */ } ; test1 : 'a' { semi; // TEST:N:1 ; } | 'b' { if (0) {no_semi} // TEST:N:1 ; } | 'c' { if (0) {semi;} // TEST:N:1 ; } | 'd' { semi; no_semi // TEST:Y:1 ; } | 'e' { semi(); no_semi() // TEST:Y:1 ; } | 'f' { semi[]; no_semi[] // TEST:Y:1 ; } | 'g' { semi++; no_semi++ // TEST:Y:1 ; } | 'h' { {no_semi} no_semi // TEST:Y:1 ; } | 'i' { {semi;} no_semi // TEST:Y:1 ; } ; test0 : 'a' { semi; // TEST:N:1 {} } | 'b' { if (0) {no_semi} // TEST:N:1 {} } | 'c' { if (0) {semi;} // TEST:N:1 {} } | 'd' { semi; no_semi // TEST:Y:1 {} } | 'e' { semi(); no_semi() // TEST:Y:1 {} } | 'f' { semi[]; no_semi[] // TEST:Y:1 {} } | 'g' { semi++; no_semi++ // TEST:Y:1 {} } | 'h' { {no_semi} no_semi // TEST:Y:1 {} } | 'i' { {semi;} no_semi // TEST:Y:1 {} } ; testc : 'a' { #define TEST_MACRO_N \ []"broken\" $ @ $$ @$ [];\ string;"} | 'b' { no_semi #define TEST_MACRO_N \ []"broken\" $ @ $$ @$ [];\ string;"} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1597" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1597" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1597: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1597" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:8.48: warning: a ';' might be needed at the end of action code input.y:8.48: future versions of Bison will not add the ';' input.y:9.48: warning: a ';' might be needed at the end of action code input.y:9.48: future versions of Bison will not add the ';' input.y:10.48: warning: a ';' might be needed at the end of action code input.y:10.48: future versions of Bison will not add the ';' input.y:11.48: warning: a ';' might be needed at the end of action code input.y:11.48: future versions of Bison will not add the ';' input.y:12.48: warning: a ';' might be needed at the end of action code input.y:12.48: future versions of Bison will not add the ';' input.y:13.48: warning: a ';' might be needed at the end of action code input.y:13.48: future versions of Bison will not add the ';' input.y:20.1: warning: a ';' might be needed at the end of action code input.y:20.1: future versions of Bison will not add the ';' input.y:21.1: warning: a ';' might be needed at the end of action code input.y:21.1: future versions of Bison will not add the ';' input.y:22.1: warning: a ';' might be needed at the end of action code input.y:22.1: future versions of Bison will not add the ';' input.y:23.1: warning: a ';' might be needed at the end of action code input.y:23.1: future versions of Bison will not add the ';' input.y:24.1: warning: a ';' might be needed at the end of action code input.y:24.1: future versions of Bison will not add the ';' input.y:25.1: warning: a ';' might be needed at the end of action code input.y:25.1: future versions of Bison will not add the ';' input.y:31.1: warning: a ';' might be needed at the end of action code input.y:31.1: future versions of Bison will not add the ';' input.y:32.1: warning: a ';' might be needed at the end of action code input.y:32.1: future versions of Bison will not add the ';' input.y:33.1: warning: a ';' might be needed at the end of action code input.y:33.1: future versions of Bison will not add the ';' input.y:34.1: warning: a ';' might be needed at the end of action code input.y:34.1: future versions of Bison will not add the ';' input.y:35.1: warning: a ';' might be needed at the end of action code input.y:35.1: future versions of Bison will not add the ';' input.y:36.1: warning: a ';' might be needed at the end of action code input.y:36.1: future versions of Bison will not add the ';' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:8.48: warning: a ';' might be needed at the end of action code input.y:8.48: future versions of Bison will not add the ';' input.y:9.48: warning: a ';' might be needed at the end of action code input.y:9.48: future versions of Bison will not add the ';' input.y:10.48: warning: a ';' might be needed at the end of action code input.y:10.48: future versions of Bison will not add the ';' input.y:11.48: warning: a ';' might be needed at the end of action code input.y:11.48: future versions of Bison will not add the ';' input.y:12.48: warning: a ';' might be needed at the end of action code input.y:12.48: future versions of Bison will not add the ';' input.y:13.48: warning: a ';' might be needed at the end of action code input.y:13.48: future versions of Bison will not add the ';' input.y:20.1: warning: a ';' might be needed at the end of action code input.y:20.1: future versions of Bison will not add the ';' input.y:21.1: warning: a ';' might be needed at the end of action code input.y:21.1: future versions of Bison will not add the ';' input.y:22.1: warning: a ';' might be needed at the end of action code input.y:22.1: future versions of Bison will not add the ';' input.y:23.1: warning: a ';' might be needed at the end of action code input.y:23.1: future versions of Bison will not add the ';' input.y:24.1: warning: a ';' might be needed at the end of action code input.y:24.1: future versions of Bison will not add the ';' input.y:25.1: warning: a ';' might be needed at the end of action code input.y:25.1: future versions of Bison will not add the ';' input.y:31.1: warning: a ';' might be needed at the end of action code input.y:31.1: future versions of Bison will not add the ';' input.y:32.1: warning: a ';' might be needed at the end of action code input.y:32.1: future versions of Bison will not add the ';' input.y:33.1: warning: a ';' might be needed at the end of action code input.y:33.1: future versions of Bison will not add the ';' input.y:34.1: warning: a ';' might be needed at the end of action code input.y:34.1: future versions of Bison will not add the ';' input.y:35.1: warning: a ';' might be needed at the end of action code input.y:35.1: future versions of Bison will not add the ';' input.y:36.1: warning: a ';' might be needed at the end of action code input.y:36.1: future versions of Bison will not add the ';' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/actions.at:1597: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1597" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1636: \$PERL -0777 -ne ' my \$count = 0; s{/\\* TEST:N:2 \\*/ \\}\$}{ ++\$count; \"\" }gem; printf \"\$count\\n\";' input.c" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1636" ( $at_check_trace; $PERL -0777 -ne ' my $count = 0; s{/\* TEST:N:2 \*/ \}$}{ ++$count; "" }gem; printf "$count\n";' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1636" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1637: \$PERL -0777 -ne ' my \$count = 0; s{/\\* TEST:Y:2 \\*/ ;\\}\$}{ ++\$count; \"\" }gem; printf \"\$count\\n\";' input.c" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1637" ( $at_check_trace; $PERL -0777 -ne ' my $count = 0; s{/\* TEST:Y:2 \*/ ;\}$}{ ++$count; "" }gem; printf "$count\n";' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "6 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1637" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1638: \$PERL -0777 -ne ' my \$count = 0; s{// TEST:N:1 [;{}]*\\n\\}\$}{ ++\$count; \"\" }gem; printf \"\$count\\n\";' input.c" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1638" ( $at_check_trace; $PERL -0777 -ne ' my $count = 0; s{// TEST:N:1 [;{}]*\n\}$}{ ++$count; "" }gem; printf "$count\n";' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "6 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1639: \$PERL -0777 -ne ' my \$count = 0; s{// TEST:Y:1 [;{}]*\\n;\\}\$}{ ++\$count; \"\" }gem; printf \"\$count\\n\";' input.c" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1639" ( $at_check_trace; $PERL -0777 -ne ' my $count = 0; s{// TEST:Y:1 [;{}]*\n;\}$}{ ++$count; "" }gem; printf "$count\n";' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "12 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1639" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1640: \$PERL -0777 -ne ' my \$count = 0; s{#define TEST_MACRO_N \\\\\\n\\[\\]\"broken\\\\\" \\\$ \\@ \\\$\\\$ \\@\\\$ \\[\\];\\\\\\nstring;\"\\}}{ ++\$count; \"\" }gem; printf \"\$count\\n\";' input.c" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1640" ( $at_check_trace; $PERL -0777 -ne ' my $count = 0; s{#define TEST_MACRO_N \\\n\[\]"broken\\" \$ \@ \$\$ \@\$ \[\];\\\nstring;"\}}{ ++$count; "" }gem; printf "$count\n";' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1640" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_178 #AT_START_179 at_fn_group_banner 179 'actions.at:1649' \ "Destroying lookahead assigned by semantic action" "" 9 at_xfail=no ( $as_echo "179. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); static int yylex (void); #define USE(Var) } %destructor { fprintf (stderr, "'a' destructor\n"); } 'a' %destructor { fprintf (stderr, "'b' destructor\n"); } 'b' %% // In a previous version of Bison, yychar assigned by the semantic // action below was not translated into yytoken before the lookahead was // discarded and thus before its destructor (selected according to // yytoken) was called in order to return from yyparse. This would // happen even if YYACCEPT was performed in a later semantic action as // long as only consistent states with default reductions were visited // in between. However, we leave YYACCEPT in the same semantic action // for this test in order to show that skeletons cannot simply translate // immediately after every semantic action because a semantic action // that has set yychar might not always return normally. Instead, // skeletons must translate before every use of yytoken. start: 'a' accept { USE($1); } ; accept: /*empty*/ { assert (yychar == YYEMPTY); yychar = 'b'; YYACCEPT; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1695" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1695" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1695" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1695" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1695: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1695" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1696: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1696" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1696" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1696: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1696" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1696" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1697: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1697" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1697: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1697" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "'b' destructor 'a' destructor " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1697" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_179 #AT_START_180 at_fn_group_banner 180 'actions.at:1708' \ "YYBACKUP" " " 9 at_xfail=no ( $as_echo "180. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %pure-parser %code { # include # include # include static void yyerror ( const char *msg); static int yylex (YYSTYPE *lvalp); } %% input: exp exp {} ; exp: 'a' { printf ("a: %d\n", $1); } | 'b' { YYBACKUP('a', 123); } | 'c' 'd' { YYBACKUP('a', 456); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "bcd"; static size_t toknum = 0; int res; (void) lvalp;; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; *lvalp = (toknum + 1) * 10; return res; } int main (void) { yydebug = !!getenv("YYDEBUG"); return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1749" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1749" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1749" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1749" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1749: bison -o input.c input.y" at_fn_check_prepare_trace "actions.at:1749" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1750: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1750" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1750: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1750" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1751: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1751" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "a: 123 a: 456 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1751" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1751" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1751" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_180 #AT_START_181 at_fn_group_banner 181 'conflicts.at:31' \ "S/R in initial" " " 10 at_xfail=no ( $as_echo "181. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %expect 1 %% exp: e 'e'; e: 'e' | /* Nothing. */; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:40: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:40" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/conflicts.at:40: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "conflicts.at:40" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:44" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:44" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:44: bison -fcaret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:44" ( $at_check_trace; bison -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts e: 'e' | /* Nothing. */; ^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:4.9: warning: rule useless in parser due to conflicts e: 'e' | /* Nothing. */; ^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/conflicts.at:44: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "conflicts.at:44" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_181 #AT_START_182 at_fn_group_banner 182 'conflicts.at:57' \ "%nonassoc and eof" " " 10 at_xfail=no ( $as_echo "182. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #define YYERROR_VERBOSE 1 #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /* The current argument. */ static const char *input; static int yylex (void) { static size_t toknum; assert (toknum <= strlen (input)); return input[toknum++]; } %} %nonassoc '<' '>' %% expr: expr '<' expr | expr '>' expr | '0' ; %% int main (int argc, const char *argv[]) { input = argc <= 1 ? "" : argv[1]; return yyparse (); } _ATEOF # Expected token list is missing. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:123" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:123" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:123" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:123" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:123: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:123" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:123" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:123" ( $at_check_trace; $PREPARSER ./input '0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:123" ( $at_check_trace; $PREPARSER ./input '0<0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:123" ( $at_check_trace; $PREPARSER ./input '0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:123" ( $at_check_trace; $PREPARSER ./input '0>0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:123" ( $at_check_trace; $PREPARSER ./input '0<0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:123" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" $at_failed && at_fn_log_failure $at_traceon; } # We must disable default reductions in inconsistent states in order to # have an explicit list of all expected tokens. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:127" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y" "conflicts.at:127" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:127" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:127" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:127: bison -Dlr.default-reductions=consistent -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; bison -Dlr.default-reductions=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:127" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:127" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:127" ( $at_check_trace; $PREPARSER ./input '0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:127" ( $at_check_trace; $PREPARSER ./input '0<0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:127" ( $at_check_trace; $PREPARSER ./input '0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:127" ( $at_check_trace; $PREPARSER ./input '0>0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:127" ( $at_check_trace; $PREPARSER ./input '0<0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:127" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" $at_failed && at_fn_log_failure $at_traceon; } # lr.default-reductions=consistent happens to work for this test case. # However, for other grammars, lookahead sets can be merged for # different left contexts, so it is still possible to have an incorrect # expected list. Canonical LR is almost a general solution (that is, it # can fail only when %nonassoc is used), so make sure it gives the same # result as above. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:136" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:136" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:136: bison -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:136" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:136" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:136" ( $at_check_trace; $PREPARSER ./input '0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:136" ( $at_check_trace; $PREPARSER ./input '0<0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:136" ( $at_check_trace; $PREPARSER ./input '0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:136" ( $at_check_trace; $PREPARSER ./input '0>0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:136" ( $at_check_trace; $PREPARSER ./input '0<0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:136" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" $at_failed && at_fn_log_failure $at_traceon; } # parse.lac=full is a completely general solution that does not require # any of the above sacrifices. Of course, it does not extend the # language-recognition power of LALR to (IE)LR, but it does ensure that # the reported list of expected tokens matches what the given parser # would have accepted in place of the unexpected token. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:143" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:143" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:143" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:143" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:143: bison -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; bison -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:143" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:143" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:143" ( $at_check_trace; $PREPARSER ./input '0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:143" ( $at_check_trace; $PREPARSER ./input '0<0<0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:143" ( $at_check_trace; $PREPARSER ./input '0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:143" ( $at_check_trace; $PREPARSER ./input '0>0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:143" ( $at_check_trace; $PREPARSER ./input '0<0>0' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_182 #AT_START_183 at_fn_group_banner 183 'conflicts.at:155' \ "%error-verbose and consistent errors" " " 10 at_xfail=no ( $as_echo "183. $at_setup_line: testing $at_desc ..." $at_traceon # Unfortunately, no expected tokens are reported even though 'b' can be # accepted. Nevertheless, the main point of this test is to make sure # that at least the unexpected token is reported. In a previous version # of Bison, it wasn't reported because the error is detected in a # consistent state with an error action, and that case always triggered # the simple "syntax error" message. # # The point isn't to test IELR here, but state merging happens to # complicate this example. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:299" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:299" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:299" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:299" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:299: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:299" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:299: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:299" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:299: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:299" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:299: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:299" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:299: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:299" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %glr-parser %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:303" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:303" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:303" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:303: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:303" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:303: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:303" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:303: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:303" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:303: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:303" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:303: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:303" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include int yylex (yy::parser::semantic_type *lvalp); #define USE(Var) } %defines %define lr.type ielr %language "c++" %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (yy::parser::semantic_type *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } /*-------. | main. | `-------*/ int main (void) { yy::parser parser; return parser.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:308" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:308" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:308" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:308: bison -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:308" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:308: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:308" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:308: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:308" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:308: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:308" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:308: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:308" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code imports { import java.io.IOException; } %define lr.type ielr %language "java" %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %code lexer { /*--------. | yylex. | `--------*/ public String input = "a"; public int index = 0; public int yylex () { if (index < input.length ()) return input.charAt (index++); else return 0; } public Object getLVal () { return new Integer(1); } public void yyerror (String s) { System.err.println (s); } }; %% /*-------. | main. | `-------*/ class input { public static void main (String args[]) throws IOException { YYParser p = new YYParser (); p.parse (); } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:313" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:313" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:313" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:313" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:313: bison -o input.java input.y" at_fn_check_prepare_trace "conflicts.at:313" ( $at_check_trace; bison -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:313" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313" $as_echo "conflicts.at:313" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313" { set +x $as_echo "$at_srcdir/conflicts.at:313: \$SHELL ../../../javacomp.sh input.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:313" ( $at_check_trace; $SHELL ../../../javacomp.sh input.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:313: \$SHELL ../../../javaexec.sh input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:313" ( $at_check_trace; $SHELL ../../../javaexec.sh input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected end of input " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313" $at_failed && at_fn_log_failure $at_traceon; } # Even canonical LR doesn't foresee the error for 'a'! cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %define lr.default-reductions consistent %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:320" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:320" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:320" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:320: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:320" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:320: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:320" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:320: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:320" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:320: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:320" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:320: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:320" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %define lr.default-reductions accepting %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:325" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:325" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:325" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:325" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:325: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:325" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:325: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:325" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:325: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:325" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:325: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:325" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:325: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:325" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type canonical-lr %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:330" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:330" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:330" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:330" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:330: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:330" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:330: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:330" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:330: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:330" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:330: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:330" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:330: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:330" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330" $at_failed && at_fn_log_failure $at_traceon; } # Only LAC gets it right. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type canonical-lr %define parse.lac full %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:336" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:336" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:336" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:336" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:336: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:336" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:336: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:336" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:336: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:336" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:336: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:336" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:336" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %define parse.lac full %error-verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: /*empty*/ ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "a"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:341" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:341" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:341" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:341" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:341: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:341" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:341: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:341" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:341: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:341" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:341: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:341" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:397" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:397" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:397" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:397" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:397: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:397" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:397: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:397" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:397: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:397" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:397: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:397" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:397" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %glr-parser %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:401" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:401" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:401" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:401" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:401: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:401" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:401: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:401" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:401: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:401" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:401: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:401" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:401" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include int yylex (yy::parser::semantic_type *lvalp); #define USE(Var) } %defines %language "c++" %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == yyempty_); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (yy::parser::semantic_type *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } /*-------. | main. | `-------*/ int main (void) { yy::parser parser; return parser.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:405" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:405" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:405" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:405" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:405: bison -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:405" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:405: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:405" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:405: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:405" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:405: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:405" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:405" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405" $at_failed && at_fn_log_failure $at_traceon; } # No Java test because yychar cannot be manipulated by users. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.default-reductions consistent %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:411" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:411" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:411" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:411" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:411: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:411" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:411: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:411" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:411: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:411" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:411: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:411" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:411" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR doesn't foresee the error for 'a'! cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.default-reductions accepting %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:417" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:417" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:417" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:417" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:417: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:417" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:417: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:417" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:417: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:417" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:417: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:417" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:417" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type canonical-lr %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:421" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:421" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:421" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:421: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:421" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:421: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:421" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:421: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:421" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:421: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:421" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:421: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:421" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define parse.lac full %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:426" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:426" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:426" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:426" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:426: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:426" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:426: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:426" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:426: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:426" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:426: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:426" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:426" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include #include static void yyerror ( const char *msg); int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define parse.lac full %define lr.default-reductions accepting %error-verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: /*empty*/ { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | /*empty*/ %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% /*--------. | yylex. | `--------*/ int yylex (YYSTYPE *lvalp) { static char const *input = "aa"; *lvalp = 1; return *input++; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:430" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:430" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:430" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:430" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:430: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:430" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:430: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:430" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:430: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:430" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:430: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:430" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:430: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:430" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_183 #AT_START_184 at_fn_group_banner 184 'conflicts.at:456' \ "LAC: %nonassoc requires splitting canonical LR states" "" 10 at_xfail=no ( $as_echo "184. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %error-verbose %nonassoc 'a' %% start: 'a' problem 'a' // First context. | 'b' problem 'b' // Second context. | 'c' reduce-nonassoc // Just makes reduce-nonassoc useful. ; problem: look reduce-nonassoc | look 'a' | look 'b' ; // For the state reached after shifting the 'a' in these productions, // lookahead sets are the same in both the first and second contexts. // Thus, canonical LR reuses the same state for both contexts. However, // the lookahead 'a' for the reduction "look: 'a'" later becomes an // error action only in the first context. In order to immediately // detect the syntax error on 'a' here for only the first context, this // canonical LR state would have to be split into two states, and the // 'a' lookahead would have to be removed from only one of the states. look: 'a' // Reduction lookahead set is always ['a', 'b']. | 'a' 'b' | 'a' 'c' // 'c' is forgotten as an expected token. ; reduce-nonassoc: %prec 'a'; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "aaa"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF # Show canonical LR's failure. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:511" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:511" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:511" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:511" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:511: bison -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:511" ( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:515: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:515" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:515: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:515" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:516: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:516" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:516" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:516" $at_failed && at_fn_log_failure $at_traceon; } # It's corrected by LAC. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:521: bison -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" ( $at_check_trace; bison -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:525: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:525" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:525" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:525: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:525" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:525" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:526: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:526" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:526" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } # IELR is sufficient when LAC is used. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:531: bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:531" ( $at_check_trace; bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:535: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:535" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:535: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:535" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:536: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:536" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:536" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:536" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_184 #AT_START_185 at_fn_group_banner 185 'conflicts.at:546' \ "Unresolved SR Conflicts" " " 10 at_xfail=no ( $as_echo "185. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %% exp: exp OP exp | NUM; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:556" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:556" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:556" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:556" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:556: bison -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:556" ( $at_check_trace; bison -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/conflicts.at:561: cat input.output" at_fn_check_prepare_trace "conflicts.at:561" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 5 conflicts: 1 shift/reduce Grammar 0 \$accept: exp \$end 1 exp: exp OP exp 2 | NUM Terminals, with rules where they appear \$end (0) 0 error (256) NUM (258) 2 OP (259) 1 Nonterminals, with rules where they appear \$accept (5) on left: 0 exp (6) on left: 1 2, on right: 0 1 State 0 0 \$accept: . exp \$end 1 exp: . exp OP exp 2 | . NUM NUM shift, and go to state 1 exp go to state 2 State 1 2 exp: NUM . \$default reduce using rule 2 (exp) State 2 0 \$accept: exp . \$end 1 exp: exp . OP exp \$end shift, and go to state 3 OP shift, and go to state 4 State 3 0 \$accept: exp \$end . \$default accept State 4 1 exp: . exp OP exp 1 | exp OP . exp 2 | . NUM NUM shift, and go to state 1 exp go to state 5 State 5 1 exp: exp . OP exp 1 | exp OP exp . [\$end, OP] OP shift, and go to state 4 OP [reduce using rule 1 (exp)] \$default reduce using rule 1 (exp) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:561" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_185 #AT_START_186 at_fn_group_banner 186 'conflicts.at:653' \ "Resolved SR Conflicts" " " 10 at_xfail=no ( $as_echo "186. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %left OP %% exp: exp OP exp | NUM; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:664" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:664" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:664" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:664" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:664: bison -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:664" ( $at_check_trace; bison -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/conflicts.at:667: cat input.output" at_fn_check_prepare_trace "conflicts.at:667" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Grammar 0 \$accept: exp \$end 1 exp: exp OP exp 2 | NUM Terminals, with rules where they appear \$end (0) 0 error (256) NUM (258) 2 OP (259) 1 Nonterminals, with rules where they appear \$accept (5) on left: 0 exp (6) on left: 1 2, on right: 0 1 State 0 0 \$accept: . exp \$end 1 exp: . exp OP exp 2 | . NUM NUM shift, and go to state 1 exp go to state 2 State 1 2 exp: NUM . \$default reduce using rule 2 (exp) State 2 0 \$accept: exp . \$end 1 exp: exp . OP exp \$end shift, and go to state 3 OP shift, and go to state 4 State 3 0 \$accept: exp \$end . \$default accept State 4 1 exp: . exp OP exp 1 | exp OP . exp 2 | . NUM NUM shift, and go to state 1 exp go to state 5 State 5 1 exp: exp . OP exp 1 | exp OP exp . [\$end, OP] \$default reduce using rule 1 (exp) Conflict between rule 1 and token OP resolved as reduce (%left OP). " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:667" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_186 #AT_START_187 at_fn_group_banner 187 'conflicts.at:775' \ "Defaulted Conflicted Reduction" " " 10 at_xfail=no ( $as_echo "187. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: num | id; num: '0'; id : '0'; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:786" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:786" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:786: bison -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:786" ( $at_check_trace; bison -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror" "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: conflicts: 1 reduce/reduce input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0' _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/conflicts.at:786: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:786" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error" "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror" "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror" "conflicts.at:786" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # Check the contents of the report. { set +x $as_echo "$at_srcdir/conflicts.at:792: cat input.output" at_fn_check_prepare_trace "conflicts.at:792" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts 4 id: '0' State 1 conflicts: 1 reduce/reduce Grammar 0 \$accept: exp \$end 1 exp: num 2 | id 3 num: '0' 4 id: '0' Terminals, with rules where they appear \$end (0) 0 '0' (48) 3 4 error (256) Nonterminals, with rules where they appear \$accept (4) on left: 0 exp (5) on left: 1 2, on right: 0 num (6) on left: 3, on right: 1 id (7) on left: 4, on right: 2 State 0 0 \$accept: . exp \$end 1 exp: . num 2 | . id 3 num: . '0' 4 id: . '0' '0' shift, and go to state 1 exp go to state 2 num go to state 3 id go to state 4 State 1 3 num: '0' . [\$end] 4 id: '0' . [\$end] \$end reduce using rule 3 (num) \$end [reduce using rule 4 (id)] \$default reduce using rule 3 (num) State 2 0 \$accept: exp . \$end \$end shift, and go to state 5 State 3 1 exp: num . \$default reduce using rule 1 (exp) State 4 2 exp: id . \$default reduce using rule 2 (exp) State 5 0 \$accept: exp \$end . \$default accept " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:792" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_187 #AT_START_188 at_fn_group_banner 188 'conflicts.at:894' \ "%expect not enough" " " 10 at_xfail=no ( $as_echo "188. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 0 %% exp: exp OP exp | NUM; _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:903: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:903" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce input.y: error: expected 0 shift/reduce conflicts " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:903" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_188 #AT_START_189 at_fn_group_banner 189 'conflicts.at:914' \ "%expect right" " " 10 at_xfail=no ( $as_echo "189. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 1 %% exp: exp OP exp | NUM; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:923" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:923" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:923" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:923" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:923: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:923" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_189 #AT_START_190 at_fn_group_banner 190 'conflicts.at:931' \ "%expect too much" " " 10 at_xfail=no ( $as_echo "190. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 2 %% exp: exp OP exp | NUM; _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:940: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:940" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce input.y: error: expected 2 shift/reduce conflicts " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:940" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_190 #AT_START_191 at_fn_group_banner 191 'conflicts.at:951' \ "%expect with reduce conflicts" " " 10 at_xfail=no ( $as_echo "191. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %expect 0 %% program: a 'a' | a a; a: 'a'; _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:960" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce input.y: error: expected 0 reduce/reduce conflicts " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:960" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_191 #AT_START_192 at_fn_group_banner 192 'conflicts.at:971' \ "%prec with user string" " " 10 at_xfail=no ( $as_echo "192. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: "foo" %prec "foo" ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:980" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:980" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:980: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:980" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:980: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:980" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:980: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:980" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_192 #AT_START_193 at_fn_group_banner 193 'conflicts.at:988' \ "%no-default-prec without %prec" " " 10 at_xfail=no ( $as_echo "193. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %left '+' %left '*' %% %no-default-prec; e: e '+' e | e '*' e | '0' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1004" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1004" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1004" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1004" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1004: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1004" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 4 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_193 #AT_START_194 at_fn_group_banner 194 'conflicts.at:1014' \ "%no-default-prec with %prec" " " 10 at_xfail=no ( $as_echo "194. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %left '+' %left '*' %% %no-default-prec; e: e '+' e %prec '+' | e '*' e %prec '*' | '0' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1030" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1030" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1030" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1030" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1030: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1030" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_194 #AT_START_195 at_fn_group_banner 195 'conflicts.at:1038' \ "%default-prec" " " 10 at_xfail=no ( $as_echo "195. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %left '+' %left '*' %% %default-prec; e: e '+' e | e '*' e | '0' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1054" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1054" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1054: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1054" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1054: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1054" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1054: bison -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1054" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_195 #AT_START_196 at_fn_group_banner 196 'conflicts.at:1062' \ "Unreachable States After Conflict Resolution" " " 10 at_xfail=no ( $as_echo "196. $at_setup_line: testing $at_desc ..." $at_traceon # If conflict resolution makes states unreachable, remove those states, report # rules that are then unused, and don't report conflicts in those states. Test # what happens when a nonterminal becomes useless as a result of state removal # since that causes lalr.o's goto map to be rewritten. cat >input.y <<'_ATEOF' %output "input.c" %left 'a' %% start: resolved_conflict 'a' reported_conflicts 'a' ; /* S/R conflict resolved as reduce, so the state with item * (resolved_conflict: 'a' . unreachable1) and all it transition successors are * unreachable, and the associated production is useless. */ resolved_conflict: 'a' unreachable1 | %prec 'a' ; /* S/R conflict that need not be reported since it is unreachable because of * the previous conflict resolution. Nonterminal unreachable1 and all its * productions are useless. */ unreachable1: 'a' unreachable2 | ; /* Likewise for a R/R conflict and nonterminal unreachable2. */ unreachable2: | ; /* Make sure remaining S/R and R/R conflicts are still reported correctly even * when their states are renumbered due to state removal. */ reported_conflicts: 'a' | 'a' | ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1106" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1106" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1106: bison --report=all input.y" at_fn_check_prepare_trace "conflicts.at:1106" ( $at_check_trace; bison --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce, 1 reduce/reduce input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */ input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a' input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror" "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y: conflicts: 1 shift/reduce, 1 reduce/reduce input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */ input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a' input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/conflicts.at:1106: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1106" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error" "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror" "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror" "conflicts.at:1106" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1117: cat input.output" at_fn_check_prepare_trace "conflicts.at:1117" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts 2 resolved_conflict: 'a' unreachable1 4 unreachable1: 'a' unreachable2 5 | /* empty */ 6 unreachable2: /* empty */ 7 | /* empty */ 9 reported_conflicts: 'a' 10 | /* empty */ State 4 conflicts: 1 shift/reduce State 5 conflicts: 1 reduce/reduce Grammar 0 \$accept: start \$end 1 start: resolved_conflict 'a' reported_conflicts 'a' 2 resolved_conflict: 'a' unreachable1 3 | /* empty */ 4 unreachable1: 'a' unreachable2 5 | /* empty */ 6 unreachable2: /* empty */ 7 | /* empty */ 8 reported_conflicts: 'a' 9 | 'a' 10 | /* empty */ Terminals, with rules where they appear \$end (0) 0 'a' (97) 1 2 4 8 9 error (256) Nonterminals, with rules where they appear \$accept (4) on left: 0 start (5) on left: 1, on right: 0 resolved_conflict (6) on left: 2 3, on right: 1 unreachable1 (7) on left: 4 5, on right: 2 unreachable2 (8) on left: 6 7, on right: 4 reported_conflicts (9) on left: 8 9 10, on right: 1 State 0 0 \$accept: . start \$end 1 start: . resolved_conflict 'a' reported_conflicts 'a' 2 resolved_conflict: . 'a' unreachable1 3 | . ['a'] \$default reduce using rule 3 (resolved_conflict) start go to state 1 resolved_conflict go to state 2 Conflict between rule 3 and token 'a' resolved as reduce (%left 'a'). State 1 0 \$accept: start . \$end \$end shift, and go to state 3 State 2 1 start: resolved_conflict . 'a' reported_conflicts 'a' 'a' shift, and go to state 4 State 3 0 \$accept: start \$end . \$default accept State 4 1 start: resolved_conflict 'a' . reported_conflicts 'a' 8 reported_conflicts: . 'a' 9 | . 'a' 10 | . ['a'] 'a' shift, and go to state 5 'a' [reduce using rule 10 (reported_conflicts)] reported_conflicts go to state 6 State 5 8 reported_conflicts: 'a' . ['a'] 9 | 'a' . ['a'] 'a' reduce using rule 8 (reported_conflicts) 'a' [reduce using rule 9 (reported_conflicts)] \$default reduce using rule 8 (reported_conflicts) State 6 1 start: resolved_conflict 'a' reported_conflicts . 'a' 'a' shift, and go to state 7 State 7 1 start: resolved_conflict 'a' reported_conflicts 'a' . \$default reduce using rule 1 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1117" $at_failed && at_fn_log_failure $at_traceon; } cat >input-keep.y <<'_ATEOF' %define lr.keep-unreachable-states _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1256: cat input.y >> input-keep.y" at_fn_check_prepare_trace "conflicts.at:1256" ( $at_check_trace; cat input.y >> input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1256" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot input-keep.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1258" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1258" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1258: bison input-keep.y" at_fn_check_prepare_trace "conflicts.at:1258" ( $at_check_trace; bison input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */ input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a' input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror" "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */ input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */ input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a' input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/conflicts.at:1258: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1258" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error" "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror" "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror" "conflicts.at:1258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_196 #AT_START_197 at_fn_group_banner 197 'conflicts.at:1273' \ "Solved conflicts report for multiple reductions in a state" "" 10 at_xfail=no ( $as_echo "197. $at_setup_line: testing $at_desc ..." $at_traceon # Used to lose earlier solved conflict messages even within a single S/R/R. cat >input.y <<'_ATEOF' %left 'a' %right 'b' %right 'c' %right 'd' %% start: 'a' | empty_a 'a' | 'b' | empty_b 'b' | 'c' | empty_c1 'c' | empty_c2 'c' | empty_c3 'c' ; empty_a: %prec 'a' ; empty_b: %prec 'b' ; empty_c1: %prec 'c' ; empty_c2: %prec 'c' ; empty_c3: %prec 'd' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1299" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1299" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1299" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1299" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1299: bison --report=all -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1299" ( $at_check_trace; bison --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1300: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1300" ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . 'a' 2 | . empty_a 'a' 3 | . 'b' 4 | . empty_b 'b' 5 | . 'c' 6 | . empty_c1 'c' 7 | . empty_c2 'c' 8 | . empty_c3 'c' 9 empty_a: . ['a'] 10 empty_b: . [] 11 empty_c1: . [] 12 empty_c2: . [] 13 empty_c3: . ['c'] 'b' shift, and go to state 1 'c' reduce using rule 13 (empty_c3) \$default reduce using rule 9 (empty_a) start go to state 2 empty_a go to state 3 empty_b go to state 4 empty_c1 go to state 5 empty_c2 go to state 6 empty_c3 go to state 7 Conflict between rule 9 and token 'a' resolved as reduce (%left 'a'). Conflict between rule 10 and token 'b' resolved as shift (%right 'b'). Conflict between rule 11 and token 'c' resolved as shift (%right 'c'). Conflict between rule 12 and token 'c' resolved as shift (%right 'c'). Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd'). State 1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1300" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_197 #AT_START_198 at_fn_group_banner 198 'conflicts.at:1353' \ "%nonassoc error actions for multiple reductions in a state" "" 10 at_xfail=no ( $as_echo "198. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %nonassoc 'a' 'b' 'c' %% start: 'a' | empty_a 'a' | 'b' | empty_b 'b' | 'c' | empty_c1 'c' | empty_c2 'c' | empty_c3 'c' ; empty_a: %prec 'a' ; empty_b: %prec 'b' ; empty_c1: %prec 'c' ; empty_c2: %prec 'c' ; empty_c3: %prec 'c' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1375" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1375" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1375" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1375" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1375: bison --report=all -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1375" ( $at_check_trace; bison --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1376: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1376" ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . 'a' 2 | . empty_a 'a' 3 | . 'b' 4 | . empty_b 'b' 5 | . 'c' 6 | . empty_c1 'c' 7 | . empty_c2 'c' 8 | . empty_c3 'c' 9 empty_a: . [] 10 empty_b: . [] 11 empty_c1: . [] 12 empty_c2: . ['c'] 13 empty_c3: . ['c'] 'a' error (nonassociative) 'b' error (nonassociative) 'c' error (nonassociative) 'c' [reduce using rule 12 (empty_c2)] 'c' [reduce using rule 13 (empty_c3)] start go to state 1 empty_a go to state 2 empty_b go to state 3 empty_c1 go to state 4 empty_c2 go to state 5 empty_c3 go to state 6 Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a'). Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b'). Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c'). State 1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1376" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_198 #AT_START_199 at_fn_group_banner 199 'conflicts.at:1422' \ "-W versus %expect and %expect-rr" " " 10 at_xfail=no ( $as_echo "199. $at_setup_line: testing $at_desc ..." $at_traceon cat >sr-rr.y <<'_ATEOF' %glr-parser %% start: 'a' | A 'a' | B 'a' ; A: ; B: ; _ATEOF cat >sr.y <<'_ATEOF' %glr-parser %% start: 'a' | A 'a' ; A: ; _ATEOF cat >rr.y <<'_ATEOF' %glr-parser %% start: A | B ; A: ; B: ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1445" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:1445" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1445" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1445" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1445: bison sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1445" ( $at_check_trace; bison sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce, 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1448" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:1448" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1448" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1448" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1448: bison -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1448" ( $at_check_trace; bison -Wno-conflicts-sr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1451" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:1451" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1451" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1451" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1451: bison -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1451" ( $at_check_trace; bison -Wno-conflicts-rr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" $at_failed && at_fn_log_failure $at_traceon; } for gram in sr-rr sr rr; do for sr_exp_i in '' 0 1 2; do for rr_exp_i in '' 0 1 2; do test -z "$sr_exp_i" && test -z "$rr_exp_i" && continue # Build grammar file. sr_exp=0 rr_exp=0 file=$gram directives= if test -n "$sr_exp_i"; then sr_exp=$sr_exp_i file=$file-expect-$sr_exp directives="%expect $sr_exp" fi if test -n "$rr_exp_i"; then rr_exp=$rr_exp_i file=$file-expect-rr-$rr_exp directives="$directives %expect-rr $rr_exp" fi file=$file.y echo "$directives" > $file cat $gram.y >> $file # Count actual conflicts. conflicts= sr_count=0 rr_count=0 if test $gram = sr || test $gram = sr-rr; then conflicts="1 shift/reduce" sr_count=1 fi if test $gram = rr || test $gram = sr-rr; then if test -n "$conflicts"; then conflicts="$conflicts, " fi conflicts="${conflicts}1 reduce/reduce" rr_count=1 fi # Run tests. if test $sr_count -eq $sr_exp && test $rr_count -eq $rr_exp; then if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Wnone \$file" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1497" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone \$file" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:1497" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1497: bison -Wnone \$file" at_fn_check_prepare_dynamic "bison -Wnone $file" "conflicts.at:1497" ( $at_check_trace; bison -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Werror \$file" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1498" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror \$file" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file" "conflicts.at:1498" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1498" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1498" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1498: bison -Werror \$file" at_fn_check_prepare_dynamic "bison -Werror $file" "conflicts.at:1498" ( $at_check_trace; bison -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" $at_failed && at_fn_log_failure $at_traceon; } else echo "$file: conflicts: $conflicts" > experr if test $sr_count -ne $sr_exp; then if test $sr_exp -ne 1; then s=s; else s= ; fi echo "$file: error: expected $sr_exp shift/reduce conflict$s" >> experr fi if test $rr_count -ne $rr_exp; then if test $rr_exp -ne 1; then s=s; else s= ; fi echo "$file: error: expected $rr_exp reduce/reduce conflict$s" >> experr fi { set +x $as_echo "$at_srcdir/conflicts.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone \$file" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone $file" "conflicts.at:1509" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror \$file" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror $file" "conflicts.at:1510" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1510" $at_failed && at_fn_log_failure $at_traceon; } fi done done done set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_199 #AT_START_200 at_fn_group_banner 200 'calc.at:597' \ "Calculator " " " 11 at_xfail=no ( $as_echo "200. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:597" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:597" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:597" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:597: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:597" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:597" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:597" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:597: cat stderr" at_fn_check_prepare_trace "calc.at:597" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_200 #AT_START_201 at_fn_group_banner 201 'calc.at:599' \ "Calculator %defines" " " 11 at_xfail=no ( $as_echo "201. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %defines %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:599" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:599: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:599" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:599: cat stderr" at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_201 #AT_START_202 at_fn_group_banner 202 'calc.at:600' \ "Calculator %locations" " " 11 at_xfail=no ( $as_echo "202. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last_line++; (yylloc).last_column = 1; } else (yylloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:600" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:600" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:600" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:600" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:600: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:600" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:600" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:600" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:600: cat stderr" at_fn_check_prepare_trace "calc.at:600" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_202 #AT_START_203 at_fn_group_banner 203 'calc.at:602' \ "Calculator %name-prefix=\"calc\"" " " 11 at_xfail=no ( $as_echo "203. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %name-prefix="calc" %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:602" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:602: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:602" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:602: cat stderr" at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_203 #AT_START_204 at_fn_group_banner 204 'calc.at:603' \ "Calculator %verbose" " " 11 at_xfail=no ( $as_echo "204. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:603" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:603: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:603" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:603: cat stderr" at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_204 #AT_START_205 at_fn_group_banner 205 'calc.at:604' \ "Calculator %yacc" " " 11 at_xfail=no ( $as_echo "205. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:604" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:604: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:604" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:604: cat stderr" at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_205 #AT_START_206 at_fn_group_banner 206 'calc.at:605' \ "Calculator %error-verbose" " " 11 at_xfail=no ( $as_echo "206. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:605" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:605" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:605" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:605" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:605: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:605" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:605" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:605" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:605: cat stderr" at_fn_check_prepare_trace "calc.at:605" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_206 #AT_START_207 at_fn_group_banner 207 'calc.at:607' \ "Calculator %define api.pure full %locations" " " 11 at_xfail=no ( $as_echo "207. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %define api.pure full %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:607" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:607: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:607" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:607: cat stderr" at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_207 #AT_START_208 at_fn_group_banner 208 'calc.at:608' \ "Calculator %define api.push-pull both %define api.pure full %locations" "" 11 at_xfail=no ( $as_echo "208. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %define api.push-pull both %define api.pure full %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:608" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:608: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:608" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:608: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:608: cat stderr" at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_208 #AT_START_209 at_fn_group_banner 209 'calc.at:609' \ "Calculator %error-verbose %locations" " " 11 at_xfail=no ( $as_echo "209. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last_line++; (yylloc).last_column = 1; } else (yylloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:609" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:609: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:609" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:609" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:609: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:609: cat stderr" at_fn_check_prepare_trace "calc.at:609" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_209 #AT_START_210 at_fn_group_banner 210 'calc.at:611' \ "Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "210. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:611" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:611: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:611" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:611: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:611: cat stderr" at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_210 #AT_START_211 at_fn_group_banner 211 'calc.at:612' \ "Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "211. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %locations %defines %define api.prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static CALCLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:612" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:612: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:612" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:612" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:612: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:612: cat stderr" at_fn_check_prepare_trace "calc.at:612" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_211 #AT_START_212 at_fn_group_banner 212 'calc.at:614' \ "Calculator %debug" " " 11 at_xfail=no ( $as_echo "212. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %debug %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } yydebug = 1; status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:614" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:614: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:614" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:614: cat stderr" at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_212 #AT_START_213 at_fn_group_banner 213 'calc.at:615' \ "Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "213. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:615" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:615: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:615" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:615: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:615: cat stderr" at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_213 #AT_START_214 at_fn_group_banner 214 'calc.at:616' \ "Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "214. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static CALCLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:616" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:616: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:616" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:616" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:616: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:616: cat stderr" at_fn_check_prepare_trace "calc.at:616" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_214 #AT_START_215 at_fn_group_banner 215 'calc.at:618' \ "Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "215. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %define api.pure full %verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (YYLTYPE const * const llocp, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:618" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:618: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:618" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:618: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:618: cat stderr" at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_215 #AT_START_216 at_fn_group_banner 216 'calc.at:619' \ "Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 at_xfail=no ( $as_echo "216. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (CALCLTYPE const * const llocp, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); static CALCLTYPE last_yylloc; static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:619" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:619" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:619: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:619" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:619" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:619: cat stderr" at_fn_check_prepare_trace "calc.at:619" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_216 #AT_START_217 at_fn_group_banner 217 '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}" "" 11 at_xfail=no ( $as_echo "217. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %define api.pure %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); static CALCLTYPE last_yylloc; static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:621" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:621: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:621" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:621" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:621: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:621: cat stderr" at_fn_check_prepare_trace "calc.at:621" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_217 #AT_START_218 at_fn_group_banner 218 'calc.at:638' \ "Calculator %glr-parser " " " 12 at_xfail=no ( $as_echo "218. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:638" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:638" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:638" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:638" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:638: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:638" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:638" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:638" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:638: cat stderr" at_fn_check_prepare_trace "calc.at:638" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_218 #AT_START_219 at_fn_group_banner 219 'calc.at:640' \ "Calculator %glr-parser %defines" " " 12 at_xfail=no ( $as_echo "219. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %defines %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:640" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:640: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:640" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:640: cat stderr" at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_219 #AT_START_220 at_fn_group_banner 220 'calc.at:641' \ "Calculator %glr-parser %locations" " " 12 at_xfail=no ( $as_echo "220. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last_line++; (yylloc).last_column = 1; } else (yylloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:641" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:641: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:641" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:641: cat stderr" at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_220 #AT_START_221 at_fn_group_banner 221 'calc.at:642' \ "Calculator %glr-parser %name-prefix \"calc\"" " " 12 at_xfail=no ( $as_echo "221. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %name-prefix "calc" %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int calclex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:642" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:642: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:642" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:642: cat stderr" at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_221 #AT_START_222 at_fn_group_banner 222 'calc.at:643' \ "Calculator %glr-parser %define api.prefix \"calc\"" "" 12 at_xfail=no ( $as_echo "222. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %define api.prefix "calc" %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int calclex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:643" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:643: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:643" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:643: cat stderr" at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_222 #AT_START_223 at_fn_group_banner 223 'calc.at:644' \ "Calculator %glr-parser %verbose" " " 12 at_xfail=no ( $as_echo "223. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:644" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:644: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:644" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:644: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:644: cat stderr" at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_223 #AT_START_224 at_fn_group_banner 224 'calc.at:645' \ "Calculator %glr-parser %yacc" " " 12 at_xfail=no ( $as_echo "224. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:645" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:645: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:645" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:645: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:645: cat stderr" at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_224 #AT_START_225 at_fn_group_banner 225 'calc.at:646' \ "Calculator %glr-parser %error-verbose" " " 12 at_xfail=no ( $as_echo "225. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %error-verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:646" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:646" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:646: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:646" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:646: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:646" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:646: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:646" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:646" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:646" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:646: cat stderr" at_fn_check_prepare_trace "calc.at:646" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_225 #AT_START_226 at_fn_group_banner 226 'calc.at:648' \ "Calculator %glr-parser %define api.pure %locations" "" 12 at_xfail=no ( $as_echo "226. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %define api.pure %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:648" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:648: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:648" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:648: cat stderr" at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_226 #AT_START_227 at_fn_group_banner 227 'calc.at:649' \ "Calculator %glr-parser %error-verbose %locations" "" 12 at_xfail=no ( $as_echo "227. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %error-verbose %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last_line++; (yylloc).last_column = 1; } else (yylloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:649" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:649: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:649" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:649" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:649: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:649: cat stderr" at_fn_check_prepare_trace "calc.at:649" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_227 #AT_START_228 at_fn_group_banner 228 'calc.at:651' \ "Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( $as_echo "228. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:651: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:651" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:651: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:651" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:651" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:651: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:651: cat stderr" at_fn_check_prepare_trace "calc.at:651" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_228 #AT_START_229 at_fn_group_banner 229 'calc.at:653' \ "Calculator %glr-parser %debug" " " 12 at_xfail=no ( $as_echo "229. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %debug %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void yyerror ( const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void); static void unget_char ( int c); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (void) { int c; /* Skip current token, then white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } yydebug = 1; status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:653" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:653: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:653" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:653: cat stderr" at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_229 #AT_START_230 at_fn_group_banner 230 'calc.at:654' \ "Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( $as_echo "230. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:654" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:654: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:654" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:654: cat stderr" at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_230 #AT_START_231 at_fn_group_banner 231 'calc.at:655' \ "Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( $as_echo "231. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror ( const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (void); static int get_char (void); static void unget_char ( int c); static CALCLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (calclloc); if (res == '\n') { (calclloc).last_line++; (calclloc).last_column = 1; } else (calclloc).last_column++; return res; } static void unget_char ( int c) { ; /* Wrong when C == `\n'. */ (calclloc) = last_yylloc; ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; ; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (void) { int c; /* Skip current token, then white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (calclval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:655" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:655" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:655" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:655: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:655" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:655" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:655: cat stderr" at_fn_check_prepare_trace "calc.at:655" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_231 #AT_START_232 at_fn_group_banner 232 'calc.at:657' \ "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( $as_echo "232. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (YYLTYPE const * const llocp, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:657" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:657: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:657" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:657: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:657" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:657: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:657" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:657" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:657: cat stderr" at_fn_check_prepare_trace "calc.at:657" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_232 #AT_START_233 at_fn_group_banner 233 '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}" "" 12 at_xfail=no ( $as_echo "233. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); static YYLTYPE last_yylloc; static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:659" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:659: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:659" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:659: cat stderr" at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_233 #AT_START_234 at_fn_group_banner 234 'calc.at:660' \ "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12 at_xfail=no ( $as_echo "234. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %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} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyoutput, "%d", $$); } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); static CALCLTYPE last_yylloc; static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last_line++; (*llocp).last_column = 1; } else (*llocp).last_column++; return res; } static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first_column = (*llocp).last_column; (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.h" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:660" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:660: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:660" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:660: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:660" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:660: bison -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; bison -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:660" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:660" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:660: cat stderr" at_fn_check_prepare_trace "calc.at:660" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_234 #AT_START_235 at_fn_group_banner 235 'calc.at:670' \ "Calculator %skeleton \"lalr1.cc\" %defines %locations" "" 13 at_xfail=no ( $as_echo "235. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %skeleton "lalr1.cc" %defines %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:670" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:670: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:670" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:670: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:670" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:670: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:670" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:670" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:670: cat stderr" at_fn_check_prepare_trace "calc.at:670" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_235 #AT_START_236 at_fn_group_banner 236 'calc.at:679' \ "Calculator %language \"C++\" %defines %locations " "" 13 at_xfail=no ( $as_echo "236. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:679" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:679: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:679" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:679" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:679: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:679: cat stderr" at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_236 #AT_START_237 at_fn_group_banner 237 'calc.at:680' \ "Calculator %language \"C++\" %defines %locations %define api.location.type Span" "" 13 at_xfail=no ( $as_echo "237. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define api.location.type Span %define global_tokens_and_yystype %code requires { # include struct Point { int l; int c; }; struct Span { Point first; Point last; }; # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first = YYRHSLOC (Rhs, 1).first; \ (Current).last = YYRHSLOC (Rhs, N).last; \ } \ else \ { \ (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ } \ while (false) /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %initial-action { @$.first.l = @$.first.c = 1; @$.last = @$.first; } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } std::ostream& operator<< (std::ostream& o, const Span& s) { o << s.first.l << '.' << s.first.c; if (s.first.l != s.last.l) o << '-' << s.last.l << '.' << s.last.c - 1; else if (s.first.c != s.last.c - 1) o << '-' << s.last.c - 1; return o; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last.l++; (*llocp).last.c = 1; } else (*llocp).last.c++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first.c = (*llocp).last.c; (*llocp).first.l = (*llocp).last.l; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:680" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:680: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:680" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:680: cat stderr" at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_237 #AT_START_238 at_fn_group_banner 238 'calc.at:681' \ "Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( $as_echo "238. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:681" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:681: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:681" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:681: cat stderr" at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_238 #AT_START_239 at_fn_group_banner 239 'calc.at:682' \ "Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( $as_echo "239. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:682" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:682" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:682" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:682: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:682" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:682" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:682: cat stderr" at_fn_check_prepare_trace "calc.at:682" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_239 #AT_START_240 at_fn_group_banner 240 'calc.at:683' \ "Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( $as_echo "240. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:683" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:683: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:683" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:683: cat stderr" at_fn_check_prepare_trace "calc.at:683" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_240 #AT_START_241 at_fn_group_banner 241 'calc.at:685' \ "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( $as_echo "241. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:685" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:685" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:685" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:685: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:685" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:685" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:685: cat stderr" at_fn_check_prepare_trace "calc.at:685" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_241 #AT_START_242 at_fn_group_banner 242 '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}" "" 13 at_xfail=no ( $as_echo "242. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:687" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:687: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:687" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:687: cat stderr" at_fn_check_prepare_trace "calc.at:687" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_242 #AT_START_243 at_fn_group_banner 243 'calc.at:688' \ "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13 at_xfail=no ( $as_echo "243. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:688: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:688" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:688" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:688: cat stderr" at_fn_check_prepare_trace "calc.at:688" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_243 #AT_START_244 at_fn_group_banner 244 'calc.at:699' \ "Calculator %skeleton \"glr.cc\" %defines %locations" "" 14 at_xfail=no ( $as_echo "244. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %skeleton "glr.cc" %defines %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:699" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:699: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:699" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:699: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:699" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:699: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:699" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:699" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:699: cat stderr" at_fn_check_prepare_trace "calc.at:699" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_244 #AT_START_245 at_fn_group_banner 245 'calc.at:708' \ "Calculator %language \"C++\" %glr-parser %defines %locations " "" 14 at_xfail=no ( $as_echo "245. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:708" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:708" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:708" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:708: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:708" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:708" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:708: cat stderr" at_fn_check_prepare_trace "calc.at:708" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_245 #AT_START_246 at_fn_group_banner 246 'calc.at:709' \ "Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span" "" 14 at_xfail=no ( $as_echo "246. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %define api.location.type Span %define global_tokens_and_yystype %code requires { # include struct Point { int l; int c; }; struct Span { Point first; Point last; }; # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first = YYRHSLOC (Rhs, 1).first; \ (Current).last = YYRHSLOC (Rhs, N).last; \ } \ else \ { \ (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ } \ while (false) /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %initial-action { @$.first.l = @$.first.c = 1; @$.last = @$.first; } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } std::ostream& operator<< (std::ostream& o, const Span& s) { o << s.first.l << '.' << s.first.c; if (s.first.l != s.last.l) o << '-' << s.last.l << '.' << s.last.c - 1; else if (s.first.c != s.last.c - 1) o << '-' << s.last.c - 1; return o; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).last.l++; (*llocp).last.c = 1; } else (*llocp).last.c++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).first.c = (*llocp).last.c; (*llocp).first.l = (*llocp).last.l; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:709" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:709" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:709" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:709: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:709" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:709" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:709: cat stderr" at_fn_check_prepare_trace "calc.at:709" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_246 #AT_START_247 at_fn_group_banner 247 'calc.at:710' \ "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 14 at_xfail=no ( $as_echo "247. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:710" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:710" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:710" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:710: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:710" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:710" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:710: cat stderr" at_fn_check_prepare_trace "calc.at:710" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_247 #AT_START_248 at_fn_group_banner 248 'calc.at:711' \ "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 14 at_xfail=no ( $as_echo "248. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:711" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:711" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:711" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:711: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:711" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:711" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:711: cat stderr" at_fn_check_prepare_trace "calc.at:711" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_248 #AT_START_249 at_fn_group_banner 249 'calc.at:713' \ "Calculator %language \"C++\" %glr-parser %defines %locations %debug" "" 14 at_xfail=no ( $as_echo "249. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %debug %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); static yy::parser::location_type last_yylloc; static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:713" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:713: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:713" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 5. Check { set +x $as_echo "$at_srcdir/calc.at:713: cat stderr" at_fn_check_prepare_trace "calc.at:713" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_249 #AT_START_250 at_fn_group_banner 250 'calc.at:714' \ "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14 at_xfail=no ( $as_echo "250. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:714" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:714: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:714" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:714: cat stderr" at_fn_check_prepare_trace "calc.at:714" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_250 #AT_START_251 at_fn_group_banner 251 'calc.at:716' \ "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14 at_xfail=no ( $as_echo "251. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:716" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:716: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:716" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:716: cat stderr" at_fn_check_prepare_trace "calc.at:716" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_251 #AT_START_252 at_fn_group_banner 252 'calc.at:718' \ "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 at_xfail=no ( $as_echo "252. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %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} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:718" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:718: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:718" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:718: cat stderr" at_fn_check_prepare_trace "calc.at:718" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_252 #AT_START_253 at_fn_group_banner 253 'calc.at:719' \ "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 at_xfail=no ( $as_echo "253. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Infix notation calculator--calc */ %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} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyoutput << $$; } ; %code provides { #include /* The input. */ extern FILE *input; extern semantic_value global_result; extern int global_count; } %code { #include #include #define USE(Var) FILE *input; static int power (int base, int exponent); int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1 != $3) fprintf (stderr, "calc: error: %d != %d\n", $1, $3); $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = power ($1, $3); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = 1111; yyerrok; } | '!' { $$ = 0; YYERROR; } | '-' error { $$ = 0; YYERROR; } ; %% static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } _ATEOF cat >calc-lex.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); static calc::parser::location_type last_yylloc; static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int res = getc (input); (void) lvalp;(void) llocp; last_yylloc = (*llocp); if (res == '\n') { (*llocp).end.line++; (*llocp).end.column = 1; } else (*llocp).end.column++; return res; } static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) { (void) lvalp;(void) llocp; /* Wrong when C == `\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int sign = 1; int n = 0; (void) lvalp;(void) llocp; if (c == '-') { c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return sign * n; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c; /* Skip current token, then white spaces. */ do { (*llocp).begin.column = (*llocp).end.column; (*llocp).begin.line = (*llocp).end.line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc #include "calc.hh" #include #if HAVE_UNISTD_H # include #else # undef alarm # define alarm(seconds) /* empty */ #endif /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds is enough. */ alarm (100); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); assert (global_count == count); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:719" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:719" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:719" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:719: bison -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; bison -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:719" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:719" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: \$PERL -ne ' chomp; print \"\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. FIXME: not ready for \"maint\". # || /\\s\$/ )' calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719" ( $at_check_trace; $PERL -ne ' chomp; print "$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. FIXME: not ready for "maint". # || /\s$/ )' calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 1 2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected number _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected '=' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!' calc: error: 4444 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.10: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.12: syntax error, unexpected number calc: error: 2222 != 1 _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Check that yyerrok works properly: second error is not reported, # third and fourth are. Parse status is succesfull. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^Discarding/d / \$[0-9$]* = /d /^yydestructor:/d' stderr >at-stderr mv at-stderr stderr # 2. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!' _ATEOF # 3. If locations are not used, remove them. # 4. If error-verbose is not used, strip the`, unexpected....' part. # 5. Check { set +x $as_echo "$at_srcdir/calc.at:719: cat stderr" at_fn_check_prepare_trace "calc.at:719" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_253 #AT_START_254 at_fn_group_banner 254 'torture.at:137' \ "Big triangle" " " 15 at_xfail=no ( $as_echo "254. $at_setup_line: testing $at_desc ..." $at_traceon # I have been able to go up to 2000 on my machine. # I tried 3000, a 29Mb grammar file, but then my system killed bison. # With 500 and the new parser, which consume far too much memory, # it gets killed too. Of course the parser is to be cleaned. cat >gengram.pl <<'_ATEOF' #! /usr/bin/perl -w use strict; my $max = $ARGV[0] || 10; print < /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %{ #include #include #include #define MAX $max static int yylex (void); static void yyerror ( const char *msg); %} %union { int val; }; %token END "end" %type exp input EOF for my $size (1 .. $max) { print "%token t$size $size \"$size\"\n"; }; print < /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int inner = 1; static int outer = 0; if (outer > MAX) return 0; else if (inner > outer) { inner = 1; ++outer; return END; } return inner++; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:143: \$PERL -w ./gengram.pl 200 || exit 77" at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 200 || exit 77" "torture.at:143" ( $at_check_trace; $PERL -w ./gengram.pl 200 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:143" $at_failed && at_fn_log_failure $at_traceon; } mv stdout input.y { set +x $as_echo "$at_srcdir/torture.at:144: bison -v -o input.c input.y" at_fn_check_prepare_trace "torture.at:144" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:144" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:145: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:145" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:145" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:145: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:145" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:145" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:146: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:146" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:146" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:146: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:146" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:146" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_254 #AT_START_255 at_fn_group_banner 255 'torture.at:227' \ "Big horizontal" " " 15 at_xfail=no ( $as_echo "255. $at_setup_line: testing $at_desc ..." $at_traceon # I have been able to go up to 10000 on my machine, but I had to # increase the maximum stack size (* 100). It gave: # # input.y 263k # input.tab.c 1.3M # input 453k # # gengram.pl 10000 0.70s user 0.01s sys 99% cpu 0.711 total # bison input.y 730.56s user 0.53s sys 99% cpu 12:12.34 total # gcc -Wall input.tab.c -o input 5.81s user 0.20s sys 100% cpu 6.01 total # ./input 0.00s user 0.01s sys 108% cpu 0.01 total # cat >gengram.pl <<'_ATEOF' #! /usr/bin/perl -w use strict; my $max = $ARGV[0] || 10; print < /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %error-verbose %debug %{ #include #include #define MAX $max static int yylex (void); static void yyerror ( const char *msg); %} %token EOF for my $size (1 .. $max) { print " t$size $size \"$size\"\n"; }; print < #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int counter = 1; if (counter <= MAX) return counter++; assert (counter++ == MAX + 1); return 0; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:241: \$PERL -w ./gengram.pl 1000 || exit 77" at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:241" ( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:241" $at_failed && at_fn_log_failure $at_traceon; } mv stdout input.y # GNU m4 requires about 70 MiB for this test on a 32-bit host. # Ask for 200 MiB, which should be plenty even on a 64-bit host. data_limit=`(ulimit -S -d) 2>/dev/null` case $data_limit in [0-9]*) if test "$data_limit" -lt 204000; then { set +x $as_echo "$at_srcdir/torture.at:245: ulimit -S -d 204000 || exit 77" at_fn_check_prepare_trace "torture.at:245" ( $at_check_trace; ulimit -S -d 204000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:245" $at_failed && at_fn_log_failure $at_traceon; } ulimit -S -d 204000 fi esac { set +x $as_echo "$at_srcdir/torture.at:247: bison -v -o input.c input.y" at_fn_check_prepare_trace "torture.at:247" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:248: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:248" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:248" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:248: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:248" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:248" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:249: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:249" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:249: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:249" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:249" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_255 #AT_START_256 at_fn_group_banner 256 'torture.at:364' \ "Many lookahead tokens" " " 15 at_xfail=no ( $as_echo "256. $at_setup_line: testing $at_desc ..." $at_traceon cat >gengram.pl <<'_ATEOF' #! /usr/bin/perl -w use strict; use Text::Wrap; my $max = $ARGV[0] || 10; print < /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc # include # include # include # define MAX $max static int yylex (void); static void yyerror ( const char *msg); %} %union { int val; }; %type input exp %token token EOF print wrap ("%type ", " ", map { "n$_" } (1 .. $max)), "\n"; print "%token\n"; for my $count (1 .. $max) { print " t$count $count \"$count\"\n"; }; print < /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int return_token = 1; static int counter = 1; if (counter > MAX) { assert (counter++ == MAX + 1); return 0; } if (return_token) { return_token = 0; return token; } return_token = 1; return counter++; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:366: \$PERL -w ./gengram.pl 1000 || exit 77" at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:366" ( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:366" $at_failed && at_fn_log_failure $at_traceon; } mv stdout input.y # GNU m4 requires about 70 MiB for this test on a 32-bit host. # Ask for 200 MiB, which should be plenty even on a 64-bit host. data_limit=`(ulimit -S -d) 2>/dev/null` case $data_limit in [0-9]*) if test "$data_limit" -lt 204000; then { set +x $as_echo "$at_srcdir/torture.at:370: ulimit -S -d 204000 || exit 77" at_fn_check_prepare_trace "torture.at:370" ( $at_check_trace; ulimit -S -d 204000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:370" $at_failed && at_fn_log_failure $at_traceon; } ulimit -S -d 204000 fi esac if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/torture.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:372" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:372" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:372" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:372" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:372: bison -v -o input.c input.y" at_fn_check_prepare_trace "torture.at:372" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:373: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:373" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:373: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:373" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:374: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:374" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:374" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_256 #AT_START_257 at_fn_group_banner 257 'torture.at:466' \ "Exploding the Stack Size with Alloca" " " 15 at_xfail=no ( $as_echo "257. $at_setup_line: testing $at_desc ..." $at_traceon # A grammar of parens growing the stack thanks to right recursion. # exp: cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \ || defined _AIX || defined _MSC_VER || defined _ALLOCA_H) # define YYSTACK_USE_ALLOCA 1 #endif static int yylex (void); static void yyerror ( const char *msg); %} %error-verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { assert (0 <= yylval); if (yylval--) return WAIT_FOR_EOF; else return EOF; } /* Return argv[1] as an int. */ static int get_args (int argc, const char **argv) { int res; char *endp; assert (argc == 2); res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return res; } int main (int argc, const char **argv) { YYSTYPE yylval_init = get_args (argc, argv); int status = 0; int count; yydebug = 1; for (count = 0; count < 2; ++count) { int new_status; yylval = yylval_init; new_status = yyparse (); if (count == 0) status = new_status; else assert (new_status == status); } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:475" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:475" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:475: bison -o input.c input.y" at_fn_check_prepare_trace "torture.at:475" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:475: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:475" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:475: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:475" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" $at_failed && at_fn_log_failure $at_traceon; } # Below the limit of 200. { set +x $as_echo "$at_srcdir/torture.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:478" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:478" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478" $at_failed && at_fn_log_failure $at_traceon; } # Two enlargements: 2 * 2 * 200. { set +x $as_echo "$at_srcdir/torture.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:481" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:481: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:481" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481" $at_failed && at_fn_log_failure $at_traceon; } # Fails: beyond the limit of 10,000 (which we don't reach anyway since we # multiply by two starting at 200 => 5120 is the last possible). { set +x $as_echo "$at_srcdir/torture.at:485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:485" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/torture.at:485" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:485: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:485" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:485" $at_failed && at_fn_log_failure $at_traceon; } # The push parser can't use alloca since the stacks can't be locals. This test # just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect # push parsers. # A grammar of parens growing the stack thanks to right recursion. # exp: cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \ || defined _AIX || defined _MSC_VER || defined _ALLOCA_H) # define YYSTACK_USE_ALLOCA 1 #endif static int yylex (void); static void yyerror ( const char *msg); %} %define api.push-pull both %error-verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { assert (0 <= yylval); if (yylval--) return WAIT_FOR_EOF; else return EOF; } /* Return argv[1] as an int. */ static int get_args (int argc, const char **argv) { int res; char *endp; assert (argc == 2); res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return res; } int main (int argc, const char **argv) { YYSTYPE yylval_init = get_args (argc, argv); int status = 0; int count; yypstate *ps = yypstate_new (); yydebug = 1; for (count = 0; count < 2; ++count) { int new_status; yylval = yylval_init; new_status = yypull_parse (ps); if (count == 0) status = new_status; else assert (new_status == status); } yypstate_delete (ps); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/torture.at:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:491" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:491" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:491: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:491" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/torture.at:491: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:491" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:491: bison -o input.c input.y" at_fn_check_prepare_trace "torture.at:491" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:491: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:491" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:491: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:491" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:494" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:494: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:494" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:496" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:496: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:496" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:498" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/torture.at:498" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:498: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:498" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_257 #AT_START_258 at_fn_group_banner 258 'torture.at:512' \ "Exploding the Stack Size with Malloc" " " 15 at_xfail=no ( $as_echo "258. $at_setup_line: testing $at_desc ..." $at_traceon # A grammar of parens growing the stack thanks to right recursion. # exp: cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #define YYSTACK_USE_ALLOCA 0 static int yylex (void); static void yyerror ( const char *msg); %} %error-verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { assert (0 <= yylval); if (yylval--) return WAIT_FOR_EOF; else return EOF; } /* Return argv[1] as an int. */ static int get_args (int argc, const char **argv) { int res; char *endp; assert (argc == 2); res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return res; } int main (int argc, const char **argv) { YYSTYPE yylval_init = get_args (argc, argv); int status = 0; int count; yydebug = 1; for (count = 0; count < 2; ++count) { int new_status; yylval = yylval_init; new_status = yyparse (); if (count == 0) status = new_status; else assert (new_status == status); } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:516" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:516" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:516: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:516" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/torture.at:516: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:516" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:516: bison -o input.c input.y" at_fn_check_prepare_trace "torture.at:516" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:516: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:516" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:516: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:516" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } # Below the limit of 200. { set +x $as_echo "$at_srcdir/torture.at:519: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:519" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:519: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:519" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519" $at_failed && at_fn_log_failure $at_traceon; } # Two enlargements: 2 * 2 * 200. { set +x $as_echo "$at_srcdir/torture.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:522" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:522" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522" $at_failed && at_fn_log_failure $at_traceon; } # Fails: beyond the limit of 10,000 (which we don't reach anyway since we # multiply by two starting at 200 => 5120 is the possible). { set +x $as_echo "$at_srcdir/torture.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:526" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/torture.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:526" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:526" $at_failed && at_fn_log_failure $at_traceon; } # A grammar of parens growing the stack thanks to right recursion. # exp: cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #include #include #define YYSTACK_USE_ALLOCA 0 static int yylex (void); static void yyerror ( const char *msg); %} %define api.push-pull both %error-verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { assert (0 <= yylval); if (yylval--) return WAIT_FOR_EOF; else return EOF; } /* Return argv[1] as an int. */ static int get_args (int argc, const char **argv) { int res; char *endp; assert (argc == 2); res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return res; } int main (int argc, const char **argv) { YYSTYPE yylval_init = get_args (argc, argv); int status = 0; int count; yypstate *ps = yypstate_new (); yydebug = 1; for (count = 0; count < 2; ++count) { int new_status; yylval = yylval_init; new_status = yypull_parse (ps); if (count == 0) status = new_status; else assert (new_status == status); } yypstate_delete (ps); return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:529: bison -o input.c input.y" at_fn_check_prepare_trace "torture.at:529" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:529: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:529" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:529: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:529" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:532" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:532" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:534: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:534" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:534: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:534" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:536" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/torture.at:536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:536" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_258 #AT_START_259 at_fn_group_banner 259 'existing.at:79' \ "GNU AWK 3.1.0 Grammar: LALR(1)" " " 16 at_xfail=no ( $as_echo "259. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %error-verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "319 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_259 #AT_START_260 at_fn_group_banner 260 'existing.at:79' \ "GNU AWK 3.1.0 Grammar: IELR(1)" " " 16 at_xfail=no ( $as_echo "260. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %error-verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "328 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "@@ -712,7 +712,7 @@ 156 | . '\$' non_post_simp_exp NAME shift, and go to state 9 - '\$' shift, and go to state 24 + '\$' shift, and go to state 320 NAME [reduce using rule 152 (opt_variable)] '\$' [reduce using rule 152 (opt_variable)] @@ -5379,7 +5379,7 @@ 156 | . '\$' non_post_simp_exp NAME shift, and go to state 9 - '\$' shift, and go to state 24 + '\$' shift, and go to state 320 NAME [reduce using rule 152 (opt_variable)] '\$' [reduce using rule 152 (opt_variable)] @@ -5399,7 +5399,7 @@ 156 | . '\$' non_post_simp_exp NAME shift, and go to state 9 - '\$' shift, and go to state 24 + '\$' shift, and go to state 320 NAME [reduce using rule 152 (opt_variable)] '\$' [reduce using rule 152 (opt_variable)] @@ -6214,7 +6214,7 @@ 156 | . '\$' non_post_simp_exp NAME shift, and go to state 9 - '\$' shift, and go to state 24 + '\$' shift, and go to state 320 NAME [reduce using rule 152 (opt_variable)] '\$' [reduce using rule 152 (opt_variable)] @@ -11099,3 +11099,274 @@ 45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement . \$default reduce using rule 45 (statement) + + +State 320 + + 139 non_post_simp_exp: . '!' simp_exp + 140 | . '(' exp r_paren + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren + 142 | . LEX_LENGTH '(' opt_expression_list r_paren + 143 | . LEX_LENGTH + 144 | . FUNC_CALL '(' opt_expression_list r_paren + 145 | . variable + 146 | . INCREMENT variable + 147 | . DECREMENT variable + 148 | . YNUMBER + 149 | . YSTRING + 150 | . '-' simp_exp + 151 | . '+' simp_exp + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + 156 | '\$' . non_post_simp_exp + + FUNC_CALL shift, and go to state 8 + NAME shift, and go to state 9 + YNUMBER shift, and go to state 10 + YSTRING shift, and go to state 11 + INCREMENT shift, and go to state 321 + DECREMENT shift, and go to state 322 + LEX_BUILTIN shift, and go to state 18 + LEX_LENGTH shift, and go to state 19 + '+' shift, and go to state 323 + '-' shift, and go to state 324 + '!' shift, and go to state 325 + '\$' shift, and go to state 320 + '(' shift, and go to state 55 + + non_post_simp_exp go to state 62 + variable go to state 63 + + +State 321 + + 146 non_post_simp_exp: INCREMENT . variable + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 + '\$' shift, and go to state 320 + + variable go to state 50 + + +State 322 + + 147 non_post_simp_exp: DECREMENT . variable + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 + '\$' shift, and go to state 320 + + variable go to state 51 + + +State 323 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp + 132 | . simp_exp '*' simp_exp + 133 | . simp_exp '/' simp_exp + 134 | . simp_exp '%' simp_exp + 135 | . simp_exp '+' simp_exp + 136 | . simp_exp '-' simp_exp + 137 | . variable INCREMENT + 138 | . variable DECREMENT + 139 non_post_simp_exp: . '!' simp_exp + 140 | . '(' exp r_paren + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren + 142 | . LEX_LENGTH '(' opt_expression_list r_paren + 143 | . LEX_LENGTH + 144 | . FUNC_CALL '(' opt_expression_list r_paren + 145 | . variable + 146 | . INCREMENT variable + 147 | . DECREMENT variable + 148 | . YNUMBER + 149 | . YSTRING + 150 | . '-' simp_exp + 151 | . '+' simp_exp + 151 | '+' . simp_exp + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + + FUNC_CALL shift, and go to state 8 + NAME shift, and go to state 9 + YNUMBER shift, and go to state 10 + YSTRING shift, and go to state 11 + INCREMENT shift, and go to state 16 + DECREMENT shift, and go to state 17 + LEX_BUILTIN shift, and go to state 18 + LEX_LENGTH shift, and go to state 19 + '+' shift, and go to state 20 + '-' shift, and go to state 21 + '!' shift, and go to state 54 + '\$' shift, and go to state 24 + '(' shift, and go to state 55 + + simp_exp go to state 326 + non_post_simp_exp go to state 35 + variable go to state 57 + + +State 324 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp + 132 | . simp_exp '*' simp_exp + 133 | . simp_exp '/' simp_exp + 134 | . simp_exp '%' simp_exp + 135 | . simp_exp '+' simp_exp + 136 | . simp_exp '-' simp_exp + 137 | . variable INCREMENT + 138 | . variable DECREMENT + 139 non_post_simp_exp: . '!' simp_exp + 140 | . '(' exp r_paren + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren + 142 | . LEX_LENGTH '(' opt_expression_list r_paren + 143 | . LEX_LENGTH + 144 | . FUNC_CALL '(' opt_expression_list r_paren + 145 | . variable + 146 | . INCREMENT variable + 147 | . DECREMENT variable + 148 | . YNUMBER + 149 | . YSTRING + 150 | . '-' simp_exp + 150 | '-' . simp_exp + 151 | . '+' simp_exp + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + + FUNC_CALL shift, and go to state 8 + NAME shift, and go to state 9 + YNUMBER shift, and go to state 10 + YSTRING shift, and go to state 11 + INCREMENT shift, and go to state 16 + DECREMENT shift, and go to state 17 + LEX_BUILTIN shift, and go to state 18 + LEX_LENGTH shift, and go to state 19 + '+' shift, and go to state 20 + '-' shift, and go to state 21 + '!' shift, and go to state 54 + '\$' shift, and go to state 24 + '(' shift, and go to state 55 + + simp_exp go to state 327 + non_post_simp_exp go to state 35 + variable go to state 57 + + +State 325 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp + 132 | . simp_exp '*' simp_exp + 133 | . simp_exp '/' simp_exp + 134 | . simp_exp '%' simp_exp + 135 | . simp_exp '+' simp_exp + 136 | . simp_exp '-' simp_exp + 137 | . variable INCREMENT + 138 | . variable DECREMENT + 139 non_post_simp_exp: . '!' simp_exp + 139 | '!' . simp_exp + 140 | . '(' exp r_paren + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren + 142 | . LEX_LENGTH '(' opt_expression_list r_paren + 143 | . LEX_LENGTH + 144 | . FUNC_CALL '(' opt_expression_list r_paren + 145 | . variable + 146 | . INCREMENT variable + 147 | . DECREMENT variable + 148 | . YNUMBER + 149 | . YSTRING + 150 | . '-' simp_exp + 151 | . '+' simp_exp + 154 variable: . NAME + 155 | . NAME '[' expression_list ']' + 156 | . '\$' non_post_simp_exp + + FUNC_CALL shift, and go to state 8 + NAME shift, and go to state 9 + YNUMBER shift, and go to state 10 + YSTRING shift, and go to state 11 + INCREMENT shift, and go to state 16 + DECREMENT shift, and go to state 17 + LEX_BUILTIN shift, and go to state 18 + LEX_LENGTH shift, and go to state 19 + '+' shift, and go to state 20 + '-' shift, and go to state 21 + '!' shift, and go to state 54 + '\$' shift, and go to state 24 + '(' shift, and go to state 55 + + simp_exp go to state 328 + non_post_simp_exp go to state 35 + variable go to state 57 + + +State 326 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp + 133 | simp_exp . '/' simp_exp + 134 | simp_exp . '%' simp_exp + 135 | simp_exp . '+' simp_exp + 136 | simp_exp . '-' simp_exp + 151 non_post_simp_exp: '+' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] + + '*' shift, and go to state 89 + '/' shift, and go to state 90 + '%' shift, and go to state 91 + '^' shift, and go to state 92 + + \$default reduce using rule 151 (non_post_simp_exp) + + Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY). + Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY). + + +State 327 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp + 133 | simp_exp . '/' simp_exp + 134 | simp_exp . '%' simp_exp + 135 | simp_exp . '+' simp_exp + 136 | simp_exp . '-' simp_exp + 150 non_post_simp_exp: '-' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] + + '*' shift, and go to state 89 + '/' shift, and go to state 90 + '%' shift, and go to state 91 + '^' shift, and go to state 92 + + \$default reduce using rule 150 (non_post_simp_exp) + + Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY). + Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY). + + +State 328 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp + 133 | simp_exp . '/' simp_exp + 134 | simp_exp . '%' simp_exp + 135 | simp_exp . '+' simp_exp + 136 | simp_exp . '-' simp_exp + 139 non_post_simp_exp: '!' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] + + '*' shift, and go to state 89 + '/' shift, and go to state 90 + '%' shift, and go to state 91 + '^' shift, and go to state 92 + + \$default reduce using rule 139 (non_post_simp_exp) + + Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY). + Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY). " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_260 #AT_START_261 at_fn_group_banner 261 'existing.at:79' \ "GNU AWK 3.1.0 Grammar: Canonical LR(1)" " " 16 at_xfail=no ( $as_echo "261. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %error-verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 265 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2358 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:79" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_261 #AT_START_262 at_fn_group_banner 262 'existing.at:783' \ "GNU Cim Grammar: LALR(1)" " " 16 at_xfail=no ( $as_echo "262. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %token HACTIVATE HAFTER /*HAND*/ HARRAY HAT HBEFORE HBEGIN HBOOLEAN HCHARACTER HCLASS /*HCOMMENT*/ HCONC HDELAY HDO HELSE HEND HEQ /*HEQV*/ HEXTERNAL HFOR HGE HGO HGOTO HGT HHIDDEN HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS HLABEL HLE HLONG HLT HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT /*HOR*/ HOTHERWISE HPRIOR HPROCEDURE HPROTECTED HQUA HREACTIVATE HREAL HREF HSHORT HSTEP HSWITCH HTEXT HTHEN HTHIS HTO HUNTIL HVALUE HVAR HVIRTUAL HWHEN HWHILE HASSIGNVALUE HASSIGNREF /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR HBEGPAR HENDPAR HEQR HNER HADD HSUB HMUL HDIV HINTDIV HEXP HDOTDOTDOT %token HIDENTIFIER %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST %token HREALKONST %token HTEXTKONST %right HASSIGN %left HORELSE %left HANDTHEN %left HEQV %left HIMP %left HOR %left HAND %left HNOT %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR %left HCONC %left HTERMOPERATOR %left UNEAR %left HFACTOROPERATOR %left HPRIMARYOPERATOR %left HQUA %left HDOT %start MAIN_MODULE %% /* GRAMATIKK FOR PROGRAM MODULES */ MAIN_MODULE : {} MODULS | error HSTATEMENTSEPARATOR MBEE_DECLSTMS ; EXT_DECLARATION : HEXTERNAL MBEE_TYPE HPROCEDURE {} EXT_LIST | HEXTERNAL HIDENTIFIER HPROCEDURE {} HIDENTIFIER {} EXTERNAL_KIND_ITEM | HEXTERNAL HCLASS {} EXT_LIST ; EXTERNAL_KIND_ITEM: EXT_IDENT HOBJRELOPERATOR {} MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING EMPTY_BLOCK {} /* | EXT_IDENT {} MBEE_REST_EXT_LIST ; MBEE_REST_EXT_LIST: /* EMPTY | HPAREXPSEPARATOR EXT_KIND_LIST ; EXT_KIND_LIST : EXT_KIND_ITEM | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM ; EXT_KIND_ITEM : HIDENTIFIER EXT_IDENT {}*/ ; EMPTY_BLOCK : /*EMPT*/ | HBEGIN HEND ; EXT_LIST : EXT_ITEM | EXT_LIST HPAREXPSEPARATOR EXT_ITEM ; EXT_ITEM : HIDENTIFIER EXT_IDENT ; EXT_IDENT : /* EMPTY */ | HVALRELOPERATOR {} HTEXTKONST ; /* GRAMATIKK FOR TYPER */ NO_TYPE : /*EMPT*/ ; MBEE_TYPE : NO_TYPE | TYPE ; TYPE : HREF HBEGPAR HIDENTIFIER {} HENDPAR | HTEXT | HBOOLEAN | HCHARACTER | HSHORT HINTEGER | HINTEGER | HREAL | HLONG HREAL ; /* GRAMATIKK FOR DEL AV SETNINGER */ MBEE_ELSE_PART : /*EMPT*/ /* | HELSE HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART {}*/ | HELSE {} BLOCK ; FOR_LIST : FOR_LIST_ELEMENT | FOR_LIST_ELEMENT HPAREXPSEPARATOR FOR_LIST ; FOR_LIST_ELEMENT: EXPRESSION MBEE_F_L_EL_R_PT ; MBEE_F_L_EL_R_PT: /*EMPT*/ | HWHILE EXPRESSION | HSTEP EXPRESSION HUNTIL EXPRESSION ; GOTO : HGO HTO | HGOTO ; CONN_STATE_R_PT : WHEN_CLAUSE_LIST | HDO {} BLOCK ; WHEN_CLAUSE_LIST: HWHEN HIDENTIFIER HDO {} BLOCK | WHEN_CLAUSE_LIST HWHEN HIDENTIFIER HDO {} BLOCK ; MBEE_OTWI_CLAUS : /*EMPT*/ | HOTHERWISE {} BLOCK ; ACTIVATOR : HACTIVATE | HREACTIVATE ; SCHEDULE : /*EMPT*/ | ATDELAY EXPRESSION {} PRIOR | BEFOREAFTER {} EXPRESSION ; ATDELAY : HAT | HDELAY ; BEFOREAFTER : HBEFORE | HAFTER ; PRIOR : /*EMPT*/ | HPRIOR ; /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */ MODULSTATEMENT : HWHILE EXPRESSION HDO {} BLOCK | HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART | HFOR HIDENTIFIER HASSIGN {} FOR_LIST HDO {} BLOCK | GOTO EXPRESSION | HINSPECT EXPRESSION {} CONN_STATE_R_PT {} MBEE_OTWI_CLAUS | HINNER | HIDENTIFIER HLABELSEPARATOR {} DECLSTATEMENT | EXPRESSION_SIMP HBEGIN {} IMPORT_SPEC_MODULE {} MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HEND | EXPRESSION_SIMP | ACTIVATOR EXPRESSION SCHEDULE | HBEGIN {} MBEE_DECLSTMS HEND | MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING BLOCK | HIDENTIFIER HCLASS NO_TYPE {} IMPORT_SPEC_MODULE HIDENTIFIER {} HEADING BLOCK | HCLASS NO_TYPE HIDENTIFIER {} HEADING BLOCK | EXT_DECLARATION | /*EMPT*/ ; IMPORT_SPEC_MODULE: ; DECLSTATEMENT : MODULSTATEMENT | TYPE HIDENTIFIER MBEE_CONSTANT HPAREXPSEPARATOR {} IDENTIFIER_LISTC | TYPE HIDENTIFIER MBEE_CONSTANT | MBEE_TYPE HARRAY {} ARR_SEGMENT_LIST | HSWITCH HIDENTIFIER HASSIGN {} SWITCH_LIST ; BLOCK : DECLSTATEMENT | HBEGIN MBEE_DECLSTMS HEND | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | HBEGIN error HEND ; MBEE_DECLSTMS : MBEE_DECLSTMSU ; MBEE_DECLSTMSU : DECLSTATEMENT | MBEE_DECLSTMSU HSTATEMENTSEPARATOR DECLSTATEMENT ; MODULS : MODULSTATEMENT | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT ; /* GRAMATIKK FOR DEL AV DEKLARASJONER */ ARR_SEGMENT_LIST: ARR_SEGMENT | ARR_SEGMENT_LIST HPAREXPSEPARATOR ARR_SEGMENT ; ARR_SEGMENT : ARRAY_SEGMENT HBEGPAR BAUND_PAIR_LIST HENDPAR ; ARRAY_SEGMENT : ARRAY_SEGMENT_EL {} | ARRAY_SEGMENT_EL HPAREXPSEPARATOR ARRAY_SEGMENT ; ARRAY_SEGMENT_EL: HIDENTIFIER ; BAUND_PAIR_LIST : BAUND_PAIR | BAUND_PAIR HPAREXPSEPARATOR BAUND_PAIR_LIST ; BAUND_PAIR : EXPRESSION HLABELSEPARATOR EXPRESSION ; SWITCH_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR SWITCH_LIST ; HEADING : MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {} MBEE_MODE_PART {} MBEE_SPEC_PART {} MBEE_PROT_PART {} MBEE_VIRT_PART ; MBEE_FMAL_PAR_P : /*EMPT*/ | FMAL_PAR_PART ; FMAL_PAR_PART : HBEGPAR NO_TYPE MBEE_LISTV HENDPAR ; MBEE_LISTV : /*EMPT*/ | LISTV ; LISTV : HIDENTIFIER | FPP_CATEG HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR LISTV | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_HEADING : HBEGPAR NO_TYPE FPP_MBEE_LISTV HENDPAR ; FPP_MBEE_LISTV : /*EMPT*/ | FPP_LISTV ; FPP_LISTV : FPP_CATEG HDOTDOTDOT | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_SPEC : FPP_CATEG SPECIFIER HIDENTIFIER | FPP_CATEG FPP_PROC_DECL_IN_SPEC ; FPP_CATEG : HNAME HLABELSEPARATOR | HVALUE HLABELSEPARATOR | HVAR HLABELSEPARATOR | /*EMPT*/ ; FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} FPP_HEADING {} { /* Yes, two "final" actions. */ } ; IDENTIFIER_LISTV: HIDENTIFIER | HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR IDENTIFIER_LISTV ; MBEE_MODE_PART : /*EMPT*/ | MODE_PART ; MODE_PART : NAME_PART | VALUE_PART | VAR_PART | NAME_PART VALUE_PART | VALUE_PART NAME_PART | NAME_PART VAR_PART | VAR_PART NAME_PART | VALUE_PART VAR_PART | VAR_PART VALUE_PART | VAR_PART NAME_PART VALUE_PART | NAME_PART VAR_PART VALUE_PART | NAME_PART VALUE_PART VAR_PART | VAR_PART VALUE_PART NAME_PART | VALUE_PART VAR_PART NAME_PART | VALUE_PART NAME_PART VAR_PART ; NAME_PART : HNAME {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VAR_PART : HVAR {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VALUE_PART : HVALUE {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; MBEE_SPEC_PART : /*EMPT*/ | SPEC_PART ; SPEC_PART : ONE_SPEC | SPEC_PART ONE_SPEC ; ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR {} PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR IDENTIFIER_LIST HSTATEMENTSEPARATOR ; SPECIFIER : TYPE | MBEE_TYPE HARRAY | HLABEL | HSWITCH ; PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING {} MBEE_BEGIN_END ; MBEE_BEGIN_END : /* EMPTY */ | HBEGIN HEND ; MBEE_PROT_PART : /*EMPT*/ | PROTECTION_PART ; PROTECTION_PART : PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | PROTECTION_PART PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR ; PROT_SPECIFIER : HHIDDEN | HPROTECTED | HHIDDEN HPROTECTED | HPROTECTED HHIDDEN ; MBEE_VIRT_PART : /*EMPT*/ | VIRTUAL_PART ; VIRTUAL_PART : HVIRTUAL HLABELSEPARATOR MBEE_SPEC_PART ; IDENTIFIER_LIST : HIDENTIFIER | IDENTIFIER_LIST HPAREXPSEPARATOR HIDENTIFIER ; IDENTIFIER_LISTC: HIDENTIFIER MBEE_CONSTANT | IDENTIFIER_LISTC HPAREXPSEPARATOR HIDENTIFIER MBEE_CONSTANT ; MBEE_CONSTANT : /* EMPTY */ | HVALRELOPERATOR {} EXPRESSION ; /* GRAMATIKK FOR UTTRYKK */ EXPRESSION : EXPRESSION_SIMP | HIF EXPRESSION HTHEN EXPRESSION HELSE EXPRESSION ; EXPRESSION_SIMP : EXPRESSION_SIMP HASSIGN EXPRESSION | EXPRESSION_SIMP HCONC EXPRESSION_SIMP | EXPRESSION_SIMP HOR HELSE EXPRESSION_SIMP %prec HORELSE | EXPRESSION_SIMP HAND HTHEN EXPRESSION_SIMP %prec HANDTHEN | EXPRESSION_SIMP HEQV EXPRESSION_SIMP | EXPRESSION_SIMP HIMP EXPRESSION_SIMP | EXPRESSION_SIMP HOR EXPRESSION_SIMP | EXPRESSION_SIMP HAND EXPRESSION_SIMP | HNOT EXPRESSION_SIMP | EXPRESSION_SIMP HVALRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HREFRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HOBJRELOPERATOR EXPRESSION_SIMP | HTERMOPERATOR EXPRESSION_SIMP %prec UNEAR | EXPRESSION_SIMP HTERMOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HFACTOROPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HPRIMARYOPERATOR EXPRESSION_SIMP | HBEGPAR EXPRESSION HENDPAR | HTEXTKONST | HCHARACTERKONST | HREALKONST | HINTEGERKONST | HBOOLEANKONST | HNONE | HIDENTIFIER {} MBEE_ARG_R_PT | HTHIS HIDENTIFIER | HNEW HIDENTIFIER ARG_R_PT | EXPRESSION_SIMP HDOT EXPRESSION_SIMP | EXPRESSION_SIMP HQUA HIDENTIFIER ; ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; MBEE_ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; ARGUMENT_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR ARGUMENT_LIST ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "442 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; grep '^State.*conflicts:' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce State 164 conflicts: 1 shift/reduce State 201 conflicts: 33 shift/reduce, 4 reduce/reduce State 206 conflicts: 1 shift/reduce State 240 conflicts: 1 shift/reduce State 335 conflicts: 9 shift/reduce, 2 reduce/reduce State 356 conflicts: 1 shift/reduce State 360 conflicts: 9 shift/reduce, 2 reduce/reduce State 427 conflicts: 9 shift/reduce, 2 reduce/reduce " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_262 #AT_START_263 at_fn_group_banner 263 'existing.at:783' \ "GNU Cim Grammar: IELR(1)" " " 16 at_xfail=no ( $as_echo "263. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %token HACTIVATE HAFTER /*HAND*/ HARRAY HAT HBEFORE HBEGIN HBOOLEAN HCHARACTER HCLASS /*HCOMMENT*/ HCONC HDELAY HDO HELSE HEND HEQ /*HEQV*/ HEXTERNAL HFOR HGE HGO HGOTO HGT HHIDDEN HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS HLABEL HLE HLONG HLT HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT /*HOR*/ HOTHERWISE HPRIOR HPROCEDURE HPROTECTED HQUA HREACTIVATE HREAL HREF HSHORT HSTEP HSWITCH HTEXT HTHEN HTHIS HTO HUNTIL HVALUE HVAR HVIRTUAL HWHEN HWHILE HASSIGNVALUE HASSIGNREF /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR HBEGPAR HENDPAR HEQR HNER HADD HSUB HMUL HDIV HINTDIV HEXP HDOTDOTDOT %token HIDENTIFIER %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST %token HREALKONST %token HTEXTKONST %right HASSIGN %left HORELSE %left HANDTHEN %left HEQV %left HIMP %left HOR %left HAND %left HNOT %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR %left HCONC %left HTERMOPERATOR %left UNEAR %left HFACTOROPERATOR %left HPRIMARYOPERATOR %left HQUA %left HDOT %start MAIN_MODULE %% /* GRAMATIKK FOR PROGRAM MODULES */ MAIN_MODULE : {} MODULS | error HSTATEMENTSEPARATOR MBEE_DECLSTMS ; EXT_DECLARATION : HEXTERNAL MBEE_TYPE HPROCEDURE {} EXT_LIST | HEXTERNAL HIDENTIFIER HPROCEDURE {} HIDENTIFIER {} EXTERNAL_KIND_ITEM | HEXTERNAL HCLASS {} EXT_LIST ; EXTERNAL_KIND_ITEM: EXT_IDENT HOBJRELOPERATOR {} MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING EMPTY_BLOCK {} /* | EXT_IDENT {} MBEE_REST_EXT_LIST ; MBEE_REST_EXT_LIST: /* EMPTY | HPAREXPSEPARATOR EXT_KIND_LIST ; EXT_KIND_LIST : EXT_KIND_ITEM | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM ; EXT_KIND_ITEM : HIDENTIFIER EXT_IDENT {}*/ ; EMPTY_BLOCK : /*EMPT*/ | HBEGIN HEND ; EXT_LIST : EXT_ITEM | EXT_LIST HPAREXPSEPARATOR EXT_ITEM ; EXT_ITEM : HIDENTIFIER EXT_IDENT ; EXT_IDENT : /* EMPTY */ | HVALRELOPERATOR {} HTEXTKONST ; /* GRAMATIKK FOR TYPER */ NO_TYPE : /*EMPT*/ ; MBEE_TYPE : NO_TYPE | TYPE ; TYPE : HREF HBEGPAR HIDENTIFIER {} HENDPAR | HTEXT | HBOOLEAN | HCHARACTER | HSHORT HINTEGER | HINTEGER | HREAL | HLONG HREAL ; /* GRAMATIKK FOR DEL AV SETNINGER */ MBEE_ELSE_PART : /*EMPT*/ /* | HELSE HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART {}*/ | HELSE {} BLOCK ; FOR_LIST : FOR_LIST_ELEMENT | FOR_LIST_ELEMENT HPAREXPSEPARATOR FOR_LIST ; FOR_LIST_ELEMENT: EXPRESSION MBEE_F_L_EL_R_PT ; MBEE_F_L_EL_R_PT: /*EMPT*/ | HWHILE EXPRESSION | HSTEP EXPRESSION HUNTIL EXPRESSION ; GOTO : HGO HTO | HGOTO ; CONN_STATE_R_PT : WHEN_CLAUSE_LIST | HDO {} BLOCK ; WHEN_CLAUSE_LIST: HWHEN HIDENTIFIER HDO {} BLOCK | WHEN_CLAUSE_LIST HWHEN HIDENTIFIER HDO {} BLOCK ; MBEE_OTWI_CLAUS : /*EMPT*/ | HOTHERWISE {} BLOCK ; ACTIVATOR : HACTIVATE | HREACTIVATE ; SCHEDULE : /*EMPT*/ | ATDELAY EXPRESSION {} PRIOR | BEFOREAFTER {} EXPRESSION ; ATDELAY : HAT | HDELAY ; BEFOREAFTER : HBEFORE | HAFTER ; PRIOR : /*EMPT*/ | HPRIOR ; /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */ MODULSTATEMENT : HWHILE EXPRESSION HDO {} BLOCK | HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART | HFOR HIDENTIFIER HASSIGN {} FOR_LIST HDO {} BLOCK | GOTO EXPRESSION | HINSPECT EXPRESSION {} CONN_STATE_R_PT {} MBEE_OTWI_CLAUS | HINNER | HIDENTIFIER HLABELSEPARATOR {} DECLSTATEMENT | EXPRESSION_SIMP HBEGIN {} IMPORT_SPEC_MODULE {} MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HEND | EXPRESSION_SIMP | ACTIVATOR EXPRESSION SCHEDULE | HBEGIN {} MBEE_DECLSTMS HEND | MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING BLOCK | HIDENTIFIER HCLASS NO_TYPE {} IMPORT_SPEC_MODULE HIDENTIFIER {} HEADING BLOCK | HCLASS NO_TYPE HIDENTIFIER {} HEADING BLOCK | EXT_DECLARATION | /*EMPT*/ ; IMPORT_SPEC_MODULE: ; DECLSTATEMENT : MODULSTATEMENT | TYPE HIDENTIFIER MBEE_CONSTANT HPAREXPSEPARATOR {} IDENTIFIER_LISTC | TYPE HIDENTIFIER MBEE_CONSTANT | MBEE_TYPE HARRAY {} ARR_SEGMENT_LIST | HSWITCH HIDENTIFIER HASSIGN {} SWITCH_LIST ; BLOCK : DECLSTATEMENT | HBEGIN MBEE_DECLSTMS HEND | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | HBEGIN error HEND ; MBEE_DECLSTMS : MBEE_DECLSTMSU ; MBEE_DECLSTMSU : DECLSTATEMENT | MBEE_DECLSTMSU HSTATEMENTSEPARATOR DECLSTATEMENT ; MODULS : MODULSTATEMENT | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT ; /* GRAMATIKK FOR DEL AV DEKLARASJONER */ ARR_SEGMENT_LIST: ARR_SEGMENT | ARR_SEGMENT_LIST HPAREXPSEPARATOR ARR_SEGMENT ; ARR_SEGMENT : ARRAY_SEGMENT HBEGPAR BAUND_PAIR_LIST HENDPAR ; ARRAY_SEGMENT : ARRAY_SEGMENT_EL {} | ARRAY_SEGMENT_EL HPAREXPSEPARATOR ARRAY_SEGMENT ; ARRAY_SEGMENT_EL: HIDENTIFIER ; BAUND_PAIR_LIST : BAUND_PAIR | BAUND_PAIR HPAREXPSEPARATOR BAUND_PAIR_LIST ; BAUND_PAIR : EXPRESSION HLABELSEPARATOR EXPRESSION ; SWITCH_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR SWITCH_LIST ; HEADING : MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {} MBEE_MODE_PART {} MBEE_SPEC_PART {} MBEE_PROT_PART {} MBEE_VIRT_PART ; MBEE_FMAL_PAR_P : /*EMPT*/ | FMAL_PAR_PART ; FMAL_PAR_PART : HBEGPAR NO_TYPE MBEE_LISTV HENDPAR ; MBEE_LISTV : /*EMPT*/ | LISTV ; LISTV : HIDENTIFIER | FPP_CATEG HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR LISTV | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_HEADING : HBEGPAR NO_TYPE FPP_MBEE_LISTV HENDPAR ; FPP_MBEE_LISTV : /*EMPT*/ | FPP_LISTV ; FPP_LISTV : FPP_CATEG HDOTDOTDOT | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_SPEC : FPP_CATEG SPECIFIER HIDENTIFIER | FPP_CATEG FPP_PROC_DECL_IN_SPEC ; FPP_CATEG : HNAME HLABELSEPARATOR | HVALUE HLABELSEPARATOR | HVAR HLABELSEPARATOR | /*EMPT*/ ; FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} FPP_HEADING {} { /* Yes, two "final" actions. */ } ; IDENTIFIER_LISTV: HIDENTIFIER | HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR IDENTIFIER_LISTV ; MBEE_MODE_PART : /*EMPT*/ | MODE_PART ; MODE_PART : NAME_PART | VALUE_PART | VAR_PART | NAME_PART VALUE_PART | VALUE_PART NAME_PART | NAME_PART VAR_PART | VAR_PART NAME_PART | VALUE_PART VAR_PART | VAR_PART VALUE_PART | VAR_PART NAME_PART VALUE_PART | NAME_PART VAR_PART VALUE_PART | NAME_PART VALUE_PART VAR_PART | VAR_PART VALUE_PART NAME_PART | VALUE_PART VAR_PART NAME_PART | VALUE_PART NAME_PART VAR_PART ; NAME_PART : HNAME {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VAR_PART : HVAR {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VALUE_PART : HVALUE {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; MBEE_SPEC_PART : /*EMPT*/ | SPEC_PART ; SPEC_PART : ONE_SPEC | SPEC_PART ONE_SPEC ; ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR {} PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR IDENTIFIER_LIST HSTATEMENTSEPARATOR ; SPECIFIER : TYPE | MBEE_TYPE HARRAY | HLABEL | HSWITCH ; PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING {} MBEE_BEGIN_END ; MBEE_BEGIN_END : /* EMPTY */ | HBEGIN HEND ; MBEE_PROT_PART : /*EMPT*/ | PROTECTION_PART ; PROTECTION_PART : PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | PROTECTION_PART PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR ; PROT_SPECIFIER : HHIDDEN | HPROTECTED | HHIDDEN HPROTECTED | HPROTECTED HHIDDEN ; MBEE_VIRT_PART : /*EMPT*/ | VIRTUAL_PART ; VIRTUAL_PART : HVIRTUAL HLABELSEPARATOR MBEE_SPEC_PART ; IDENTIFIER_LIST : HIDENTIFIER | IDENTIFIER_LIST HPAREXPSEPARATOR HIDENTIFIER ; IDENTIFIER_LISTC: HIDENTIFIER MBEE_CONSTANT | IDENTIFIER_LISTC HPAREXPSEPARATOR HIDENTIFIER MBEE_CONSTANT ; MBEE_CONSTANT : /* EMPTY */ | HVALRELOPERATOR {} EXPRESSION ; /* GRAMATIKK FOR UTTRYKK */ EXPRESSION : EXPRESSION_SIMP | HIF EXPRESSION HTHEN EXPRESSION HELSE EXPRESSION ; EXPRESSION_SIMP : EXPRESSION_SIMP HASSIGN EXPRESSION | EXPRESSION_SIMP HCONC EXPRESSION_SIMP | EXPRESSION_SIMP HOR HELSE EXPRESSION_SIMP %prec HORELSE | EXPRESSION_SIMP HAND HTHEN EXPRESSION_SIMP %prec HANDTHEN | EXPRESSION_SIMP HEQV EXPRESSION_SIMP | EXPRESSION_SIMP HIMP EXPRESSION_SIMP | EXPRESSION_SIMP HOR EXPRESSION_SIMP | EXPRESSION_SIMP HAND EXPRESSION_SIMP | HNOT EXPRESSION_SIMP | EXPRESSION_SIMP HVALRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HREFRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HOBJRELOPERATOR EXPRESSION_SIMP | HTERMOPERATOR EXPRESSION_SIMP %prec UNEAR | EXPRESSION_SIMP HTERMOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HFACTOROPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HPRIMARYOPERATOR EXPRESSION_SIMP | HBEGPAR EXPRESSION HENDPAR | HTEXTKONST | HCHARACTERKONST | HREALKONST | HINTEGERKONST | HBOOLEANKONST | HNONE | HIDENTIFIER {} MBEE_ARG_R_PT | HTHIS HIDENTIFIER | HNEW HIDENTIFIER ARG_R_PT | EXPRESSION_SIMP HDOT EXPRESSION_SIMP | EXPRESSION_SIMP HQUA HIDENTIFIER ; ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; MBEE_ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; ARGUMENT_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR ARGUMENT_LIST ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "442 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; grep '^State.*conflicts:' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce State 164 conflicts: 1 shift/reduce State 201 conflicts: 33 shift/reduce, 4 reduce/reduce State 206 conflicts: 1 shift/reduce State 240 conflicts: 1 shift/reduce State 335 conflicts: 9 shift/reduce, 2 reduce/reduce State 356 conflicts: 1 shift/reduce State 360 conflicts: 9 shift/reduce, 2 reduce/reduce State 427 conflicts: 9 shift/reduce, 2 reduce/reduce " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_263 #AT_START_264 at_fn_group_banner 264 'existing.at:783' \ "GNU Cim Grammar: Canonical LR(1)" " " 16 at_xfail=no ( $as_echo "264. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %token HACTIVATE HAFTER /*HAND*/ HARRAY HAT HBEFORE HBEGIN HBOOLEAN HCHARACTER HCLASS /*HCOMMENT*/ HCONC HDELAY HDO HELSE HEND HEQ /*HEQV*/ HEXTERNAL HFOR HGE HGO HGOTO HGT HHIDDEN HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS HLABEL HLE HLONG HLT HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT /*HOR*/ HOTHERWISE HPRIOR HPROCEDURE HPROTECTED HQUA HREACTIVATE HREAL HREF HSHORT HSTEP HSWITCH HTEXT HTHEN HTHIS HTO HUNTIL HVALUE HVAR HVIRTUAL HWHEN HWHILE HASSIGNVALUE HASSIGNREF /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR HBEGPAR HENDPAR HEQR HNER HADD HSUB HMUL HDIV HINTDIV HEXP HDOTDOTDOT %token HIDENTIFIER %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST %token HREALKONST %token HTEXTKONST %right HASSIGN %left HORELSE %left HANDTHEN %left HEQV %left HIMP %left HOR %left HAND %left HNOT %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR %left HCONC %left HTERMOPERATOR %left UNEAR %left HFACTOROPERATOR %left HPRIMARYOPERATOR %left HQUA %left HDOT %start MAIN_MODULE %% /* GRAMATIKK FOR PROGRAM MODULES */ MAIN_MODULE : {} MODULS | error HSTATEMENTSEPARATOR MBEE_DECLSTMS ; EXT_DECLARATION : HEXTERNAL MBEE_TYPE HPROCEDURE {} EXT_LIST | HEXTERNAL HIDENTIFIER HPROCEDURE {} HIDENTIFIER {} EXTERNAL_KIND_ITEM | HEXTERNAL HCLASS {} EXT_LIST ; EXTERNAL_KIND_ITEM: EXT_IDENT HOBJRELOPERATOR {} MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING EMPTY_BLOCK {} /* | EXT_IDENT {} MBEE_REST_EXT_LIST ; MBEE_REST_EXT_LIST: /* EMPTY | HPAREXPSEPARATOR EXT_KIND_LIST ; EXT_KIND_LIST : EXT_KIND_ITEM | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM ; EXT_KIND_ITEM : HIDENTIFIER EXT_IDENT {}*/ ; EMPTY_BLOCK : /*EMPT*/ | HBEGIN HEND ; EXT_LIST : EXT_ITEM | EXT_LIST HPAREXPSEPARATOR EXT_ITEM ; EXT_ITEM : HIDENTIFIER EXT_IDENT ; EXT_IDENT : /* EMPTY */ | HVALRELOPERATOR {} HTEXTKONST ; /* GRAMATIKK FOR TYPER */ NO_TYPE : /*EMPT*/ ; MBEE_TYPE : NO_TYPE | TYPE ; TYPE : HREF HBEGPAR HIDENTIFIER {} HENDPAR | HTEXT | HBOOLEAN | HCHARACTER | HSHORT HINTEGER | HINTEGER | HREAL | HLONG HREAL ; /* GRAMATIKK FOR DEL AV SETNINGER */ MBEE_ELSE_PART : /*EMPT*/ /* | HELSE HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART {}*/ | HELSE {} BLOCK ; FOR_LIST : FOR_LIST_ELEMENT | FOR_LIST_ELEMENT HPAREXPSEPARATOR FOR_LIST ; FOR_LIST_ELEMENT: EXPRESSION MBEE_F_L_EL_R_PT ; MBEE_F_L_EL_R_PT: /*EMPT*/ | HWHILE EXPRESSION | HSTEP EXPRESSION HUNTIL EXPRESSION ; GOTO : HGO HTO | HGOTO ; CONN_STATE_R_PT : WHEN_CLAUSE_LIST | HDO {} BLOCK ; WHEN_CLAUSE_LIST: HWHEN HIDENTIFIER HDO {} BLOCK | WHEN_CLAUSE_LIST HWHEN HIDENTIFIER HDO {} BLOCK ; MBEE_OTWI_CLAUS : /*EMPT*/ | HOTHERWISE {} BLOCK ; ACTIVATOR : HACTIVATE | HREACTIVATE ; SCHEDULE : /*EMPT*/ | ATDELAY EXPRESSION {} PRIOR | BEFOREAFTER {} EXPRESSION ; ATDELAY : HAT | HDELAY ; BEFOREAFTER : HBEFORE | HAFTER ; PRIOR : /*EMPT*/ | HPRIOR ; /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */ MODULSTATEMENT : HWHILE EXPRESSION HDO {} BLOCK | HIF EXPRESSION HTHEN {} BLOCK {} MBEE_ELSE_PART | HFOR HIDENTIFIER HASSIGN {} FOR_LIST HDO {} BLOCK | GOTO EXPRESSION | HINSPECT EXPRESSION {} CONN_STATE_R_PT {} MBEE_OTWI_CLAUS | HINNER | HIDENTIFIER HLABELSEPARATOR {} DECLSTATEMENT | EXPRESSION_SIMP HBEGIN {} IMPORT_SPEC_MODULE {} MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | EXPRESSION_SIMP HBEGIN error HEND | EXPRESSION_SIMP | ACTIVATOR EXPRESSION SCHEDULE | HBEGIN {} MBEE_DECLSTMS HEND | MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING BLOCK | HIDENTIFIER HCLASS NO_TYPE {} IMPORT_SPEC_MODULE HIDENTIFIER {} HEADING BLOCK | HCLASS NO_TYPE HIDENTIFIER {} HEADING BLOCK | EXT_DECLARATION | /*EMPT*/ ; IMPORT_SPEC_MODULE: ; DECLSTATEMENT : MODULSTATEMENT | TYPE HIDENTIFIER MBEE_CONSTANT HPAREXPSEPARATOR {} IDENTIFIER_LISTC | TYPE HIDENTIFIER MBEE_CONSTANT | MBEE_TYPE HARRAY {} ARR_SEGMENT_LIST | HSWITCH HIDENTIFIER HASSIGN {} SWITCH_LIST ; BLOCK : DECLSTATEMENT | HBEGIN MBEE_DECLSTMS HEND | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND | HBEGIN error HEND ; MBEE_DECLSTMS : MBEE_DECLSTMSU ; MBEE_DECLSTMSU : DECLSTATEMENT | MBEE_DECLSTMSU HSTATEMENTSEPARATOR DECLSTATEMENT ; MODULS : MODULSTATEMENT | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT ; /* GRAMATIKK FOR DEL AV DEKLARASJONER */ ARR_SEGMENT_LIST: ARR_SEGMENT | ARR_SEGMENT_LIST HPAREXPSEPARATOR ARR_SEGMENT ; ARR_SEGMENT : ARRAY_SEGMENT HBEGPAR BAUND_PAIR_LIST HENDPAR ; ARRAY_SEGMENT : ARRAY_SEGMENT_EL {} | ARRAY_SEGMENT_EL HPAREXPSEPARATOR ARRAY_SEGMENT ; ARRAY_SEGMENT_EL: HIDENTIFIER ; BAUND_PAIR_LIST : BAUND_PAIR | BAUND_PAIR HPAREXPSEPARATOR BAUND_PAIR_LIST ; BAUND_PAIR : EXPRESSION HLABELSEPARATOR EXPRESSION ; SWITCH_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR SWITCH_LIST ; HEADING : MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {} MBEE_MODE_PART {} MBEE_SPEC_PART {} MBEE_PROT_PART {} MBEE_VIRT_PART ; MBEE_FMAL_PAR_P : /*EMPT*/ | FMAL_PAR_PART ; FMAL_PAR_PART : HBEGPAR NO_TYPE MBEE_LISTV HENDPAR ; MBEE_LISTV : /*EMPT*/ | LISTV ; LISTV : HIDENTIFIER | FPP_CATEG HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR LISTV | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_HEADING : HBEGPAR NO_TYPE FPP_MBEE_LISTV HENDPAR ; FPP_MBEE_LISTV : /*EMPT*/ | FPP_LISTV ; FPP_LISTV : FPP_CATEG HDOTDOTDOT | FPP_SPEC | FPP_SPEC HPAREXPSEPARATOR LISTV ; FPP_SPEC : FPP_CATEG SPECIFIER HIDENTIFIER | FPP_CATEG FPP_PROC_DECL_IN_SPEC ; FPP_CATEG : HNAME HLABELSEPARATOR | HVALUE HLABELSEPARATOR | HVAR HLABELSEPARATOR | /*EMPT*/ ; FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} FPP_HEADING {} { /* Yes, two "final" actions. */ } ; IDENTIFIER_LISTV: HIDENTIFIER | HDOTDOTDOT | HIDENTIFIER {} HPAREXPSEPARATOR IDENTIFIER_LISTV ; MBEE_MODE_PART : /*EMPT*/ | MODE_PART ; MODE_PART : NAME_PART | VALUE_PART | VAR_PART | NAME_PART VALUE_PART | VALUE_PART NAME_PART | NAME_PART VAR_PART | VAR_PART NAME_PART | VALUE_PART VAR_PART | VAR_PART VALUE_PART | VAR_PART NAME_PART VALUE_PART | NAME_PART VAR_PART VALUE_PART | NAME_PART VALUE_PART VAR_PART | VAR_PART VALUE_PART NAME_PART | VALUE_PART VAR_PART NAME_PART | VALUE_PART NAME_PART VAR_PART ; NAME_PART : HNAME {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VAR_PART : HVAR {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; VALUE_PART : HVALUE {} IDENTIFIER_LISTV HSTATEMENTSEPARATOR ; MBEE_SPEC_PART : /*EMPT*/ | SPEC_PART ; SPEC_PART : ONE_SPEC | SPEC_PART ONE_SPEC ; ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR {} PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR IDENTIFIER_LIST HSTATEMENTSEPARATOR ; SPECIFIER : TYPE | MBEE_TYPE HARRAY | HLABEL | HSWITCH ; PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE HIDENTIFIER {} HEADING {} MBEE_BEGIN_END ; MBEE_BEGIN_END : /* EMPTY */ | HBEGIN HEND ; MBEE_PROT_PART : /*EMPT*/ | PROTECTION_PART ; PROTECTION_PART : PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR | PROTECTION_PART PROT_SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR ; PROT_SPECIFIER : HHIDDEN | HPROTECTED | HHIDDEN HPROTECTED | HPROTECTED HHIDDEN ; MBEE_VIRT_PART : /*EMPT*/ | VIRTUAL_PART ; VIRTUAL_PART : HVIRTUAL HLABELSEPARATOR MBEE_SPEC_PART ; IDENTIFIER_LIST : HIDENTIFIER | IDENTIFIER_LIST HPAREXPSEPARATOR HIDENTIFIER ; IDENTIFIER_LISTC: HIDENTIFIER MBEE_CONSTANT | IDENTIFIER_LISTC HPAREXPSEPARATOR HIDENTIFIER MBEE_CONSTANT ; MBEE_CONSTANT : /* EMPTY */ | HVALRELOPERATOR {} EXPRESSION ; /* GRAMATIKK FOR UTTRYKK */ EXPRESSION : EXPRESSION_SIMP | HIF EXPRESSION HTHEN EXPRESSION HELSE EXPRESSION ; EXPRESSION_SIMP : EXPRESSION_SIMP HASSIGN EXPRESSION | EXPRESSION_SIMP HCONC EXPRESSION_SIMP | EXPRESSION_SIMP HOR HELSE EXPRESSION_SIMP %prec HORELSE | EXPRESSION_SIMP HAND HTHEN EXPRESSION_SIMP %prec HANDTHEN | EXPRESSION_SIMP HEQV EXPRESSION_SIMP | EXPRESSION_SIMP HIMP EXPRESSION_SIMP | EXPRESSION_SIMP HOR EXPRESSION_SIMP | EXPRESSION_SIMP HAND EXPRESSION_SIMP | HNOT EXPRESSION_SIMP | EXPRESSION_SIMP HVALRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HREFRELOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HOBJRELOPERATOR EXPRESSION_SIMP | HTERMOPERATOR EXPRESSION_SIMP %prec UNEAR | EXPRESSION_SIMP HTERMOPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HFACTOROPERATOR EXPRESSION_SIMP | EXPRESSION_SIMP HPRIMARYOPERATOR EXPRESSION_SIMP | HBEGPAR EXPRESSION HENDPAR | HTEXTKONST | HCHARACTERKONST | HREALKONST | HINTEGERKONST | HBOOLEANKONST | HNONE | HIDENTIFIER {} MBEE_ARG_R_PT | HTHIS HIDENTIFIER | HNEW HIDENTIFIER ARG_R_PT | EXPRESSION_SIMP HDOT EXPRESSION_SIMP | EXPRESSION_SIMP HQUA HIDENTIFIER ; ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; MBEE_ARG_R_PT : /*EMPTY*/ | HBEGPAR ARGUMENT_LIST HENDPAR ; ARGUMENT_LIST : EXPRESSION | EXPRESSION HPAREXPSEPARATOR ARGUMENT_LIST ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "10425 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:783" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_264 #AT_START_265 at_fn_group_banner 265 'existing.at:1403' \ "GNU pic (Groff 1.18.1) Grammar: LALR(1)" " " 16 at_xfail=no ( $as_echo "265. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type lalr %error-verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg `line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that `label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "422 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected LEFT " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_265 #AT_START_266 at_fn_group_banner 266 'existing.at:1403' \ "GNU pic (Groff 1.18.1) Grammar: IELR(1)" " " 16 at_xfail=no ( $as_echo "266. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type ielr %error-verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg `line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that `label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "427 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; diff -u /dev/null /dev/null || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403" ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; bison --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; diff -u input-lalr.output input.output \ | sed -n '/^@@/,$p' | sed 's/^ $//' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "@@ -1223,7 +1223,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -1377,7 +1377,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -1854,7 +1854,7 @@ text go to state 162 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -2047,7 +2047,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -2571,7 +2571,7 @@ position_not_place go to state 99 expr_pair go to state 191 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -2732,7 +2732,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -2875,7 +2875,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -3018,7 +3018,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -3256,7 +3256,7 @@ State 102 - 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', ',', '>', '+', '-', '!', ';', '}', ']', ')'] + 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', '+', '-', '!', ';', '}', ']'] 147 | label . corner 153 label: label . '.' LABEL 180 corner: . DOT_N @@ -3645,7 +3645,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -3804,7 +3804,7 @@ text_expr go to state 239 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -4481,7 +4481,7 @@ \$default reduce using rule 89 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -4673,7 +4673,7 @@ \$default reduce using rule 91 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -4867,7 +4867,7 @@ \$default reduce using rule 95 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -5065,7 +5065,7 @@ \$default reduce using rule 93 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -5260,7 +5260,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -5403,7 +5403,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -5546,7 +5546,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -5689,7 +5689,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -6475,7 +6475,7 @@ expr_pair go to state 280 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -6633,7 +6633,7 @@ \$default reduce using rule 105 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -6825,7 +6825,7 @@ \$default reduce using rule 107 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -7017,7 +7017,7 @@ \$default reduce using rule 114 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -7264,7 +7264,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -7408,7 +7408,7 @@ \$default reduce using rule 109 (object_spec) place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -7819,12 +7819,12 @@ position_not_place go to state 296 expr_pair go to state 100 place go to state 297 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 corner go to state 106 - expr go to state 266 + expr go to state 424 State 165 @@ -7987,7 +7987,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8172,7 +8172,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8333,7 +8333,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8494,7 +8494,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8655,7 +8655,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8816,7 +8816,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -8977,7 +8977,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9138,7 +9138,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9299,7 +9299,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9460,7 +9460,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9623,7 +9623,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9784,7 +9784,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -9921,7 +9921,7 @@ \$default reduce using rule 47 (any_expr) - between go to state 237 + between go to state 425 State 193 @@ -10152,7 +10152,7 @@ expr_pair go to state 317 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -10298,7 +10298,7 @@ expr_pair go to state 318 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -10622,7 +10622,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -10765,7 +10765,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -10908,7 +10908,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11051,7 +11051,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11194,7 +11194,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11337,7 +11337,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11480,7 +11480,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11637,7 +11637,7 @@ position_not_place go to state 99 expr_pair go to state 100 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11780,7 +11780,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -11923,7 +11923,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12066,7 +12066,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12209,7 +12209,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12352,7 +12352,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12495,7 +12495,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12638,7 +12638,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -12794,12 +12794,12 @@ position_not_place go to state 99 expr_pair go to state 100 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 corner go to state 106 - expr go to state 266 + expr go to state 424 State 238 @@ -12937,7 +12937,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -13160,7 +13160,7 @@ text_expr go to state 342 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -13319,7 +13319,7 @@ text_expr go to state 344 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -13502,7 +13502,7 @@ text_expr go to state 348 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -13661,7 +13661,7 @@ text_expr go to state 350 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -13804,7 +13804,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -14747,7 +14747,7 @@ position_not_place go to state 99 expr_pair go to state 191 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -15074,7 +15074,7 @@ text go to state 113 expr_pair go to state 365 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -15693,12 +15693,12 @@ position_not_place go to state 99 expr_pair go to state 100 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 corner go to state 106 - expr go to state 266 + expr go to state 424 State 315 @@ -16124,7 +16124,7 @@ \$default reduce using rule 239 (expr) - between go to state 237 + between go to state 425 Conflict between rule 239 and token OF resolved as shift ('<' < OF). Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN). @@ -17234,7 +17234,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -17416,7 +17416,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -17577,7 +17577,7 @@ text_expr go to state 112 text go to state 113 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -17772,12 +17772,12 @@ position_not_place go to state 99 expr_pair go to state 100 place go to state 101 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 corner go to state 106 - expr go to state 266 + expr go to state 424 State 383 @@ -18071,7 +18071,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -18221,7 +18221,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -18830,7 +18830,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -18987,7 +18987,7 @@ '!' shift, and go to state 94 place go to state 114 - label go to state 102 + label go to state 423 ordinal go to state 103 optional_ordinal_last go to state 104 nth_primitive go to state 105 @@ -19089,3 +19089,440 @@ 29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO \$@6 DELIMITED . \$default reduce using rule 29 (placeless_element) + + +State 423 + + 146 place: label . [\$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', ']', ')'] + 147 | label . corner + 153 label: label . '.' LABEL + 180 corner: . DOT_N + 181 | . DOT_E + 182 | . DOT_W + 183 | . DOT_S + 184 | . DOT_NE + 185 | . DOT_SE + 186 | . DOT_NW + 187 | . DOT_SW + 188 | . DOT_C + 189 | . DOT_START + 190 | . DOT_END + 191 | . TOP + 192 | . BOTTOM + 193 | . LEFT + 194 | . RIGHT + 195 | . UPPER LEFT + 196 | . LOWER LEFT + 197 | . UPPER RIGHT + 198 | . LOWER RIGHT + 199 | . LEFT_CORNER + 200 | . RIGHT_CORNER + 201 | . UPPER LEFT_CORNER + 202 | . LOWER LEFT_CORNER + 203 | . UPPER RIGHT_CORNER + 204 | . LOWER RIGHT_CORNER + 205 | . NORTH + 206 | . SOUTH + 207 | . EAST + 208 | . WEST + 209 | . CENTER + 210 | . START + 211 | . END + + LEFT shift, and go to state 53 + RIGHT shift, and go to state 54 + DOT_N shift, and go to state 56 + DOT_E shift, and go to state 57 + DOT_W shift, and go to state 58 + DOT_S shift, and go to state 59 + DOT_NE shift, and go to state 60 + DOT_SE shift, and go to state 61 + DOT_NW shift, and go to state 62 + DOT_SW shift, and go to state 63 + DOT_C shift, and go to state 64 + DOT_START shift, and go to state 65 + DOT_END shift, and go to state 66 + TOP shift, and go to state 78 + BOTTOM shift, and go to state 79 + UPPER shift, and go to state 80 + LOWER shift, and go to state 81 + LEFT_CORNER shift, and go to state 82 + RIGHT_CORNER shift, and go to state 83 + NORTH shift, and go to state 84 + SOUTH shift, and go to state 85 + EAST shift, and go to state 86 + WEST shift, and go to state 87 + CENTER shift, and go to state 88 + END shift, and go to state 89 + START shift, and go to state 90 + '.' shift, and go to state 204 + + \$default reduce using rule 146 (place) + + corner go to state 205 + + +State 424 + + 140 position_not_place: expr . between position AND position + 141 | expr . '<' position ',' position '>' + 142 between: . BETWEEN + 143 | . OF THE WAY BETWEEN + 144 expr_pair: expr . ',' expr + 219 expr: expr . '+' expr + 220 | expr . '-' expr + 221 | expr . '*' expr + 222 | expr . '/' expr + 223 | expr . '%' expr + 224 | expr . '^' expr + 239 | expr . '<' expr + 240 | expr . LESSEQUAL expr + 241 | expr . '>' expr + 242 | expr . GREATEREQUAL expr + 243 | expr . EQUALEQUAL expr + 244 | expr . NOTEQUAL expr + 245 | expr . ANDAND expr + 246 | expr . OROR expr + + OF shift, and go to state 220 + BETWEEN shift, and go to state 221 + ANDAND shift, and go to state 222 + OROR shift, and go to state 223 + NOTEQUAL shift, and go to state 224 + EQUALEQUAL shift, and go to state 225 + LESSEQUAL shift, and go to state 226 + GREATEREQUAL shift, and go to state 227 + ',' shift, and go to state 228 + '<' shift, and go to state 229 + '>' shift, and go to state 230 + '+' shift, and go to state 231 + '-' shift, and go to state 232 + '*' shift, and go to state 233 + '/' shift, and go to state 234 + '%' shift, and go to state 235 + '^' shift, and go to state 236 + + between go to state 425 + + +State 425 + + 134 position: . position_not_place + 135 | . place + 136 position_not_place: . expr_pair + 137 | . position '+' expr_pair + 138 | . position '-' expr_pair + 139 | . '(' position ',' position ')' + 140 | . expr between position AND position + 140 | expr between . position AND position + 141 | . expr '<' position ',' position '>' + 144 expr_pair: . expr ',' expr + 145 | . '(' expr_pair ')' + 146 place: . label + 147 | . label corner + 148 | . corner label + 149 | . corner OF label + 150 | . HERE + 151 label: . LABEL + 152 | . nth_primitive + 153 | . label '.' LABEL + 154 ordinal: . ORDINAL + 155 | . '\`' any_expr TH + 156 optional_ordinal_last: . LAST + 157 | . ordinal LAST + 158 nth_primitive: . ordinal object_type + 159 | . optional_ordinal_last object_type + 180 corner: . DOT_N + 181 | . DOT_E + 182 | . DOT_W + 183 | . DOT_S + 184 | . DOT_NE + 185 | . DOT_SE + 186 | . DOT_NW + 187 | . DOT_SW + 188 | . DOT_C + 189 | . DOT_START + 190 | . DOT_END + 191 | . TOP + 192 | . BOTTOM + 193 | . LEFT + 194 | . RIGHT + 195 | . UPPER LEFT + 196 | . LOWER LEFT + 197 | . UPPER RIGHT + 198 | . LOWER RIGHT + 199 | . LEFT_CORNER + 200 | . RIGHT_CORNER + 201 | . UPPER LEFT_CORNER + 202 | . LOWER LEFT_CORNER + 203 | . UPPER RIGHT_CORNER + 204 | . LOWER RIGHT_CORNER + 205 | . NORTH + 206 | . SOUTH + 207 | . EAST + 208 | . WEST + 209 | . CENTER + 210 | . START + 211 | . END + 212 expr: . VARIABLE + 213 | . NUMBER + 214 | . place DOT_X + 215 | . place DOT_Y + 216 | . place DOT_HT + 217 | . place DOT_WID + 218 | . place DOT_RAD + 219 | . expr '+' expr + 220 | . expr '-' expr + 221 | . expr '*' expr + 222 | . expr '/' expr + 223 | . expr '%' expr + 224 | . expr '^' expr + 225 | . '-' expr + 226 | . '(' any_expr ')' + 227 | . SIN '(' any_expr ')' + 228 | . COS '(' any_expr ')' + 229 | . ATAN2 '(' any_expr ',' any_expr ')' + 230 | . LOG '(' any_expr ')' + 231 | . EXP '(' any_expr ')' + 232 | . SQRT '(' any_expr ')' + 233 | . K_MAX '(' any_expr ',' any_expr ')' + 234 | . K_MIN '(' any_expr ',' any_expr ')' + 235 | . INT '(' any_expr ')' + 236 | . RAND '(' any_expr ')' + 237 | . RAND '(' ')' + 238 | . SRAND '(' any_expr ')' + 239 | . expr '<' expr + 240 | . expr LESSEQUAL expr + 241 | . expr '>' expr + 242 | . expr GREATEREQUAL expr + 243 | . expr EQUALEQUAL expr + 244 | . expr NOTEQUAL expr + 245 | . expr ANDAND expr + 246 | . expr OROR expr + 247 | . '!' expr + + LABEL shift, and go to state 48 + VARIABLE shift, and go to state 49 + NUMBER shift, and go to state 50 + ORDINAL shift, and go to state 51 + LAST shift, and go to state 52 + LEFT shift, and go to state 53 + RIGHT shift, and go to state 54 + HERE shift, and go to state 55 + DOT_N shift, and go to state 56 + DOT_E shift, and go to state 57 + DOT_W shift, and go to state 58 + DOT_S shift, and go to state 59 + DOT_NE shift, and go to state 60 + DOT_SE shift, and go to state 61 + DOT_NW shift, and go to state 62 + DOT_SW shift, and go to state 63 + DOT_C shift, and go to state 64 + DOT_START shift, and go to state 65 + DOT_END shift, and go to state 66 + SIN shift, and go to state 67 + COS shift, and go to state 68 + ATAN2 shift, and go to state 69 + LOG shift, and go to state 70 + EXP shift, and go to state 71 + SQRT shift, and go to state 72 + K_MAX shift, and go to state 73 + K_MIN shift, and go to state 74 + INT shift, and go to state 75 + RAND shift, and go to state 76 + SRAND shift, and go to state 77 + TOP shift, and go to state 78 + BOTTOM shift, and go to state 79 + UPPER shift, and go to state 80 + LOWER shift, and go to state 81 + LEFT_CORNER shift, and go to state 82 + RIGHT_CORNER shift, and go to state 83 + NORTH shift, and go to state 84 + SOUTH shift, and go to state 85 + EAST shift, and go to state 86 + WEST shift, and go to state 87 + CENTER shift, and go to state 88 + END shift, and go to state 89 + START shift, and go to state 90 + '(' shift, and go to state 91 + '\`' shift, and go to state 92 + '-' shift, and go to state 93 + '!' shift, and go to state 94 + + position go to state 426 + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 + label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 + expr go to state 424 + + +State 426 + + 137 position_not_place: position . '+' expr_pair + 138 | position . '-' expr_pair + 140 | expr between position . AND position + + AND shift, and go to state 427 + '+' shift, and go to state 197 + '-' shift, and go to state 198 + + +State 427 + + 134 position: . position_not_place + 135 | . place + 136 position_not_place: . expr_pair + 137 | . position '+' expr_pair + 138 | . position '-' expr_pair + 139 | . '(' position ',' position ')' + 140 | . expr between position AND position + 140 | expr between position AND . position + 141 | . expr '<' position ',' position '>' + 144 expr_pair: . expr ',' expr + 145 | . '(' expr_pair ')' + 146 place: . label + 147 | . label corner + 148 | . corner label + 149 | . corner OF label + 150 | . HERE + 151 label: . LABEL + 152 | . nth_primitive + 153 | . label '.' LABEL + 154 ordinal: . ORDINAL + 155 | . '\`' any_expr TH + 156 optional_ordinal_last: . LAST + 157 | . ordinal LAST + 158 nth_primitive: . ordinal object_type + 159 | . optional_ordinal_last object_type + 180 corner: . DOT_N + 181 | . DOT_E + 182 | . DOT_W + 183 | . DOT_S + 184 | . DOT_NE + 185 | . DOT_SE + 186 | . DOT_NW + 187 | . DOT_SW + 188 | . DOT_C + 189 | . DOT_START + 190 | . DOT_END + 191 | . TOP + 192 | . BOTTOM + 193 | . LEFT + 194 | . RIGHT + 195 | . UPPER LEFT + 196 | . LOWER LEFT + 197 | . UPPER RIGHT + 198 | . LOWER RIGHT + 199 | . LEFT_CORNER + 200 | . RIGHT_CORNER + 201 | . UPPER LEFT_CORNER + 202 | . LOWER LEFT_CORNER + 203 | . UPPER RIGHT_CORNER + 204 | . LOWER RIGHT_CORNER + 205 | . NORTH + 206 | . SOUTH + 207 | . EAST + 208 | . WEST + 209 | . CENTER + 210 | . START + 211 | . END + 212 expr: . VARIABLE + 213 | . NUMBER + 214 | . place DOT_X + 215 | . place DOT_Y + 216 | . place DOT_HT + 217 | . place DOT_WID + 218 | . place DOT_RAD + 219 | . expr '+' expr + 220 | . expr '-' expr + 221 | . expr '*' expr + 222 | . expr '/' expr + 223 | . expr '%' expr + 224 | . expr '^' expr + 225 | . '-' expr + 226 | . '(' any_expr ')' + 227 | . SIN '(' any_expr ')' + 228 | . COS '(' any_expr ')' + 229 | . ATAN2 '(' any_expr ',' any_expr ')' + 230 | . LOG '(' any_expr ')' + 231 | . EXP '(' any_expr ')' + 232 | . SQRT '(' any_expr ')' + 233 | . K_MAX '(' any_expr ',' any_expr ')' + 234 | . K_MIN '(' any_expr ',' any_expr ')' + 235 | . INT '(' any_expr ')' + 236 | . RAND '(' any_expr ')' + 237 | . RAND '(' ')' + 238 | . SRAND '(' any_expr ')' + 239 | . expr '<' expr + 240 | . expr LESSEQUAL expr + 241 | . expr '>' expr + 242 | . expr GREATEREQUAL expr + 243 | . expr EQUALEQUAL expr + 244 | . expr NOTEQUAL expr + 245 | . expr ANDAND expr + 246 | . expr OROR expr + 247 | . '!' expr + + LABEL shift, and go to state 48 + VARIABLE shift, and go to state 49 + NUMBER shift, and go to state 50 + ORDINAL shift, and go to state 51 + LAST shift, and go to state 52 + LEFT shift, and go to state 53 + RIGHT shift, and go to state 54 + HERE shift, and go to state 55 + DOT_N shift, and go to state 56 + DOT_E shift, and go to state 57 + DOT_W shift, and go to state 58 + DOT_S shift, and go to state 59 + DOT_NE shift, and go to state 60 + DOT_SE shift, and go to state 61 + DOT_NW shift, and go to state 62 + DOT_SW shift, and go to state 63 + DOT_C shift, and go to state 64 + DOT_START shift, and go to state 65 + DOT_END shift, and go to state 66 + SIN shift, and go to state 67 + COS shift, and go to state 68 + ATAN2 shift, and go to state 69 + LOG shift, and go to state 70 + EXP shift, and go to state 71 + SQRT shift, and go to state 72 + K_MAX shift, and go to state 73 + K_MIN shift, and go to state 74 + INT shift, and go to state 75 + RAND shift, and go to state 76 + SRAND shift, and go to state 77 + TOP shift, and go to state 78 + BOTTOM shift, and go to state 79 + UPPER shift, and go to state 80 + LOWER shift, and go to state 81 + LEFT_CORNER shift, and go to state 82 + RIGHT_CORNER shift, and go to state 83 + NORTH shift, and go to state 84 + SOUTH shift, and go to state 85 + EAST shift, and go to state 86 + WEST shift, and go to state 87 + CENTER shift, and go to state 88 + END shift, and go to state 89 + START shift, and go to state 90 + '(' shift, and go to state 91 + '\`' shift, and go to state 92 + '-' shift, and go to state 93 + '!' shift, and go to state 94 + + position go to state 402 + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 + label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 + expr go to state 424 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. { set +x $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_266 #AT_START_267 at_fn_group_banner 267 'existing.at:1403' \ "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 16 at_xfail=no ( $as_echo "267. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); } %define lr.type canonical-lr %error-verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg `line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that `label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } int main (void) { return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; bison --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "4833 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } # Canonical LR generates very large tables, resulting in very long # files with #line directives that may overflow what the standards # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # # There is no "" around `wc` since some indent the result. if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'` CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'` fi { set +x $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1403" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_267 #AT_START_268 at_fn_group_banner 268 'regression.at:25' \ "Trivial grammars" " " 17 at_xfail=no ( $as_echo "268. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ void yyerror ( const char *msg); int yylex (void); #define YYSTYPE int * %} %error-verbose %% program: 'x'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:43" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:43: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:43" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:44: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:44: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:44" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:45: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:45" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:45: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " "regression.at:45" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:45" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_268 #AT_START_269 at_fn_group_banner 269 'regression.at:55' \ "YYSTYPE typedef" " " 17 at_xfail=no ( $as_echo "269. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ void yyerror ( const char *msg); int yylex (void); typedef union { char const *val; } YYSTYPE; %} %type program %% program: { $$ = ""; }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:73" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:73: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:73" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:74: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:74" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:74: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:74" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:74" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_269 #AT_START_270 at_fn_group_banner 270 'regression.at:85' \ "Early token definitions with --yacc" " " 17 at_xfail=no ( $as_echo "270. $at_setup_line: testing $at_desc ..." $at_traceon # Found in GCJ: they expect the tokens to be defined before the user # prologue, so that they can use the token definitions in it. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ void yyerror ( const char *msg); int yylex (void); %} %union { int val; }; %{ #ifndef MY_TOKEN # error "MY_TOKEN not defined." #endif %} %token MY_TOKEN %% exp: MY_TOKEN; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -y -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:113" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -y -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:113" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:113: bison -y -o input.c input.y" at_fn_check_prepare_trace "regression.at:113" ( $at_check_trace; bison -y -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:114: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:114" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:114" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:114" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_270 #AT_START_271 at_fn_group_banner 271 'regression.at:125' \ "Early token definitions without --yacc" " " 17 at_xfail=no ( $as_echo "271. $at_setup_line: testing $at_desc ..." $at_traceon # Found in GCJ: they expect the tokens to be defined before the user # prologue, so that they can use the token definitions in it. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include void yyerror ( const char *msg); int yylex (void); void print_my_token (void); %} %union { int val; }; %{ void print_my_token (void) { enum yytokentype my_token = MY_TOKEN; printf ("%d\n", my_token); } %} %token MY_TOKEN %% exp: MY_TOKEN; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:158" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:158: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:158" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:159: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:159: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:159" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:159" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_271 #AT_START_272 at_fn_group_banner 272 'regression.at:170' \ "Braces parsing" " " 17 at_xfail=no ( $as_echo "272. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' /* Bison used to swallow the character after '}'. */ %% exp: { tests = {{{{{{{{{{}}}}}}}}}}; }; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:182" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:182" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:182: bison -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:182" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:184: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c" at_fn_check_prepare_trace "regression.at:184" ( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:184" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_272 #AT_START_273 at_fn_group_banner 273 'regression.at:194' \ "Duplicate string" " " 17 at_xfail=no ( $as_echo "273. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' /* 'Bison -v' used to dump core when two tokens are defined with the same string, as LE and GE below. */ %token NUM %token LE "<=" %token GE "<=" %% exp: '(' exp ')' | NUM ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:211: bison -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:211" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.8-14: warning: symbol \"<=\" used more than once as a literal string " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror" "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:6.8-14: warning: symbol "<=" used more than once as a literal string _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/regression.at:211: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error" "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror" "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror" "regression.at:211" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_273 #AT_START_274 at_fn_group_banner 274 'regression.at:222' \ "Rule Line Numbers" " " 17 at_xfail=no ( $as_echo "274. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% expr: 'a' { } 'b' { } | { } 'c' { }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c -v input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:258" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:258: bison -o input.c -v input.y" at_fn_check_prepare_trace "regression.at:258" ( $at_check_trace; bison -o input.c -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/regression.at:261: cat input.output" at_fn_check_prepare_trace "regression.at:261" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Grammar 0 \$accept: expr \$end 1 \$@1: /* empty */ 2 expr: 'a' \$@1 'b' 3 \$@2: /* empty */ 4 expr: \$@2 'c' Terminals, with rules where they appear \$end (0) 0 'a' (97) 2 'b' (98) 2 'c' (99) 4 error (256) Nonterminals, with rules where they appear \$accept (6) on left: 0 expr (7) on left: 2 4, on right: 0 \$@1 (8) on left: 1, on right: 2 \$@2 (9) on left: 3, on right: 4 State 0 0 \$accept: . expr \$end 'a' shift, and go to state 1 \$default reduce using rule 3 (\$@2) expr go to state 2 \$@2 go to state 3 State 1 2 expr: 'a' . \$@1 'b' \$default reduce using rule 1 (\$@1) \$@1 go to state 4 State 2 0 \$accept: expr . \$end \$end shift, and go to state 5 State 3 4 expr: \$@2 . 'c' 'c' shift, and go to state 6 State 4 2 expr: 'a' \$@1 . 'b' 'b' shift, and go to state 7 State 5 0 \$accept: expr \$end . \$default accept State 6 4 expr: \$@2 'c' . \$default reduce using rule 4 (expr) State 7 2 expr: 'a' \$@1 'b' . \$default reduce using rule 2 (expr) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:261" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_274 #AT_START_275 at_fn_group_banner 275 'regression.at:368' \ "Mixing %token styles" " " 17 at_xfail=no ( $as_echo "275. $at_setup_line: testing $at_desc ..." $at_traceon # Taken from the documentation. cat >input.y <<'_ATEOF' %token OR "||" %token LE 134 "<=" %left OR "<=" %% exp: ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:380" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:380" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:380: bison -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:380" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_275 #AT_START_276 at_fn_group_banner 276 'regression.at:391' \ "Invalid inputs" " " 17 at_xfail=no ( $as_echo "276. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% ? default: 'a' } %& %a-does-not-exist %- %{ _ATEOF { set +x $as_echo "$at_srcdir/regression.at:403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:403" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?' input.y:3.14: error: invalid character: '}' input.y:4.1: error: invalid character: '%' input.y:4.2: error: invalid character: '&' input.y:5.1-17: error: invalid directive: '%a-does-not-exist' input.y:6.1: error: invalid character: '%' input.y:6.2: error: invalid character: '-' input.y:7.1-8.0: error: missing '%}' at end of file input.y:7.1-8.0: error: syntax error, unexpected %{...%} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:403" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_276 #AT_START_277 at_fn_group_banner 277 'regression.at:418' \ "Invalid inputs with {}" " " 17 at_xfail=no ( $as_echo "277. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor %initial-action %lex-param %parse-param %printer %union _ATEOF { set +x $as_echo "$at_srcdir/regression.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:430" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:430" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_277 #AT_START_278 at_fn_group_banner 278 'regression.at:443' \ "Token definitions" " " 17 at_xfail=no ( $as_echo "278. $at_setup_line: testing $at_desc ..." $at_traceon # Bison managed, when fed with '%token 'f' "f"' to #define 'f'! cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); %} %error-verbose %token MYEOF 0 "end of file" %token 'a' "a" %token B_TOKEN "b" %token C_TOKEN 'c' %token 'd' D_TOKEN %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %% exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { SPECIAL }; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF # Checking the warning message guarantees that the trigraph "??!" isn't # unnecessarily escaped here even though it would need to be if encoded in a # C-string literal. Also notice that unnecessary escaping, such as "\?", from # the user specification is eliminated. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:480: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:480" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared input.y:22.8-63: warning: symbol \"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\" used more than once as a literal string " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:22.8-14: warning: symbol SPECIAL redeclared input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/regression.at:480: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:480" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:484" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:484" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:484: bison -fcaret -o input.c input.y" at_fn_check_prepare_trace "regression.at:484" ( $at_check_trace; bison -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" ^^^^^^^ input.y:22.8-63: warning: symbol \"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\" used more than once as a literal string %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:22.8-14: warning: symbol SPECIAL redeclared %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" ^^^^^^^ input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/regression.at:484: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "regression.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:492: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:492" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:492" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:492: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:492" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:492" $at_failed && at_fn_log_failure $at_traceon; } # Checking the error message here guarantees that yytname, which does contain # C-string literals, does have the trigraph escaped correctly. Thus, the # symbol name reported by the parser is exactly the same as that reported by # Bison itself. cat >experr <<'_ATEOF' syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!", expecting a _ATEOF { set +x $as_echo "$at_srcdir/regression.at:501: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:501" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:501" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:501: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:501" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:501" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_278 #AT_START_279 at_fn_group_banner 279 'regression.at:511' \ "Characters Escapes" " " 17 at_xfail=no ( $as_echo "279. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ void yyerror ( const char *msg); int yylex (void); %} %% exp: '\'' "\'" | '\"' "\"" | '"' "'" /* Pacify font-lock-mode: ". */ ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:529" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:529" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:529: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:529" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:530: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:530" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:530" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:530: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:530" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:530" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_279 #AT_START_280 at_fn_group_banner 280 'regression.at:544' \ "Web2c Report" " " 17 at_xfail=no ( $as_echo "280. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token undef_id_tok const_id_tok %start CONST_DEC_PART %% CONST_DEC_PART: CONST_DEC_LIST ; CONST_DEC_LIST: CONST_DEC | CONST_DEC_LIST CONST_DEC ; CONST_DEC: { } undef_id_tok '=' const_id_tok ';' ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:569" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y" "regression.at:569" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:569" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:569" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:569: bison -v input.y" at_fn_check_prepare_trace "regression.at:569" ( $at_check_trace; bison -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:570: cat input.output" at_fn_check_prepare_trace "regression.at:570" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Grammar 0 \$accept: CONST_DEC_PART \$end 1 CONST_DEC_PART: CONST_DEC_LIST 2 CONST_DEC_LIST: CONST_DEC 3 | CONST_DEC_LIST CONST_DEC 4 \$@1: /* empty */ 5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' Terminals, with rules where they appear \$end (0) 0 ';' (59) 5 '=' (61) 5 error (256) undef_id_tok (258) 5 const_id_tok (259) 5 Nonterminals, with rules where they appear \$accept (7) on left: 0 CONST_DEC_PART (8) on left: 1, on right: 0 CONST_DEC_LIST (9) on left: 2 3, on right: 1 3 CONST_DEC (10) on left: 5, on right: 2 3 \$@1 (11) on left: 4, on right: 5 State 0 0 \$accept: . CONST_DEC_PART \$end \$default reduce using rule 4 (\$@1) CONST_DEC_PART go to state 1 CONST_DEC_LIST go to state 2 CONST_DEC go to state 3 \$@1 go to state 4 State 1 0 \$accept: CONST_DEC_PART . \$end \$end shift, and go to state 5 State 2 1 CONST_DEC_PART: CONST_DEC_LIST . 3 CONST_DEC_LIST: CONST_DEC_LIST . CONST_DEC undef_id_tok reduce using rule 4 (\$@1) \$default reduce using rule 1 (CONST_DEC_PART) CONST_DEC go to state 6 \$@1 go to state 4 State 3 2 CONST_DEC_LIST: CONST_DEC . \$default reduce using rule 2 (CONST_DEC_LIST) State 4 5 CONST_DEC: \$@1 . undef_id_tok '=' const_id_tok ';' undef_id_tok shift, and go to state 7 State 5 0 \$accept: CONST_DEC_PART \$end . \$default accept State 6 3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC . \$default reduce using rule 3 (CONST_DEC_LIST) State 7 5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';' '=' shift, and go to state 8 State 8 5 CONST_DEC: \$@1 undef_id_tok '=' . const_id_tok ';' const_id_tok shift, and go to state 9 State 9 5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';' ';' shift, and go to state 10 State 10 5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' . \$default reduce using rule 5 (CONST_DEC) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:570" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_280 #AT_START_281 at_fn_group_banner 281 'regression.at:721' \ "Web2c Actions" " " 17 at_xfail=no ( $as_echo "281. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% statement: struct_stat; struct_stat: /* empty. */ | if else; if: "if" "const" "then" statement; else: "else" statement; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:734" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:734" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:734" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:734" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:734: bison -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:734" ( $at_check_trace; bison -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734" $at_failed && at_fn_log_failure $at_traceon; } # Check only the tables. sed -n 's/ *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c { set +x $as_echo "$at_srcdir/regression.at:739: cat tables.c" at_fn_check_prepare_trace "regression.at:739" ( $at_check_trace; cat tables.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6 }; static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 6, 9, 14 }; static const yytype_int8 yyrhs[] = { 8, 0, -1, 9, -1, -1, 10, 11, -1, 3, 4, 5, 8, -1, 6, 8, -1 }; static const yytype_uint8 yyrline[] = { 0, 2, 2, 3, 3, 4, 5 }; static const char *const yytname[] = { \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\", \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", YY_NULL }; static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261 }; static const yytype_uint8 yyr1[] = { 0, 7, 8, 9, 9, 10, 11 }; static const yytype_uint8 yyr2[] = { 0, 2, 1, 0, 2, 4, 2 }; static const yytype_uint8 yydefact[] = { 3, 0, 0, 2, 0, 0, 1, 3, 4, 3, 6, 5 }; static const yytype_int8 yydefgoto[] = { -1, 2, 3, 4, 8 }; static const yytype_int8 yypact[] = { -2, -1, 4, -8, 0, 2, -8, -2, -8, -2, -8, -8 }; static const yytype_int8 yypgoto[] = { -8, -7, -8, -8, -8 }; static const yytype_uint8 yytable[] = { 10, 1, 11, 5, 6, 0, 7, 9 }; static const yytype_int8 yycheck[] = { 7, 3, 9, 4, 0, -1, 6, 5 }; static const yytype_uint8 yystos[] = { 0, 3, 8, 9, 10, 4, 0, 6, 11, 5, 8, 8 }; " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:739" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_281 #AT_START_282 at_fn_group_banner 282 'regression.at:936' \ "Dancer " " " 17 at_xfail=no ( $as_echo "282. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code provides { static void yyerror ( const char *msg); static int yylex (void); } %token ARROW INVALID NUMBER STRING DATA %defines %verbose %error-verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: /* empty */ | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ":"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o dancer.c dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:936" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:936" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:936" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:936" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:936: bison -o dancer.c dancer.y" at_fn_check_prepare_trace "regression.at:936" ( $at_check_trace; bison -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:936: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:936" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:936: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:936" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:936: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:936" ( $at_check_trace; $PREPARSER ./dancer ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:936: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:936" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_282 #AT_START_283 at_fn_group_banner 283 'regression.at:937' \ "Dancer %glr-parser" " " 17 at_xfail=no ( $as_echo "283. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code provides { static void yyerror ( const char *msg); static int yylex (void); } %glr-parser %token ARROW INVALID NUMBER STRING DATA %defines %verbose %error-verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: /* empty */ | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ":"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o dancer.c dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:937" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:937" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:937" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:937" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:937: bison -o dancer.c dancer.y" at_fn_check_prepare_trace "regression.at:937" ( $at_check_trace; bison -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:937: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:937" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:937: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:937" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:937: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:937" ( $at_check_trace; $PREPARSER ./dancer ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:937: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:937" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_283 #AT_START_284 at_fn_group_banner 284 'regression.at:938' \ "Dancer %skeleton \"lalr1.cc\"" " " 17 at_xfail=no ( $as_echo "284. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code provides { static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %token ARROW INVALID NUMBER STRING DATA %defines %verbose %error-verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: /* empty */ | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = ":"; static size_t toknum = 0; int res; (void) lvalp;; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (YYDEBUG); #endif return parser.parse (); } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o dancer.cc dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:938" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o dancer.cc dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:938" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:938" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:938" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:938: bison -o dancer.cc dancer.y" at_fn_check_prepare_trace "regression.at:938" ( $at_check_trace; bison -o dancer.cc dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:938: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:938" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:938: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS" "regression.at:938" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:938: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:938" ( $at_check_trace; $PREPARSER ./dancer ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:938: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:938" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_284 #AT_START_285 at_fn_group_banner 285 'regression.at:1020' \ "Expecting two tokens " " " 17 at_xfail=no ( $as_echo "285. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ static int yylex (void); #include #include static void yyerror ( const char *msg); %} %defines %error-verbose %token A 1000 %token B %% program: /* empty */ | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const tokens[] = { 1000, '+', '+', -1 }; static size_t toknum; assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o expect2.c expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1020" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1020" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1020" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1020" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1020: bison -o expect2.c expect2.y" at_fn_check_prepare_trace "regression.at:1020" ( $at_check_trace; bison -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1020: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1020" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1020: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1020" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1020: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1020" ( $at_check_trace; $PREPARSER ./expect2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1020: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1020" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_285 #AT_START_286 at_fn_group_banner 286 'regression.at:1021' \ "Expecting two tokens %glr-parser" " " 17 at_xfail=no ( $as_echo "286. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ static int yylex (void); #include #include static void yyerror ( const char *msg); %} %glr-parser %defines %error-verbose %token A 1000 %token B %% program: /* empty */ | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const tokens[] = { 1000, '+', '+', -1 }; static size_t toknum; assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o expect2.c expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1021" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1021" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1021" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1021" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1021: bison -o expect2.c expect2.y" at_fn_check_prepare_trace "regression.at:1021" ( $at_check_trace; bison -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1021: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1021" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1021: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1021" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1021: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1021" ( $at_check_trace; $PREPARSER ./expect2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1021: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1021" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_286 #AT_START_287 at_fn_group_banner 287 'regression.at:1022' \ "Expecting two tokens %skeleton \"lalr1.cc\"" " " 17 at_xfail=no ( $as_echo "287. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ static int yylex (int *); %} %skeleton "lalr1.cc" %defines %error-verbose %token A 1000 %token B %% program: /* empty */ | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } int yyparse () { yy::parser parser; return parser.parse (); } #include static int yylex (int *lval) { static int const tokens[] = { 1000, '+', '+', -1 }; static size_t toknum; *lval = 0; /* Pacify GCC. */ assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o expect2.cc expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1022" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o expect2.cc expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:1022" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1022" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1022" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1022: bison -o expect2.cc expect2.y" at_fn_check_prepare_trace "regression.at:1022" ( $at_check_trace; bison -o expect2.cc expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1022: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1022" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1022: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS" "regression.at:1022" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1022: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1022" ( $at_check_trace; $PREPARSER ./expect2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1022: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1022" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_287 #AT_START_288 at_fn_group_banner 288 'regression.at:1030' \ "Braced code in declaration in rules section" " " 17 at_xfail=no ( $as_echo "288. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once mistook braced code in a declaration in the rules section to be a # rule action. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include static void yyerror ( const char *msg); static int yylex (void); %} %error-verbose %% start: { printf ("Bison would once convert this action to a midrule because of the" " subsequent braced code.\n"); } ; %destructor { fprintf (stderr, "DESTRUCTOR\n"); } 'a'; %printer { fprintf (yyoutput, "PRINTER"); } 'a'; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { yydebug = 1; return !yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1069" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1069" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1069" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1069" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1069: bison -t -o input.c input.y" at_fn_check_prepare_trace "regression.at:1069" ( $at_check_trace; bison -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1070: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1070" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1070" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1070: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1070" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1070" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1071: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1071" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Bison would once convert this action to a midrule because of the subsequent braced code. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1071" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1071: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1071" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 20): -> \$\$ = nterm start () Stack now 0 Entering state 1 Reading a token: Next token is token 'a' (PRINTER) syntax error, unexpected 'a', expecting \$end Error: popping nterm start () Stack now 0 Cleanup: discarding lookahead token 'a' (PRINTER) DESTRUCTOR Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1071" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_288 #AT_START_289 at_fn_group_banner 289 'regression.at:1097' \ "String alias declared after use" " " 17 at_xfail=no ( $as_echo "289. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once incorrectly asserted that the symbol number for either a token or # its alias was the highest symbol number so far at the point of the alias # declaration. That was true unless the declaration appeared after their first # uses and other tokens appeared in between. cat >input.y <<'_ATEOF' %% start: 'a' "A" 'b'; %token 'a' "A"; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1110" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1110" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1110" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1110" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1110: bison -t -o input.c input.y" at_fn_check_prepare_trace "regression.at:1110" ( $at_check_trace; bison -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_289 #AT_START_290 at_fn_group_banner 290 'regression.at:1120' \ "Extra lookahead sets in report" " " 17 at_xfail=no ( $as_echo "290. $at_setup_line: testing $at_desc ..." $at_traceon # Bison prints each reduction's lookahead set only next to the associated # state's one item that (1) is associated with the same rule as the reduction # and (2) has its dot at the end of its RHS. Previously, Bison also # erroneously printed the lookahead set next to all of the state's other items # associated with the same rule. This bug affected only the '.output' file and # not the generated parser source code. cat >input.y <<'_ATEOF' %% start: a | 'a' a 'a' ; a: 'a' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1135" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "regression.at:1135" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1135" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1135" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1135: bison --report=all input.y" at_fn_check_prepare_trace "regression.at:1135" ( $at_check_trace; bison --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1136: sed -n '/^State 1\$/,/^State 2\$/p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 1$/,/^State 2$/p' input.output" "regression.at:1136" ( $at_check_trace; sed -n '/^State 1$/,/^State 2$/p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 1 2 start: 'a' . a 'a' 3 a: . 'a' 3 | 'a' . [\$end] 'a' shift, and go to state 4 \$default reduce using rule 3 (a) a go to state 5 State 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1136" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_290 #AT_START_291 at_fn_group_banner 291 'regression.at:1161' \ "Token number in precedence declaration" " " 17 at_xfail=no ( $as_echo "291. $at_setup_line: testing $at_desc ..." $at_traceon # POSIX says token numbers can be declared in %left, %right, and %nonassoc, but # we lost this in Bison 1.50. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include static void yyerror ( const char *msg); static int yylex (void); %} %error-verbose %right END 0 %left TK1 1 TK2 2 "tok alias" 3 %% start: TK1 sr_conflict "tok alias" | start %prec END ; sr_conflict: TK2 | TK2 "tok alias" ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 1, 2, 3, 0 }; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1201" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1201" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1201: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:1201" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 \"tok alias\" " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >at-bison-check-warnings <<'_ATEOF' input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 "tok alias" _ATEOF at_bison_check_first=`sed -n \ '/: warning: /{=;q;}' at-bison-check-warnings` : ${at_bison_check_first:=1} at_bison_check_first_tmp=`sed -n \ '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` : ${at_bison_check_first_tmp:=1} if test $at_bison_check_first_tmp -lt $at_bison_check_first; then at_bison_check_first=$at_bison_check_first_tmp fi if test $at_bison_check_first -gt 1; then sed -n "1,`expr $at_bison_check_first - 1`"p \ at-bison-check-warnings > experr fi echo 'bison: warnings being treated as errors' >> experr # Finish building expected stderr and check. Unlike warnings, # complaints cause bison to exit early. Thus, with -Werror, bison # does not necessarily report all warnings that it does without # -Werror, but it at least reports one. at_bison_check_last=`sed -n '$=' stderr` : ${at_bison_check_last:=1} at_bison_check_last=`expr $at_bison_check_last - 1` sed -n "$at_bison_check_first,$at_bison_check_last"p \ at-bison-check-warnings >> experr { set +x $as_echo "$at_srcdir/regression.at:1201: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ stderr 1>&2" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1201" ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:1201" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1205: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1205" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1205" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1205: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1205" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1205" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1206: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1206" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1206" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1206: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1206" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1206" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_291 #AT_START_292 at_fn_group_banner 292 'regression.at:1219' \ "parse-gram.y: LALR = IELR" " " 17 at_xfail=no ( $as_echo "292. $at_setup_line: testing $at_desc ..." $at_traceon # Avoid differences in synclines by telling bison that the output files # have the same name. cp $abs_top_srcdir/src/parse-gram.y input.y if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1224" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1224" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1224" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1224" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1224: bison -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_trace "regression.at:1224" ( $at_check_trace; bison -o input.c -Dlr.type=lalr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224" $at_failed && at_fn_log_failure $at_traceon; } mv input.c lalr.c if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1227" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1227" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1227: bison -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_trace "regression.at:1227" ( $at_check_trace; bison -o input.c -Dlr.type=ielr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } mv input.c ielr.c { set +x $as_echo "$at_srcdir/regression.at:1230: diff lalr.c ielr.c" at_fn_check_prepare_trace "regression.at:1230" ( $at_check_trace; diff lalr.c ielr.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1230" $at_failed && at_fn_log_failure \ "lalr.c" \ "ielr.c" $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_292 #AT_START_293 at_fn_group_banner 293 'regression.at:1240' \ "%error-verbose and YYSTACK_USE_ALLOCA" " " 17 at_xfail=no ( $as_echo "293. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); #define YYSTACK_USE_ALLOCA 1 } %error-verbose %% start: check syntax_error syntax_error ; check: { if (128 < sizeof yymsgbuf) { fprintf (stderr, "The initial size of yymsgbuf in yyparse has increased\n" "since this test group was last updated. As a result,\n" "this test group may no longer manage to induce a\n" "reallocation of the syntax error message buffer.\n" "This test group must be adjusted to produce a longer\n" "error message.\n"); YYABORT; } } ; // Induce a syntax error message whose total length is more than // sizeof yymsgbuf in yyparse. Each token here is 64 bytes. syntax_error: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | error 'a' 'b' 'c' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens) in order to detect any loss of the reallocated buffer. */ #include static int yylex (void) { static char const input[] = "abc"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1296" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1296" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1296" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1296: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:1296" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1297: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1297" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1297: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1297" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1298: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1298" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1298" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1298: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1298" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1298" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_293 #AT_START_294 at_fn_group_banner 294 'regression.at:1319' \ "%error-verbose overflow" " " 17 at_xfail=no ( $as_echo "294. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); /* This prevents this test case from having to induce error messages large enough to overflow size_t. */ #define YYSIZE_T unsigned char /* Bring in malloc and set EXIT_SUCCESS so yacc.c doesn't try to provide a malloc prototype using our YYSIZE_T. */ #include #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif /* Max depth is usually much smaller than YYSTACK_ALLOC_MAXIMUM, and we don't want gcc to warn everywhere this constant would be too big to make sense for our YYSIZE_T. */ #define YYMAXDEPTH 100 } %error-verbose %% start: syntax_error1 check syntax_error2 ; // Induce a syntax error message whose total length causes yymsg in // yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which // should be 255. Each token here is 64 bytes. syntax_error1: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | "123456789112345678921234567893123456789412345678951234567896123C" | error 'a' 'b' 'c' ; check: { if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM || YYSIZE_MAXIMUM != 255) { fprintf (stderr, "The assumptions of this test group are no longer\n" "valid, so it may no longer catch the error it was\n" "designed to catch. Specifically, the following\n" "values should all be 255:\n\n"); fprintf (stderr, " yymsg_alloc = %d\n", yymsg_alloc); fprintf (stderr, " YYSTACK_ALLOC_MAXIMUM = %d\n", YYSTACK_ALLOC_MAXIMUM); fprintf (stderr, " YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM); YYABORT; } } ; // Now overflow. syntax_error2: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | "123456789112345678921234567893123456789412345678951234567896123C" | "123456789112345678921234567893123456789412345678951234567896123D" | "123456789112345678921234567893123456789412345678951234567896123E" ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens). */ #include static int yylex (void) { static char const input[] = "abc"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { /* Push parsers throw away the message buffer between tokens, so skip this test under maintainer-push-check. */ if (YYPUSH) return 77; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1406" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1406" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1406" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1406" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1406: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:1406" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406" $at_failed && at_fn_log_failure $at_traceon; } # gcc warns about tautologies and fallacies involving comparisons for # unsigned char. However, it doesn't produce these same warnings for # size_t and many other types when the warnings would seem to make just # as much sense. We ignore the warnings. CFLAGS="$NO_WERROR_CFLAGS" { set +x $as_echo "$at_srcdir/regression.at:1413: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1413" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1413" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1413: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1413" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1413" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1415: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1415" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1415: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1415" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C syntax error memory exhausted " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1415" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_294 #AT_START_295 at_fn_group_banner 295 'regression.at:1429' \ "LAC: Exploratory stack" " " 17 at_xfail=no ( $as_echo "295. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); int yylex (void); } %define api.push-pull pull %error-verbose %token 'c' %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: /*empty*/ { printf ("consistent default reduction\n"); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { static char const *input = "bbbbc"; return *input++; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1508" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1508" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1508: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1508: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1508" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1508: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1508" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1508: \$PREPARSER ./input > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1508" ( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1508: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1508" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } # Make sure syntax error doesn't forget that 'a' is expected. It would # be forgotten without lookahead correction. { set +x $as_echo "$at_srcdir/regression.at:1508: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1508" ( $at_check_trace; grep 'syntax error,' stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in inconsistent states to be sure # syntax error is detected before unnecessary reductions are performed. { set +x $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. { set +x $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. { set +x $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); int yylex (YYSTYPE *); } %define api.push-pull pull %define api.pure %error-verbose %token 'c' %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: /*empty*/ { printf ("consistent default reduction\n"); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *v) { static char const *input = "bbbbc"; *v = 0; return *input++; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1509" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1509" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1509: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1509: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1509" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1509: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1509" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1509: \$PREPARSER ./input > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1509" ( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1509: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1509" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } # Make sure syntax error doesn't forget that 'a' is expected. It would # be forgotten without lookahead correction. { set +x $as_echo "$at_srcdir/regression.at:1509: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1509" ( $at_check_trace; grep 'syntax error,' stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in inconsistent states to be sure # syntax error is detected before unnecessary reductions are performed. { set +x $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. { set +x $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. { set +x $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); int yylex (void); } %define api.push-pull both %error-verbose %token 'c' %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: /*empty*/ { printf ("consistent default reduction\n"); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { static char const *input = "bbbbc"; return *input++; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1510: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1510: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1510: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1510" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1510: \$PREPARSER ./input > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1510" ( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1510: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1510" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } # Make sure syntax error doesn't forget that 'a' is expected. It would # be forgotten without lookahead correction. { set +x $as_echo "$at_srcdir/regression.at:1510: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1510" ( $at_check_trace; grep 'syntax error,' stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in inconsistent states to be sure # syntax error is detected before unnecessary reductions are performed. { set +x $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. { set +x $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. { set +x $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); int yylex (YYSTYPE *); } %define api.push-pull both %define api.pure %error-verbose %token 'c' %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: /*empty*/ { printf ("consistent default reduction\n"); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *v) { static char const *input = "bbbbc"; *v = 0; return *input++; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1511" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1511" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1511: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1511: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1511" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1511: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1511" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1511: \$PREPARSER ./input > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1511" ( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1511" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } # Make sure syntax error doesn't forget that 'a' is expected. It would # be forgotten without lookahead correction. { set +x $as_echo "$at_srcdir/regression.at:1511: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1511" ( $at_check_trace; grep 'syntax error,' stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in inconsistent states to be sure # syntax error is detected before unnecessary reductions are performed. { set +x $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. { set +x $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ < stdout.txt || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ < stdout.txt || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. { set +x $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_295 #AT_START_296 at_fn_group_banner 296 'regression.at:1523' \ "LAC: Memory exhaustion" " " 17 at_xfail=no ( $as_echo "296. $at_setup_line: testing $at_desc ..." $at_traceon # Check for memory exhaustion during parsing. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); #define YYMAXDEPTH 8 } %error-verbose %% S: A A A A A A A A A ; A: /*empty*/ | 'a' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1562" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1562" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1562: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1562: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1562" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1562: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1562" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1563: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1563" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1563" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1563: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1563" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Now at end of input. LAC: initial context established for \$end LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) memory exhausted Cleanup: discarding lookahead token \$end () Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1563" $at_failed && at_fn_log_failure $at_traceon; } # Induce an immediate syntax error with an undefined token, and check # for memory exhaustion while building syntax error message. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %code { #include static void yyerror ( const char *msg); static int yylex (void); #define YYMAXDEPTH 8 } %error-verbose %% S: A A A A A A A A A ; A: /*empty*/ | 'a' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "z"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { yydebug = 1; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1576" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1576" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1576: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ -t -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ -t -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1576: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1576" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1576: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1576" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1577: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1577" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1577" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1577: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1577" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token \$undefined () LAC: initial context established for \$undefined LAC: checking lookahead \$undefined: Always Err Constructing syntax error message LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) syntax error memory exhausted Cleanup: discarding lookahead token \$undefined () Stack now 0 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1577" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_296 #AT_START_297 at_fn_group_banner 297 'regression.at:1664' \ "Lex and parse params: yacc.c" " " 17 at_xfail=no ( $as_echo "297. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param and use the generated ## yyerror. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines %locations %skeleton "yacc.c" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include #include static void yyerror (int x, int y, const char *msg); static int yylex (void); %} %% exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% #include /* A C error reporting function. */ static void yyerror (int x, int y, const char *msg) { YYUSE(x); YYUSE(y); YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { return !!yyparse(1, 2); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1664" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1664" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1664" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1664" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1664: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:1664" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1664: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1664" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1664: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1664" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1664: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1664" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "x: 1, y: 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1664: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1664" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_297 #AT_START_298 at_fn_group_banner 298 'regression.at:1665' \ "Lex and parse params: glr.c" " " 17 at_xfail=no ( $as_echo "298. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param and use the generated ## yyerror. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines %locations %skeleton "glr.c" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include #include static void yyerror (int x, int y, const char *msg); static int yylex (void); %} %% exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% #include /* A C error reporting function. */ static void yyerror (int x, int y, const char *msg) { YYUSE(x); YYUSE(y); YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { return !!yyparse(1, 2); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1665" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1665" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1665" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1665" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1665: bison -o input.c input.y" at_fn_check_prepare_trace "regression.at:1665" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1665: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1665" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1665: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1665" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1665: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1665" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "x: 1, y: 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1665: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1665" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_298 #AT_START_299 at_fn_group_banner 299 'regression.at:1666' \ "Lex and parse params: lalr1.cc" " " 17 at_xfail=no ( $as_echo "299. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param and use the generated ## yyerror. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines %locations %skeleton "lalr1.cc" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %} %% exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "a"; static size_t toknum = 0; int res; (void) lvalp;(void) llocp; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int yyparse (int x, int y) { yy::parser parser(x, y); return parser.parse (); } int main (void) { return !!yyparse(1, 2); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1666" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1666" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1666" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1666" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1666: bison -o input.cc input.y" at_fn_check_prepare_trace "regression.at:1666" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1666: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1666" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1666: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1666" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1666: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1666" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "x: 1, y: 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1666: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1666" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_299 #AT_START_300 at_fn_group_banner 300 'regression.at:1667' \ "Lex and parse params: glr.cc" " " 17 at_xfail=no ( $as_echo "300. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param and use the generated ## yyerror. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %defines %locations %skeleton "glr.cc" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %} %% exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << l << ": " << m << std::endl; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "a"; static size_t toknum = 0; int res; (void) lvalp;(void) llocp; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int yyparse (int x, int y) { yy::parser parser(x, y); return parser.parse (); } int main (void) { return !!yyparse(1, 2); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1667" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1667" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1667" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1667" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1667: bison -o input.cc input.y" at_fn_check_prepare_trace "regression.at:1667" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1667: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1667" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1667: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1667" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1667: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1667" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "x: 1, y: 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1667: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1667" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_300 #AT_START_301 at_fn_group_banner 301 'c++.at:101' \ "Doxygen Public Documentation" " " 18 at_xfail=no ( $as_echo "301. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %skeleton "lalr1.cc" %locations %debug %defines %% exp:; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:101" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:101" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:101: bison -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:101" ( $at_check_trace; bison -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } cat >Doxyfile <<'_ATEOF' # The PROJECT_NAME tag is a single word (or a sequence of words # surrounded by quotes) that should identify the project. PROJECT_NAME = "Bison C++ Parser" # The QUIET tag can be used to turn on/off the messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages # that are generated by doxygen. Possible values are YES and NO. If # left blank NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then # this flag will automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings # for potential errors in the documentation, such as not documenting # some parameters in a documented function, or documenting parameters # that don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages # that doxygen can produce. The string should contain the $file, # $line, and $text tags, which will be replaced by the file and line # number from which the warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # If the EXTRACT_ALL tag is set to YES doxygen will assume all # entities in documentation are documented, even if no documentation # was available. Private class members and static file members will # be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set # to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a # class will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO _ATEOF { set +x $as_echo "$at_srcdir/c++.at:101: doxygen --version || exit 77" at_fn_check_prepare_trace "c++.at:101" ( $at_check_trace; doxygen --version || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:101: doxygen" at_fn_check_prepare_trace "c++.at:101" ( $at_check_trace; doxygen ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_301 #AT_START_302 at_fn_group_banner 302 'c++.at:102' \ "Doxygen Private Documentation" " " 18 at_xfail=no ( $as_echo "302. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %skeleton "lalr1.cc" %locations %debug %defines %% exp:; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { (void) l; std::cerr << m << std::endl; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:102" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:102" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:102: bison -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:102" ( $at_check_trace; bison -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } cat >Doxyfile <<'_ATEOF' # The PROJECT_NAME tag is a single word (or a sequence of words # surrounded by quotes) that should identify the project. PROJECT_NAME = "Bison C++ Parser" # The QUIET tag can be used to turn on/off the messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages # that are generated by doxygen. Possible values are YES and NO. If # left blank NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then # this flag will automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings # for potential errors in the documentation, such as not documenting # some parameters in a documented function, or documenting parameters # that don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages # that doxygen can produce. The string should contain the $file, # $line, and $text tags, which will be replaced by the file and line # number from which the warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # If the EXTRACT_ALL tag is set to YES doxygen will assume all # entities in documentation are documented, even if no documentation # was available. Private class members and static file members will # be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set # to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a # class will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES _ATEOF { set +x $as_echo "$at_srcdir/c++.at:102: doxygen --version || exit 77" at_fn_check_prepare_trace "c++.at:102" ( $at_check_trace; doxygen --version || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:102: doxygen" at_fn_check_prepare_trace "c++.at:102" ( $at_check_trace; doxygen ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_302 #AT_START_303 at_fn_group_banner 303 'c++.at:160' \ "Relative namespace references" " " 18 at_xfail=no ( $as_echo "303. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo::parser::error (const foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:161" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:161" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:161: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:161" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:161: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:161" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:161: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:161" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:161: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:161" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:161: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:161" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo::bar" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::parser::error (const foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo::bar::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:162: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:162" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:162: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:162" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:162: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:162" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:162: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:162" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:162: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:162" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:162: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:162" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:162: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:162" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo::bar::baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo::bar::baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:163" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:163: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:163" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:163: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:163" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:163: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:163" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:163: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:163" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:163: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:163" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_303 #AT_START_304 at_fn_group_banner 304 'c++.at:166' \ "Absolute namespace references" " " 18 at_xfail=no ( $as_echo "304. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "::foo" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::parser::error (const ::foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:167" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:167" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:167: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:167" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:167: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:167" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:167: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:167" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:167: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:167" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:167: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:167" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "::foo::bar" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::bar::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:168" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:168: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:168" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:168: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:168" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:168: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:168" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:168: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:168" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:168: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:168" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "::foo::bar::baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::bar::baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:169: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:169" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:169: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:169" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:169: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:169" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:169: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:169" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:169: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:169" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:169: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:169" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:169: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:169" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace " ::foo" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::parser::error (const ::foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:170: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:170" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:170: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:170" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:170: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:170" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:170: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:170" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:170: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:170" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:170: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:170" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:170: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:170" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace " ::foo::bar" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::bar::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:171" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:171" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:171: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:171" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:171: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:171" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:171: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:171" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:171: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:171" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:171: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:171" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace " ::foo::bar::baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { ::foo::bar::baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:172" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:172" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:172: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:172" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:172: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:172" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:172: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:172" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:172: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:172" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:172: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:172" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_304 #AT_START_305 at_fn_group_banner 305 'c++.at:175' \ "Syntactically invalid namespace references" " " 18 at_xfail=no ( $as_echo "305. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace ":foo:bar" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void :foo:bar::parser::error (const :foo:bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { :foo:bar::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:176" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:176" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:176: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:176" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo: :bar" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo: :bar::parser::error (const foo: :bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo: :bar::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:177" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:177" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:177: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:177" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177" $at_failed && at_fn_log_failure $at_traceon; } # This one is interesting because `[3]' is encoded as `[3]', which # contains single occurrences of `:'. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo[3]::bar::baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo[3]::bar::baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:180: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:180" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:180: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:180" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:180: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:180" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo::bar,baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo::bar,baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:181: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:181" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:181: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:181" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:181: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:181" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %language "C++" %defines %define namespace "foo::bar::(baz" %union { int i; } %define global_tokens_and_yystype %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::(baz::parser::error (const foo::bar::(baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << std::endl; } int main (void) { foo::bar::(baz::parser p; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:182" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:182" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:182: bison -o input.cc input.y" at_fn_check_prepare_trace "c++.at:182" ( $at_check_trace; bison -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_305 #AT_START_306 at_fn_group_banner 306 'c++.at:190' \ "Exception safety" " " 18 at_xfail=no ( $as_echo "306. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %skeleton "lalr1.cc" %defines // FIXME: Mandated in 2.6. %debug %error-verbose %code requires { #include #include // size_t and getenv. #include #include bool debug = false; /// A class that counts its number of instances. struct Object { typedef std::list objects; static objects instances; char val; static bool empty () { return instances.empty(); } static void log (Object const *o, const std::string& msg) { if (debug) { if (o) std::cerr << o << "->"; std::cerr << msg << " {"; const char* sep = " "; for (objects::const_iterator i = instances.begin(), i_end = instances.end(); i != i_end; ++i) { std::cerr << sep << *i; sep = ", "; } std::cerr << " }" << std::endl; } } Object (char v) : val (v) { instances.push_back(this); log (this, "Object::Object"); } ~Object () { instances.remove(this); log (this, "Object::~Object"); } }; } %code { #include #include // strchr #include int yylex (yy::parser::semantic_type *); Object::objects Object::instances; static char const *input; } %union { Object *obj; } %initial-action { if (strchr (input, 'i')) throw std::runtime_error ("initial-action"); } %destructor { delete $$; } ; %printer { yyo << $$ << " '" << $$->val << '\''; if ($$->val == 'p') throw std::runtime_error ("printer"); } ; %token 'a' 'E' 'e' 'p' 'R' 's' 'T' %type list item %% start: list { delete $1; }; list: item { $$ = $1; } | item list { $$ = $1; delete $2; } // Right recursion to load the stack. ; item: 'a' { $$ = $1; } | 'e' { YYUSE ($$); YYUSE($1); error (location_type(), "syntax error"); } // Not just 'E', otherwise we reduce when 'E' is the lookahead, and // then the stack is emptied, defeating the point of the test. | 'E' 'a' { YYUSE($1); $$ = $2; } | 'R' { $$ = YY_NULL; delete $1; YYERROR; } | 'p' { $$ = $1; } | 's' { $$ = $1; throw std::runtime_error ("reduction"); } | 'T' { $$ = YY_NULL; delete $1; YYABORT; } | error { $$ = YY_NULL; yyerrok; } ; %% int yylex (yy::parser::semantic_type *lvalp) { // 'a': no error. // 'e': user action calls error. // 'E': syntax error, with yyerror that throws. // 'i': initial action throws. // 'l': yylex throws. // 'R': call YYERROR in the action // 's': reduction throws. // 'T': call YYABORT in the action switch (int res = *input++) { case 'l': throw std::runtime_error ("yylex"); default: lvalp->obj = new Object (res); // Fall through. case 0: return res; } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { YYUSE (l); throw std::runtime_error (m); } int main (int argc, const char *argv[]) { switch (argc) { case 2: input = argv[1]; break; case 3: assert (!strcmp (argv[1], "--debug")); debug = 1; input = argv[2]; break; default: abort (); } yy::parser parser; debug |= !!getenv ("YYDEBUG"); parser.set_debug_level (debug); int res = 2; try { res = parser.parse (); } catch (const std::exception& e) { std::cerr << "exception caught: " << e.what () << std::endl; } catch (...) { std::cerr << "unknown exception caught" << std::endl; } Object::log (YY_NULL, "end"); assert (Object::empty()); return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.cc --report=all input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:382" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:382" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:382: bison -o input.cc --report=all input.yy" at_fn_check_prepare_trace "c++.at:382" ( $at_check_trace; bison -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:383: \$BISON_CXX_WORKS" at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:383" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:383: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:383" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:385: \$PREPARSER ./input aaaas" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:385" ( $at_check_trace; $PREPARSER ./input aaaas ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:385" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:385: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:385" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "exception caught: reduction " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:385" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:389: \$PREPARSER ./input aaaal" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:389" ( $at_check_trace; $PREPARSER ./input aaaal ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:389" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:389" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "exception caught: yylex " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:389" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:393: \$PREPARSER ./input i" at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:393" ( $at_check_trace; $PREPARSER ./input i ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:393" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:393" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "exception caught: initial-action " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:393" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:397: \$PREPARSER ./input aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:397" ( $at_check_trace; $PREPARSER ./input aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:397" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:399: \$PREPARSER ./input --debug aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:399" ( $at_check_trace; $PREPARSER ./input --debug aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:399" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:399: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:399" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:399" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:400: grep '^exception caught: printer\$' stderr" at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:400" ( $at_check_trace; grep '^exception caught: printer$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:400" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:402: \$PREPARSER ./input aaaae" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:402" ( $at_check_trace; $PREPARSER ./input aaaae ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:402" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "exception caught: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:406: \$PREPARSER ./input aaaaE" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:406" ( $at_check_trace; $PREPARSER ./input aaaaE ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/c++.at:406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:406: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:406" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:406" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:410: \$PREPARSER ./input aaaaT" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:410" ( $at_check_trace; $PREPARSER ./input aaaaT ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:410" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:410" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:410" $at_failed && at_fn_log_failure $at_traceon; } # There is error-recovery, so exit success. { set +x $as_echo "$at_srcdir/c++.at:413: \$PREPARSER ./input aaaaR" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:413" ( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:413" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:413" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:413" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_306 #AT_START_307 at_fn_group_banner 307 'java.at:360' \ "Calculator " " " 19 at_xfail=no ( $as_echo "307. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %code { public static void main (String args[]) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); p.parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } public void yyerror (String s) { System.err.println (s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_307 #AT_START_308 at_fn_group_banner 308 'java.at:360' \ "Calculator %error-verbose " " " 19 at_xfail=no ( $as_echo "308. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %error-verbose %code { public static void main (String args[]) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); p.parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } public void yyerror (String s) { System.err.println (s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_308 #AT_START_309 at_fn_group_banner 309 'java.at:360' \ "Calculator %locations " " " 19 at_xfail=no ( $as_echo "309. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %locations %code { public static void main (String args[]) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); p.parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String s) { if (l == null) System.err.println (s); else System.err.println (l + ": " + s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_309 #AT_START_310 at_fn_group_banner 310 'java.at:360' \ "Calculator %error-verbose %locations " " " 19 at_xfail=no ( $as_echo "310. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %error-verbose %locations %code { public static void main (String args[]) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); p.parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String s) { if (l == null) System.err.println (s); else System.err.println (l + ": " + s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" $as_echo "java.at:360" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:360" { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:360: cat stderr" at_fn_check_prepare_trace "java.at:360" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:360" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_310 #AT_START_311 at_fn_group_banner 311 'java.at:369' \ "Calculator %lex-param { InputStream is } " " " 19 at_xfail=no ( $as_echo "311. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { new Calc (System.in).parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } public void yyerror (String s) { System.err.println (s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_311 #AT_START_312 at_fn_group_banner 312 'java.at:369' \ "Calculator %error-verbose %lex-param { InputStream is } " "" 19 at_xfail=no ( $as_echo "312. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %error-verbose %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { new Calc (System.in).parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } public void yyerror (String s) { System.err.println (s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_312 #AT_START_313 at_fn_group_banner 313 'java.at:369' \ "Calculator %locations %lex-param { InputStream is } " "" 19 at_xfail=no ( $as_echo "313. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %locations %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { new Calc (System.in).parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String s) { if (l == null) System.err.println (s); else System.err.println (l + ": " + s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_313 #AT_START_314 at_fn_group_banner 314 'java.at:369' \ "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 19 at_xfail=no ( $as_echo "314. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" %define parser_class_name "Calc" %define public %error-verbose %locations %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { new Calc (System.in).parse (); } } %code imports { import java.io.StreamTokenizer; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.IOException; } /* Bison Declarations */ %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %left NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars (9, 9); st.whitespaceChars (32, 32); st.wordChars (48, 57); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String s) { if (l == null) System.err.println (s); else System.err.println (l + ": " + s); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return Calc.EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return Calc.NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; bison -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" $as_echo "java.at:369" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:369" { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Some syntax errors. cat >input <<'_ATEOF' 0 0 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected number _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected $undefined _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.4: syntax error, unexpected '=' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 2.1: syntax error, unexpected '+' _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise error messages with EOF: work on an empty file. { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.1: syntax error, unexpected end of input _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Exercise the error token: without it, we die at the first error, # hence be sure to # # - have several errors which exercise different shift/discardings # - (): nothing to pop, nothing to discard # - (1 + 1 + 1 +): a lot to pop, nothing to discard # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # # - test the action associated to `error' # # - check the lookahead that triggers an error is not discarded # when we enter error recovery. Below, the lookahead causing the # first error is ")", which is needed to recover from the error and # produce the "0" that triggers the "0 != 1" error. # cat >input <<'_ATEOF' () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.1-1.27: calc: error: 4444 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # The same, but this time exercising explicitly triggered syntax errors. # POSIX says the lookahead causing the error should not be discarded. cat >input <<'_ATEOF' (!) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.7: syntax error, unexpected number 1.1-1.10: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Create the reference error message. cat >expout <<'_ATEOF' 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' 1.8: syntax error, unexpected number 1.1-1.11: calc: error: 2222 != 1 _ATEOF # 2. If locations are not used, remove them. # 3. If error-verbose is not used, strip the`, unexpected....' part. # 4. Check { set +x $as_echo "$at_srcdir/java.at:369: cat stderr" at_fn_check_prepare_trace "java.at:369" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:369" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_314 #AT_START_315 at_fn_group_banner 315 'java.at:455' \ "Java parser class and package names" " " 20 at_xfail=no ( $as_echo "315. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:457" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:457" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:457: bison YYParser.y" at_fn_check_prepare_trace "java.at:457" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:457: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:457" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:457" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:457" $as_echo "java.at:457" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:457" { set +x $as_echo "$at_srcdir/java.at:457: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:457" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:458: grep -c '^class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:458" ( $at_check_trace; grep -c '^class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:458" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %name-prefix "Prefix" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:460" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:460" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:460: bison YYParser.y" at_fn_check_prepare_trace "java.at:460" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:460: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:460" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:460" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:460" $as_echo "java.at:460" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:460" { set +x $as_echo "$at_srcdir/java.at:460: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:460" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:460" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:461: grep -c '^class PrefixParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:461" ( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:461" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define parser_class_name "ParserClassName" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:463" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:463" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:463: bison YYParser.y" at_fn_check_prepare_trace "java.at:463" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:463: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:463" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:463" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:463" $as_echo "java.at:463" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:463" { set +x $as_echo "$at_srcdir/java.at:463: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:463" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:464: grep -c '^class ParserClassName\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:464" ( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:464" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define package "user_java_package" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:466" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:466" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:466: bison YYParser.y" at_fn_check_prepare_trace "java.at:466" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:466: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:466" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:466" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:466" $as_echo "java.at:466" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:466" { set +x $as_echo "$at_srcdir/java.at:466: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:466" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:467: grep -c '^package user_java_package;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:467" ( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:467" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_315 #AT_START_316 at_fn_group_banner 316 'java.at:476' \ "Java parser class modifiers" " " 20 at_xfail=no ( $as_echo "316. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define abstract %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:478" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:478" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:478" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:478" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:478: bison YYParser.y" at_fn_check_prepare_trace "java.at:478" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:478: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:478" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:478" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:478" $as_echo "java.at:478" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:478" { set +x $as_echo "$at_srcdir/java.at:478: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:478" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:478" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:479: grep -c '^abstract class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:479" ( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:479" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define final %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:481" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:481" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:481: bison YYParser.y" at_fn_check_prepare_trace "java.at:481" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:481: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:481" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:481" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:481" $as_echo "java.at:481" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:481" { set +x $as_echo "$at_srcdir/java.at:481: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:481" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:482: grep -c '^final class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:482" ( $at_check_trace; grep -c '^final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:482" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:484" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:484: bison YYParser.y" at_fn_check_prepare_trace "java.at:484" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:484" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:484" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:484" $as_echo "java.at:484" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:484" { set +x $as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:485: grep -c '^strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:485" ( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:485" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define abstract %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:487" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:487" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:487: bison YYParser.y" at_fn_check_prepare_trace "java.at:487" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:487" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:487" $as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:487" { set +x $as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:490: grep -c '^abstract strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:490" ( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:490" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define final %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:492" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:492" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:492: bison YYParser.y" at_fn_check_prepare_trace "java.at:492" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:492: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:492" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:492" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:492" $as_echo "java.at:492" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:492" { set +x $as_echo "$at_srcdir/java.at:492: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:492" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:495: grep -c '^final strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:495" ( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:495" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:497" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:497" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:497: bison YYParser.y" at_fn_check_prepare_trace "java.at:497" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:497: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:497" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:497" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:497" $as_echo "java.at:497" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:497" { set +x $as_echo "$at_srcdir/java.at:497: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:497" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:498: grep -c '^public class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:498" ( $at_check_trace; grep -c '^public class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:498" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %define abstract %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:500" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:500" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:500: bison YYParser.y" at_fn_check_prepare_trace "java.at:500" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:500: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:500" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:500" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:500" $as_echo "java.at:500" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:500" { set +x $as_echo "$at_srcdir/java.at:500: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:500" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:503: grep -c '^public abstract class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:503" ( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:503" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %define final %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:505" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:505" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:505: bison YYParser.y" at_fn_check_prepare_trace "java.at:505" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:505: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:505" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:505" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:505" $as_echo "java.at:505" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:505" { set +x $as_echo "$at_srcdir/java.at:505: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:505" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:508: grep -c '^public final class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:508" ( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:510" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:510" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:510: bison YYParser.y" at_fn_check_prepare_trace "java.at:510" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:510: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:510" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:510" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:510" $as_echo "java.at:510" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:510" { set +x $as_echo "$at_srcdir/java.at:510: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:510" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:513: grep -c '^public strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:513" ( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:513" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %define abstract %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:515" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:515" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:515" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:515" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:515: bison YYParser.y" at_fn_check_prepare_trace "java.at:515" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:515: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:515" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:515" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:515" $as_echo "java.at:515" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:515" { set +x $as_echo "$at_srcdir/java.at:515: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:515" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:519: grep -c '^public abstract strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public abstract strictfp class YYParser$' YYParser.java" "java.at:519" ( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:519" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define public %define final %define strictfp %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:521" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:521" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:521: bison YYParser.y" at_fn_check_prepare_trace "java.at:521" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:521: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:521" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:521" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:521" $as_echo "java.at:521" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:521" { set +x $as_echo "$at_srcdir/java.at:521: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:521" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:525: grep -c '^public final strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public final strictfp class YYParser$' YYParser.java" "java.at:525" ( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:525" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_316 #AT_START_317 at_fn_group_banner 317 'java.at:534' \ "Java parser class extends and implements" " " 20 at_xfail=no ( $as_echo "317. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define extends "Thread" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:536" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:536" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:536" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:536" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:536: bison YYParser.y" at_fn_check_prepare_trace "java.at:536" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:536: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:536" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:536" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:536" $as_echo "java.at:536" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:536" { set +x $as_echo "$at_srcdir/java.at:536: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:536" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:537: grep -c '^class YYParser extends Thread\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:537" ( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:537" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define implements "Cloneable" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:539" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:539" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:539: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:539" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:539: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:539" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:539: bison YYParser.y" at_fn_check_prepare_trace "java.at:539" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:539: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:539" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:539" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:539" $as_echo "java.at:539" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:539" { set +x $as_echo "$at_srcdir/java.at:539: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:539" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:539" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:540: grep -c '^class YYParser implements Cloneable\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:540" ( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:540" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define extends "Thread" %define implements "Cloneable" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:542" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:542" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:542" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:542" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:542: bison YYParser.y" at_fn_check_prepare_trace "java.at:542" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:542: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:542" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:542" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:542" $as_echo "java.at:542" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:542" { set +x $as_echo "$at_srcdir/java.at:542: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:542" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:545: grep -c '^class YYParser extends Thread implements Cloneable\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java" "java.at:545" ( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_317 #AT_START_318 at_fn_group_banner 318 'java.at:554' \ "Java %parse-param and %lex-param" " " 20 at_xfail=no ( $as_echo "318. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:556" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:556" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:556" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:556" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:556: bison YYParser.y" at_fn_check_prepare_trace "java.at:556" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:556: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:556" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:556" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:556" $as_echo "java.at:556" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:556" { set +x $as_echo "$at_srcdir/java.at:556: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:556" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:557: grep -c '^ *public YYParser (Lexer yylexer) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java" "java.at:557" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:557" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %parse-param {int parse_param1} %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:559" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:559" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:559" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:559" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:559: bison YYParser.y" at_fn_check_prepare_trace "java.at:559" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:559: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:559" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:559" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:559" $as_echo "java.at:559" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:559" { set +x $as_echo "$at_srcdir/java.at:559: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:559" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:560: grep -c '^ *protected final int parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:560" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:560" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:561: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:561" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:561" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:562: grep -c '^[ ]*this.parse_param1 = parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:562" ( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:562" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %parse-param {int parse_param1} %parse-param {long parse_param2} %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:564" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:564" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:564: bison YYParser.y" at_fn_check_prepare_trace "java.at:564" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:564: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:564" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:564" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:564" $as_echo "java.at:564" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:564" { set +x $as_echo "$at_srcdir/java.at:564: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:564" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:567: grep -c '^ *protected final int parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:567" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:567" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:568: grep -c '^ *protected final long parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:568" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:569: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:569" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:570: grep -c '^[ ]*this.parse_param1 = parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:570" ( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:570" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:571: grep -c '^[ ]*this.parse_param2 = parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:571" ( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:571" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:573" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:573" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:573: bison YYParser.y" at_fn_check_prepare_trace "java.at:573" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:573: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:573" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:573" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:573" $as_echo "java.at:573" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:573" { set +x $as_echo "$at_srcdir/java.at:573: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:573" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:573" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:574: grep -c '^ *public YYParser () {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () {$' YYParser.java" "java.at:574" ( $at_check_trace; grep -c '^ *public YYParser () {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:574" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:575: grep -c '^ *protected YYParser (Lexer yylexer) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java" "java.at:575" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %parse-param {int parse_param1} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:577" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:577" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:577" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:577" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:577: bison YYParser.y" at_fn_check_prepare_trace "java.at:577" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:577: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:577" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:577" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:577" $as_echo "java.at:577" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:577" { set +x $as_echo "$at_srcdir/java.at:577: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:577" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:579: grep -c '^ *protected final int parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:579" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:579" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:580: grep -c '^ *public YYParser (int parse_param1) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java" "java.at:580" ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:580" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:581: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:581" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:581" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:582: grep -c '^[ ]*this.parse_param1 = parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:582" ( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %parse-param {int parse_param1} %parse-param {long parse_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:584: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:584" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:584: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:584" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:584: bison YYParser.y" at_fn_check_prepare_trace "java.at:584" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:584: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:584" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:584" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:584" $as_echo "java.at:584" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:584" { set +x $as_echo "$at_srcdir/java.at:584: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:584" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:588: grep -c '^ *protected final int parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:588" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:588" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:589: grep -c '^ *protected final long parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:589" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:589" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:590: grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:590" ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:590" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:591: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:591" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:591" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:592: grep -c '^[ ]*this.parse_param1 = parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:592" ( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:592" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:593: grep -c '^[ ]*this.parse_param2 = parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:593" ( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:593" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %lex-param {char lex_param1} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1) {} } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:595" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:595" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:595" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:595" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:595: bison YYParser.y" at_fn_check_prepare_trace "java.at:595" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:595: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:595" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:595" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:595" $as_echo "java.at:595" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:595" { set +x $as_echo "$at_srcdir/java.at:595: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:595" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:595" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:597: grep -c '^ *public YYParser (char lex_param1) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java" "java.at:597" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:597" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:598: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:598" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:598" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %lex-param {char lex_param1} %lex-param {short lex_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1, short lex_param2) {} } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:600" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:600" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:600" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:600" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:600: bison YYParser.y" at_fn_check_prepare_trace "java.at:600" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:600: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:600" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:600" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:600" $as_echo "java.at:600" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:600" { set +x $as_echo "$at_srcdir/java.at:600: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:600" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:604: grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java" "java.at:604" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:605: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:605" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:605" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %parse-param {int parse_param1} %parse-param {long parse_param2} %lex-param {char lex_param1} %lex-param {short lex_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1, short lex_param2) {} } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:607" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:607" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:607: bison YYParser.y" at_fn_check_prepare_trace "java.at:607" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:607: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:607" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:607" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:607" $as_echo "java.at:607" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:607" { set +x $as_echo "$at_srcdir/java.at:607: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:607" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:613: grep -c '^ *protected final int parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:613" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:614: grep -c '^ *protected final long parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:614" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:615: grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:615" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:616: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:616" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:616" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:617: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:617" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:618: grep -c '^[ ]*this.parse_param1 = parse_param1;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:618" ( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:619: grep -c '^[ ]*this.parse_param2 = parse_param2;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:619" ( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:619" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_318 #AT_START_319 at_fn_group_banner 319 'java.at:628' \ "Java throws specifications" " " 20 at_xfail=no ( $as_echo "319. $at_setup_line: testing $at_desc ..." $at_traceon # %define throws - 0 1 2 # %define lex-throws - 0 1 2 # %code lexer 0 1 cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %initial-action {if (true) throw new ClassNotFoundException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %initial-action {if (true) throw new InstantiationException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "" %initial-action {if (true) throw new ClassNotFoundException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "" %initial-action {if (true) throw new InstantiationException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "InterruptedException" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "InterruptedException" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "InterruptedException" %initial-action {if (true) throw new ClassNotFoundException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "InterruptedException" %initial-action {if (true) throw new InstantiationException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "InterruptedException, IllegalAccessException" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "InterruptedException, IllegalAccessException" %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "InterruptedException, IllegalAccessException" %initial-action {if (true) throw new ClassNotFoundException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "InterruptedException, IllegalAccessException" %initial-action {if (true) throw new InstantiationException();} %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "" %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "" %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "InterruptedException" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "InterruptedException" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "InterruptedException" %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "InterruptedException" %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define lex_throws "InterruptedException, IllegalAccessException" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "" %define lex_throws "InterruptedException, IllegalAccessException" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: "end" {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException" %define lex_throws "InterruptedException, IllegalAccessException" %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define throws "ClassNotFoundException, InstantiationException" %define lex_throws "InterruptedException, IllegalAccessException" %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: "end" {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:688: bison YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:688" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" $as_echo "java.at:688" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:688" { set +x $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_319 #AT_START_320 at_fn_group_banner 320 'java.at:717' \ "Java stype, position_class and location_class" " " 20 at_xfail=no ( $as_echo "320. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define stype "java.awt.Color" %type start; %define api.location.type "MyLoc" %define api.position.type "MyPos" %code { class MyPos {} } %% start: "end" {$$ = $1;}; %% class MyPos {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:719" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:719" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:719" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:719" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:719: bison YYParser.y" at_fn_check_prepare_trace "java.at:719" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:719: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:719" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:719" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:719" $as_echo "java.at:719" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:719" { set +x $as_echo "$at_srcdir/java.at:719: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:719" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:719" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:725: grep 'java.awt.Color' YYParser.java" at_fn_check_prepare_trace "java.at:725" ( $at_check_trace; grep 'java.awt.Color' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:725" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:726: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:726" ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:726" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:727: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:727" ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:727" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %error-verbose %token-table %define stype "java.awt.Color" %type start; %define api.location.type "MyLoc" %define api.position.type "MyPos" %code { class MyPos {} } %code lexer { java.awt.Color yylval; public java.awt.Color getLVal() { return yylval; } public MyPos getStartPos() { return null; } public MyPos getEndPos() { return null; } public void yyerror (MyLoc loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: "end" {$$ = $1;}; %% class MyPos {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:729" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:729" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:729" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:729" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:729: bison YYParser.y" at_fn_check_prepare_trace "java.at:729" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:729: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:729" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:729" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:729" $as_echo "java.at:729" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:729" { set +x $as_echo "$at_srcdir/java.at:729: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:729" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:737: grep 'java.awt.Color' YYParser.java" at_fn_check_prepare_trace "java.at:737" ( $at_check_trace; grep 'java.awt.Color' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:737" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:738: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:738" ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:738" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:739: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:739" ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:739" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_320 #AT_START_321 at_fn_group_banner 321 'java.at:748' \ "Java syntax error handling without error token" " " 20 at_xfail=no ( $as_echo "321. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %lex-param { String s } %code imports { import java.io.IOException; } %code lexer { String Input; int Position; public YYLexer (String s) { Input = s; Position = 0; } public void yyerror (String s) { System.err.println (s); } public Object getLVal () { return null; } public int yylex () throws IOException { if (Position >= Input.length ()) return EOF; else return Input.charAt (Position++); } } %code { public static void main (String args []) throws IOException { YYParser p = new YYParser (args [0]); p.parse (); } } %% input: 'a' 'a' ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:799" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:799" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:799" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:799" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:799" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:799" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:799" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:799: bison YYParser.y" at_fn_check_prepare_trace "java.at:799" ( $at_check_trace; bison YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:799" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:800" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:800" $as_echo "java.at:800" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:800" { set +x $as_echo "$at_srcdir/java.at:800: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:800" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:801: \$SHELL ../../../javaexec.sh YYParser aa" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:801" ( $at_check_trace; $SHELL ../../../javaexec.sh YYParser aa ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:802: \$SHELL ../../../javaexec.sh YYParser ab" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:802" ( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ab ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:804: \$SHELL ../../../javaexec.sh YYParser ba" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:804" ( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ba ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:804" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_321 #AT_START_322 at_fn_group_banner 322 'cxx-type.at:394' \ "GLR: Resolve ambiguity, impure, no locations" " " 21 at_xfail=no ( $as_echo "322. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:395" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:395: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:395" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:395: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:395" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:395: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:395" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:397: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:397" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "+(z,q) (T,x) (T,x,y) =(x,y) +((x,T),y) (T,x) (T,y,+(z,q)) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:397" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_322 #AT_START_323 at_fn_group_banner 323 'cxx-type.at:401' \ "GLR: Resolve ambiguity, impure, locations" " " 21 at_xfail=no ( $as_echo "323. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %locations %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; yylloc.first_line = yylloc.last_line = lineNum; yylloc.first_column = colNum; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:402" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:402" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:402: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:402" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:402: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:402" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:402: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:402" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:403: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:403" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 5.0-5.3: (T,x) 7.0-7.7: (T,x,y) 9.0-9.5: =(x,y) 11.0-11.9: +((x,T),y) 13.0-13.5: (T,x) 15.0-15.13: (T,y,+(z,q)) 17.0-17.15: 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:403" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "17.5: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_323 #AT_START_324 at_fn_group_banner 324 'cxx-type.at:407' \ "GLR: Resolve ambiguity, pure, no locations" " " 21 at_xfail=no ( $as_echo "324. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %define api.pure %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (YYSTYPE *lvalp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:408" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:408" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:408: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:408" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:408: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:408" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:408" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:410: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:410" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "+(z,q) (T,x) (T,x,y) =(x,y) +((x,T),y) (T,x) (T,y,+(z,q)) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:410" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_324 #AT_START_325 at_fn_group_banner 325 'cxx-type.at:414' \ "GLR: Resolve ambiguity, pure, locations" " " 21 at_xfail=no ( $as_echo "325. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %define api.pure %locations %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; yylloc.first_line = yylloc.last_line = lineNum; yylloc.first_column = colNum; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:415" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:415" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:415: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:415" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:415: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:415" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:415: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:415" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:417: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:417" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 5.0-5.3: (T,x) 7.0-7.7: (T,x,y) 9.0-9.5: =(x,y) 11.0-11.9: +((x,T),y) 13.0-13.5: (T,x) 15.0-15.13: (T,y,+(z,q)) 17.0-17.15: 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:417" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "17.5: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_325 #AT_START_326 at_fn_group_banner 326 'cxx-type.at:421' \ "GLR: Merge conflicting parses, impure, no locations" "" 21 at_xfail=no ( $as_echo "326. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULL); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:422" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:422" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:422: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:422" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:422: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:422" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:422: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:422" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:424: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:424" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "+(z,q) (T,x) (T,x,y) =(x,y) +((x,T),y) ((T,x),(x,T)) ((T,y,+(z,q)),=((y,T),+(z,q))) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:424: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:424" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_326 #AT_START_327 at_fn_group_banner 327 'cxx-type.at:428' \ "GLR: Merge conflicting parses, impure, locations" "" 21 at_xfail=no ( $as_echo "327. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %locations %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { YY_LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; yylloc.first_line = yylloc.last_line = lineNum; yylloc.first_column = colNum; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULL); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:429" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:429" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:429: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:429" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:429: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:429" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:429: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:429" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:431: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:431" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 5.0-5.3: (T,x) 7.0-7.7: (T,x,y) 9.0-9.5: =(x,y) 11.0-11.9: +((x,T),y) 13.0-13.5: ((T,x),(x,T)) 15.0-15.13: ((T,y,+(z,q)),=((y,T),+(z,q))) 17.0-17.15: 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:431" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "17.5: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_327 #AT_START_328 at_fn_group_banner 328 'cxx-type.at:435' \ "GLR: Merge conflicting parses, pure, no locations" "" 21 at_xfail=no ( $as_echo "328. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %define api.pure %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (YYSTYPE *lvalp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULL); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:436" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:436" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:436: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:436" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:436: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:436" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:436: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:436" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:438: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:438" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "+(z,q) (T,x) (T,x,y) =(x,y) +((x,T),y) ((T,x),(x,T)) ((T,y,+(z,q)),=((y,T),+(z,q))) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:438: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:438" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_328 #AT_START_329 at_fn_group_banner 329 'cxx-type.at:441' \ "GLR: Merge conflicting parses, pure, locations" " " 21 at_xfail=no ( $as_echo "329. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %define api.pure %locations %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; yylloc.first_line = yylloc.last_line = lineNum; yylloc.first_column = colNum; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULL); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:442" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:442" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:442: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:442" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:442: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:442" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:442: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:442" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:444: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:444" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 5.0-5.3: (T,x) 7.0-7.7: (T,x,y) 9.0-9.5: =(x,y) 11.0-11.9: +((x,T),y) 13.0-13.5: ((T,x),(x,T)) 15.0-15.13: ((T,y,+(z,q)),=((y,T),+(z,q))) 17.0-17.15: 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:444: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:444" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "17.5: syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_329 #AT_START_330 at_fn_group_banner 330 'cxx-type.at:448' \ "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 21 at_xfail=no ( $as_echo "330. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Simplified C++ Type and Expression Grammar. */ %error-verbose %code requires { #include union Node { struct { int isNterm; int parents; } nodeInfo; struct { int isNterm; /* 1 */ int parents; char const *form; union Node *children[3]; } nterm; struct { int isNterm; /* 0 */ int parents; char *text; } term; }; typedef union Node Node; #define YYSTYPE Node * } %code { static Node *new_nterm (char const *, Node *, Node *, Node *); static Node *new_term (char *); static void free_node (Node *); static char *node_to_string (Node *); static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 static void yyerror ( const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } ; declarator : ID | '(' declarator ')' { $$ = $2; } ; %% #include #include #include #include #include int main (int argc, char **argv) { assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { char buffer[256]; int c; unsigned int i; static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { assert (!feof (stdin)); c = getchar (); switch (c) { case EOF: return 0; case '\t': colNum = (colNum + 7) & ~7; break; case ' ': case '\f': colNum += 1; break; case '\n': lineNum += 1; colNum = 0; break; default: { int tok; if (isalpha (c)) { i = 0; do { buffer[i++] = c; colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; yylval = new_term (strcpy ((char *) malloc (i), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULL; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = (Node *) malloc (sizeof (Node)); node->nterm.isNterm = 1; node->nterm.parents = 0; node->nterm.form = form; node->nterm.children[0] = child0; if (child0) child0->nodeInfo.parents += 1; node->nterm.children[1] = child1; if (child1) child1->nodeInfo.parents += 1; node->nterm.children[2] = child2; if (child2) child2->nodeInfo.parents += 1; return node; } static Node * new_term (char *text) { Node *node = (Node *) malloc (sizeof (Node)); node->term.isNterm = 0; node->term.parents = 0; node->term.text = text; return node; } static void free_node (Node *node) { if (!node) return; node->nodeInfo.parents -= 1; /* Free only if 0 (last parent) or -1 (no parents). */ if (node->nodeInfo.parents > 0) return; if (node->nodeInfo.isNterm == 1) { free_node (node->nterm.children[0]); free_node (node->nterm.children[1]); free_node (node->nterm.children[2]); } else free (node->term.text); free (node); } static char * node_to_string (Node *node) { char *child0; char *child1; char *child2; char *buffer; if (!node) { buffer = (char *) malloc (1); buffer[0] = 0; } else if (node->nodeInfo.isNterm == 1) { child0 = node_to_string (node->nterm.children[0]); child1 = node_to_string (node->nterm.children[1]); child2 = node_to_string (node->nterm.children[2]); buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1); sprintf (buffer, node->nterm.form, child0, child1, child2); free (child0); free (child1); free (child2); } else buffer = strdup (node->term.text); return buffer; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULL); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:449" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:449" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:449: bison -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:449" ( $at_check_trace; bison -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:449: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:449" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:449: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:449" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:451: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:451" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "+(z,q) (T,x) (T,x,y) =(x,y) +((x,T),y) ((T,x),(x,T)) ((T,y,+(z,q)),=((y,T),+(z,q))) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:451" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' or ')' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_330 #AT_START_331 at_fn_group_banner 331 'glr-regression.at:25' \ "Badly Collapsed GLR States" " " 22 at_xfail=no ( $as_echo "331. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Regression Test: Improper state compression */ /* Reported by Scott McPeak */ %{ #include #include #include #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); static void yyerror ( const char *msg); static int yylex (void); %} %glr-parser /* -------- productions ------ */ %% StartSymbol: E { $$=0; } %merge ; E: E 'P' E { $$=1; printf("E -> E 'P' E\n"); } %merge | 'B' { $$=2; printf("E -> 'B'\n"); } %merge ; /* ---------- C code ----------- */ %% static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1) { (void) x0; (void) x1; printf ("\n"); return 0; } const char *input = YY_NULL; int main (int argc, const char* argv[]) { assert (argc == 2); input = argv[1]; return yyparse (); } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return *input++; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" "glr-regression.at:90" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:90: bison -o glr-regr1.c glr-regr1.y" at_fn_check_prepare_trace "glr-regression.at:90" ( $at_check_trace; bison -o glr-regr1.c glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr1.y: conflicts: 1 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:93: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:93" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:93" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:93: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr1 glr-regr1.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS" "glr-regression.at:93" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:93" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:94: \$PREPARSER ./glr-regr1 BPBPB" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:94" ( $at_check_trace; $PREPARSER ./glr-regr1 BPBPB ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "E -> 'B' E -> 'B' E -> E 'P' E E -> 'B' E -> E 'P' E E -> 'B' E -> E 'P' E E -> E 'P' E " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:94: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:94" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_331 #AT_START_332 at_fn_group_banner 332 'glr-regression.at:112' \ "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 22 at_xfail=no ( $as_echo "332. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr2a.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Regression Test: Improper handling of embedded actions and $-N */ /* Reported by S. Eken */ %{ #define YYSTYPE char * #include #include #include #include #include static void yyerror ( const char *msg); static int yylex (void); %} %glr-parser %% command: 's' var 't' { printf ("Variable: '%s'\n", $2); } 'v' 'x' 'q' { free ($2); } | 's' var_list 't' 'e' { printf ("Varlist: '%s'\n", $2); free ($2); } | 's' var 't' var_printer 'x' { free ($2); } ; var: 'V' { $$ = $1; } ; var_list: var { $$ = $1; } | var ',' var_list { char *s = (char *) realloc ($1, strlen ($1) + 1 + strlen ($3) + 1); strcat (s, ","); strcat (s, $3); free ($3); $$ = s; } ; var_printer: 'v' { printf ("Variable: '%s'\n", $-1); } %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } FILE *input; int yylex (void) { char buf[50]; char *s; assert (!feof (stdin)); switch (fscanf (input, " %1[a-z,]", buf)) { case 1: return buf[0]; case EOF: return 0; default: break; } if (fscanf (input, "%49s", buf) != 1) return 0; assert (strlen (buf) < sizeof buf - 1); s = (char *) malloc (strlen (buf) + 1); strcpy (s, buf); yylval = s; return 'V'; } int main (int argc, char **argv) { int res; input = stdin; if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3; res = yyparse (); if (argc == 2 && fclose (input)) return 4; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:210" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" "glr-regression.at:210" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:210: bison -o glr-regr2a.c glr-regr2a.y" at_fn_check_prepare_trace "glr-regression.at:210" ( $at_check_trace; bison -o glr-regr2a.c glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr2a.y: conflicts: 2 shift/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:213: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:213" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:213: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr2a glr-regr2a.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS" "glr-regression.at:213" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213" $at_failed && at_fn_log_failure $at_traceon; } cat >input1.txt <<'_ATEOF' s VARIABLE_1 t v x q _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:218: \$PREPARSER ./glr-regr2a input1.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:218" ( $at_check_trace; $PREPARSER ./glr-regr2a input1.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_1' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:218: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:218" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218" $at_failed && at_fn_log_failure $at_traceon; } cat >input2.txt <<'_ATEOF' s VARIABLE_1 , ANOTHER_VARIABLE_2 t e _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:225: \$PREPARSER ./glr-regr2a input2.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:225" ( $at_check_trace; $PREPARSER ./glr-regr2a input2.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:225" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:225: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:225" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:225" $at_failed && at_fn_log_failure $at_traceon; } cat >input3.txt <<'_ATEOF' s VARIABLE_3 t v x _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:233: \$PREPARSER ./glr-regr2a input3.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:233" ( $at_check_trace; $PREPARSER ./glr-regr2a input3.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_3' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:233" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:233: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:233" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:233" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_332 #AT_START_333 at_fn_group_banner 333 'glr-regression.at:244' \ "Improper merging of GLR delayed action sets" " " 22 at_xfail=no ( $as_echo "333. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr3.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Regression Test: Improper merging of GLR delayed action sets. */ /* Reported by M. Rosien */ %{ #include #include #include #include static int MergeRule (int x0, int x1); static void yyerror ( const char *msg); static int yylex (void); #define RULE(x) (1 << (x)) %} %glr-parser %token BAD_CHAR %token P1 P2 T1 T2 T3 T4 O1 O2 %% S : P1 T4 O2 NT6 P2 { printf ("Result: %x\n", $4); } ; NT1 : P1 T1 O1 T2 P2 { $$ = RULE(2); } %merge ; NT2 : NT1 { $$ = RULE(3); } %merge | P1 NT1 O1 T3 P2 { $$ = RULE(4); } %merge ; NT3 : T3 { $$ = RULE(5); } %merge | P1 NT1 O1 T3 P2 { $$ = RULE(6); } %merge ; NT4 : NT3 { $$ = RULE(7); } %merge | NT2 { $$ = RULE(8); } %merge | P1 NT2 O1 NT3 P2 { $$ = RULE(9); } %merge ; NT5 : NT4 { $$ = RULE(10); } %merge ; NT6 : P1 NT1 O1 T3 P2 { $$ = RULE(11) | $2; } %merge | NT5 { $$ = RULE(12) | $1; } %merge ; %% static int MergeRule (int x0, int x1) { return x0 | x1; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } FILE *input = YY_NULL; int P[] = { P1, P2 }; int O[] = { O1, O2 }; int T[] = { T1, T2, T3, T4 }; int yylex (void) { char inp[3]; assert (!feof (stdin)); if (fscanf (input, "%2s", inp) == EOF) return 0; switch (inp[0]) { case 'p': return P[inp[1] - '1']; case 't': return T[inp[1] - '1']; case 'o': return O[inp[1] - '1']; } return BAD_CHAR; } int main(int argc, char* argv[]) { int res; input = stdin; if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3; res = yyparse (); if (argc == 2 && fclose (input)) return 4; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:343" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" "glr-regression.at:343" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:343: bison -o glr-regr3.c glr-regr3.y" at_fn_check_prepare_trace "glr-regression.at:343" ( $at_check_trace; bison -o glr-regr3.c glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:346: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:346" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:346: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr3 glr-regr3.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS" "glr-regression.at:346" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } cat >input.txt <<'_ATEOF' p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:351: \$PREPARSER ./glr-regr3 input.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:351" ( $at_check_trace; $PREPARSER ./glr-regr3 input.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Result: 1c04 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:351" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_333 #AT_START_334 at_fn_group_banner 334 'glr-regression.at:364' \ "Duplicate representation of merged trees" " " 22 at_xfail=no ( $as_echo "334. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr4.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %union { char *ptr; } %type S A A1 A2 B %glr-parser %{ #include #include #include static char *merge (YYSTYPE, YYSTYPE); static char *make_value (char const *, char const *); static void yyerror ( const char *msg); static int yylex (void); static char *ptrs[100]; static char **ptrs_next = ptrs; %} %% tree: S { printf ("%s\n", $1); } ; S: A %merge { $$ = make_value ("S", $1); } | B %merge { $$ = make_value ("S", $1); } ; A: A1 %merge { $$ = make_value ("A", $1); } | A2 %merge { $$ = make_value ("A", $1); } ; A1: 'a' { $$ = make_value ("A1", "'a'"); } ; A2: 'a' { $$ = make_value ("A2", "'a'"); } ; B: 'a' { $$ = make_value ("B", "'a'"); } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { int status = yyparse (); while (ptrs_next != ptrs) free (*--ptrs_next); return status; } static char * make_value (char const *parent, char const *child) { char const format[] = "%s <- %s"; char *value = *ptrs_next++ = (char *) malloc (strlen (parent) + strlen (child) + sizeof format); sprintf (value, format, parent, child); return value; } static char * merge (YYSTYPE s1, YYSTYPE s2) { char const format[] = "merge{ %s and %s }"; char *value = *ptrs_next++ = (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format); sprintf (value, format, s1.ptr, s2.ptr); return value; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" "glr-regression.at:438" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:438" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:438" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:438: bison -o glr-regr4.c glr-regr4.y" at_fn_check_prepare_trace "glr-regression.at:438" ( $at_check_trace; bison -o glr-regr4.c glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr4.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:441: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:441" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:441: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr4 glr-regr4.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS" "glr-regression.at:441" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:443: \$PREPARSER ./glr-regr4" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:443" ( $at_check_trace; $PREPARSER ./glr-regr4 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "merge{ S <- merge{ A <- A1 <- 'a' and A <- A2 <- 'a' } and S <- B <- 'a' } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:443" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:443: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:443" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:443" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_334 #AT_START_335 at_fn_group_banner 335 'glr-regression.at:455' \ "User destructor for unresolved GLR semantic value" "" 22 at_xfail=no ( $as_echo "335. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr5.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */ %} %glr-parser %union { int value; } %type start %destructor { if ($$ != MAGIC_VALUE) { fprintf (stderr, "Bad destructor call.\n"); exit (EXIT_FAILURE); } } start %% start: 'a' { $$ = MAGIC_VALUE; } | 'a' { $$ = MAGIC_VALUE; } ; %% #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { return yyparse () != 1; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:498" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" "glr-regression.at:498" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:498" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:498" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:498: bison -o glr-regr5.c glr-regr5.y" at_fn_check_prepare_trace "glr-regression.at:498" ( $at_check_trace; bison -o glr-regr5.c glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr5.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:501: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:501" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:501" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:501: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr5 glr-regr5.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS" "glr-regression.at:501" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:501" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:503: \$PREPARSER ./glr-regr5" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:503" ( $at_check_trace; $PREPARSER ./glr-regr5 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:503" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:503: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:503" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax is ambiguous " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:503" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_335 #AT_START_336 at_fn_group_banner 336 'glr-regression.at:515' \ "User destructor after an error during a split parse" "" 22 at_xfail=no ( $as_echo "336. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr6.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); %} %glr-parser %union { int value; } %type 'a' %destructor { printf ("Destructor called.\n"); } 'a' %% start: 'a' | 'a' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse () != 1; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" "glr-regression.at:550" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:550" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:550: bison -o glr-regr6.c glr-regr6.y" at_fn_check_prepare_trace "glr-regression.at:550" ( $at_check_trace; bison -o glr-regr6.c glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr6.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:553: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:553" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:553: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr6 glr-regr6.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS" "glr-regression.at:553" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:555: \$PREPARSER ./glr-regr6" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:555" ( $at_check_trace; $PREPARSER ./glr-regr6 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Destructor called. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:555: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:555" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax is ambiguous " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:555" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_336 #AT_START_337 at_fn_group_banner 337 'glr-regression.at:569' \ "Duplicated user destructor for lookahead" " " 22 at_xfail=no ( $as_echo "337. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr7.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); #define YYSTACKEXPANDABLE 0 typedef struct count_node { int count; struct count_node *prev; } count_node; static count_node *tail; %} %glr-parser %union { count_node *node; } %type 'a' %destructor { if ($$->count++) fprintf (stderr, "Destructor called on same value twice.\n"); } 'a' %% start: stack1 start | stack2 start | /* empty */ ; stack1: 'a' ; stack2: 'a' ; %% static int yylex (void) { yylval.node = (count_node*) malloc (sizeof *yylval.node); if (!yylval.node) { fprintf (stderr, "Test inconclusive.\n"); exit (EXIT_FAILURE); } yylval.node->count = 0; yylval.node->prev = tail; tail = yylval.node; return 'a'; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { int status = yyparse (); while (tail) { count_node *prev = tail->prev; free (tail); tail = prev; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:639" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" "glr-regression.at:639" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:639" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:639" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:639: bison -o glr-regr7.c glr-regr7.y" at_fn_check_prepare_trace "glr-regression.at:639" ( $at_check_trace; bison -o glr-regr7.c glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr7.y: conflicts: 2 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:642: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:642" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:642: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr7 glr-regr7.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS" "glr-regression.at:642" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:644: \$PREPARSER ./glr-regr7" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:644" ( $at_check_trace; $PREPARSER ./glr-regr7 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/glr-regression.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "memory exhausted " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:644" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_337 #AT_START_338 at_fn_group_banner 338 'glr-regression.at:658' \ "Incorrectly initialized location for empty right-hand side in GLR" "" 22 at_xfail=no ( $as_echo "338. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr8.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); %} %token T_CONSTANT %token T_PORT %token T_SIGNAL %glr-parser %% PortClause : T_PORT InterfaceDeclaration T_PORT { printf("%d/%d - %d/%d - %d/%d\n", @1.first_column, @1.last_column, @2.first_column, @2.last_column, @3.first_column, @3.last_column); } ; InterfaceDeclaration : OptConstantWord %dprec 1 | OptSignalWord %dprec 2 ; OptConstantWord : /* empty */ | T_CONSTANT ; OptSignalWord : /* empty */ { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } | T_SIGNAL ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int lexIndex; int yylex (void) { lexIndex += 1; switch (lexIndex) { default: abort (); case 1: yylloc.first_column = 1; yylloc.last_column = 9; return T_PORT; case 2: yylloc.first_column = 13; yylloc.last_column = 17; return T_PORT; case 3: return 0; } } int main (void) { yyparse(); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:733" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" "glr-regression.at:733" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:733" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:733" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:733: bison -o glr-regr8.c glr-regr8.y" at_fn_check_prepare_trace "glr-regression.at:733" ( $at_check_trace; bison -o glr-regr8.c glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr8.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:736: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:736" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:736" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:736: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr8 glr-regr8.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS" "glr-regression.at:736" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:736" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:738: \$PREPARSER ./glr-regr8" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:738" ( $at_check_trace; $PREPARSER ./glr-regr8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "empty: 9/9 1/9 - 9/9 - 13/17 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:738" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:738: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:738" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:738" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_338 #AT_START_339 at_fn_group_banner 339 'glr-regression.at:752' \ "No users destructors if stack 0 deleted" " " 22 at_xfail=no ( $as_echo "339. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr9.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ # include # include static void yyerror ( const char *msg); static int yylex (void); # define YYSTACKEXPANDABLE 0 static int tokens = 0; static int destructors = 0; # define USE(Var) %} %glr-parser %union { int dummy; } %type 'a' %destructor { destructors += 1; } 'a' %% start: ambig0 'a' { destructors += 2; USE ($2); } | ambig1 start { destructors += 1; } | ambig2 start { destructors += 1; } ; ambig0: 'a' ; ambig1: 'a' ; ambig2: 'a' ; %% static int yylex (void) { tokens += 1; return 'a'; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { int exit_status; exit_status = yyparse (); if (tokens != destructors) { fprintf (stderr, "Tokens = %d, Destructors = %d\n", tokens, destructors); return 1; } return !exit_status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:813" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" "glr-regression.at:813" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:813" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:813" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:813: bison -o glr-regr9.c glr-regr9.y" at_fn_check_prepare_trace "glr-regression.at:813" ( $at_check_trace; bison -o glr-regr9.c glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr9.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:816: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:816" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:816: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr9 glr-regr9.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS" "glr-regression.at:816" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:818: \$PREPARSER ./glr-regr9" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:818" ( $at_check_trace; $PREPARSER ./glr-regr9 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:818" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "memory exhausted " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:818" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_339 #AT_START_340 at_fn_group_banner 340 'glr-regression.at:829' \ "Corrupted semantic options if user action cuts parse" "" 22 at_xfail=no ( $as_echo "340. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr10.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ # include # include static void yyerror ( const char *msg); static int yylex (void); #define GARBAGE_SIZE 50 static char garbage[GARBAGE_SIZE]; %} %glr-parser %union { char *ptr; } %type start %% start: %dprec 2 { $$ = garbage; YYACCEPT; } | %dprec 1 { $$ = garbage; YYACCEPT; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { int i; for (i = 0; i < GARBAGE_SIZE; i+=1) garbage[i] = 108; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:869" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" "glr-regression.at:869" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:869" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:869" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:869: bison -o glr-regr10.c glr-regr10.y" at_fn_check_prepare_trace "glr-regression.at:869" ( $at_check_trace; bison -o glr-regr10.c glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr10.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:872: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:872" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:872" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:872: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr10 glr-regr10.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS" "glr-regression.at:872" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:872" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:874: \$PREPARSER ./glr-regr10" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:874" ( $at_check_trace; $PREPARSER ./glr-regr10 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:874" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:874: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:874" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:874" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_340 #AT_START_341 at_fn_group_banner 341 'glr-regression.at:883' \ "Undesirable destructors if user action cuts parse" "" 22 at_xfail=no ( $as_echo "341. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr11.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ # include static void yyerror ( const char *msg); static int yylex (void); static int destructors = 0; # define USE(val) %} %glr-parser %union { int dummy; } %type 'a' %destructor { destructors += 1; } 'a' %% start: 'a' %dprec 2 { USE ($1); destructors += 1; YYACCEPT; } | 'a' %dprec 1 { USE ($1); destructors += 1; YYACCEPT; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { int exit_status = yyparse (); if (destructors != 1) { fprintf (stderr, "Destructor calls: %d\n", destructors); return 1; } return exit_status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:927" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" "glr-regression.at:927" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:927" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:927" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:927: bison -o glr-regr11.c glr-regr11.y" at_fn_check_prepare_trace "glr-regression.at:927" ( $at_check_trace; bison -o glr-regr11.c glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr11.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:930: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:930" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:930: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr11 glr-regr11.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS" "glr-regression.at:930" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:932: \$PREPARSER ./glr-regr11" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:932" ( $at_check_trace; $PREPARSER ./glr-regr11 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:932" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:932: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:932" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:932" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_341 #AT_START_342 at_fn_group_banner 342 'glr-regression.at:941' \ "Leaked semantic values if user action cuts parse" "" 22 at_xfail=no ( $as_echo "342. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr12.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %union { int dummy; } %token PARENT_RHS_AFTER %type parent_rhs_before merged PARENT_RHS_AFTER %destructor { parent_rhs_before_value = 0; } parent_rhs_before %destructor { merged_value = 0; } merged %destructor { parent_rhs_after_value = 0; } PARENT_RHS_AFTER %{ # include # include static int merge (YYSTYPE, YYSTYPE); static void yyerror ( const char *msg); static int yylex (void); static int parent_rhs_before_value = 0; static int merged_value = 0; static int parent_rhs_after_value = 0; # define USE(val) %} %% start: alt1 %dprec 1 | alt2 %dprec 2 ; alt1: PARENT_RHS_AFTER { USE ($1); parent_rhs_after_value = 0; } ; alt2: parent_rhs_before merged PARENT_RHS_AFTER { USE (($1, $2, $3)); parent_rhs_before_value = 0; merged_value = 0; parent_rhs_after_value = 0; } ; parent_rhs_before: { USE ($$); parent_rhs_before_value = 1; } ; merged: %merge { USE ($$); merged_value = 1; } | cut %merge { USE ($$); merged_value = 1; } ; cut: { YYACCEPT; } ; %% static int merge (YYSTYPE s1, YYSTYPE s2) { /* Not invoked. */ char dummy = s1.dummy + s2.dummy; return dummy; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { PARENT_RHS_AFTER, 0 }; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; if (res == PARENT_RHS_AFTER) parent_rhs_after_value = 1;; return res; } int main (void) { int exit_status = yyparse (); if (parent_rhs_before_value) { fprintf (stderr, "`parent_rhs_before' destructor not called.\n"); exit_status = 1; } if (merged_value) { fprintf (stderr, "`merged' destructor not called.\n"); exit_status = 1; } if (parent_rhs_after_value) { fprintf (stderr, "`PARENT_RHS_AFTER' destructor not called.\n"); exit_status = 1; } return exit_status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1048" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" "glr-regression.at:1048" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1048" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1048" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1048: bison -o glr-regr12.c glr-regr12.y" at_fn_check_prepare_trace "glr-regression.at:1048" ( $at_check_trace; bison -o glr-regr12.c glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr12.y: conflicts: 1 shift/reduce, 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1051: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1051" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1051: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr12 glr-regr12.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS" "glr-regression.at:1051" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1053: \$PREPARSER ./glr-regr12" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1053" ( $at_check_trace; $PREPARSER ./glr-regr12 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1053" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1053" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_342 #AT_START_343 at_fn_group_banner 343 'glr-regression.at:1064' \ "Incorrect lookahead during deterministic GLR" " " 22 at_xfail=no ( $as_echo "343. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr13.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Tests: - Defaulted state with initial yychar: yychar == YYEMPTY. - Nondefaulted state: yychar != YYEMPTY. - Defaulted state after lookahead: yychar != YYEMPTY. - Defaulted state after shift: yychar == YYEMPTY. - User action changing the lookahead. */ %{ #include #include static void yyerror ( const char *msg); static int yylex (void); static void print_lookahead (char const *); #define USE(value) %} %union { char value; } %type 'a' 'b' %glr-parser %locations %% start: defstate_init defstate_shift 'b' change_lookahead 'a' { USE ($3); print_lookahead ("start <- defstate_init defstate_shift 'b'"); } ; defstate_init: { print_lookahead ("defstate_init <- empty string"); } ; defstate_shift: nondefstate defstate_look 'a' { USE ($3); print_lookahead ("defstate_shift <- nondefstate defstate_look 'a'"); } ; defstate_look: { print_lookahead ("defstate_look <- empty string"); } ; nondefstate: { print_lookahead ("nondefstate <- empty string"); } | 'b' { USE ($1); print_lookahead ("nondefstate <- 'b'"); } ; change_lookahead: { yychar = 'a'; } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "ab"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; yylval.value = res + 'A' - 'a'; return res; } static void print_lookahead (char const *reduction) { printf ("%s:\n yychar=", reduction); if (yychar == YYEMPTY) printf ("YYEMPTY"); else if (yychar == YYEOF) printf ("YYEOF"); else { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", yylloc.first_line, yylloc.first_column, yylloc.last_line, yylloc.last_column); } printf ("\n"); } int main (void) { yychar = '#'; /* Not a token in the grammar. */ yylval.value = '!'; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1165" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" "glr-regression.at:1165" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1165: bison -o glr-regr13.c glr-regr13.y" at_fn_check_prepare_trace "glr-regression.at:1165" ( $at_check_trace; bison -o glr-regr13.c glr-regr13.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1166: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1166" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1166" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1166: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr13 glr-regr13.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS" "glr-regression.at:1166" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1166" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1168: \$PREPARSER ./glr-regr13" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr13" "glr-regression.at:1168" ( $at_check_trace; $PREPARSER ./glr-regr13 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "defstate_init <- empty string: yychar=YYEMPTY nondefstate <- empty string: yychar='a', yylval='A', yylloc=(1,1),(1,1) defstate_look <- empty string: yychar='a', yylval='A', yylloc=(1,1),(1,1) defstate_shift <- nondefstate defstate_look 'a': yychar=YYEMPTY start <- defstate_init defstate_shift 'b': yychar=YYEMPTY " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1168: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1168" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1168" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_343 #AT_START_344 at_fn_group_banner 344 'glr-regression.at:1188' \ "Incorrect lookahead during nondeterministic GLR" "" 22 at_xfail=no ( $as_echo "344. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr14.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } /* Tests: - Conflicting actions (split-off parse, which copies lookahead need, which is necessarily yytrue) and nonconflicting actions (non-split-off parse) for nondefaulted state: yychar != YYEMPTY. - Merged deferred actions (lookahead need and RHS from different stack than the target state) and nonmerged deferred actions (same stack). - Defaulted state after lookahead: yychar != YYEMPTY. - Defaulted state after shift: yychar == YYEMPTY. - yychar != YYEMPTY but lookahead need is yyfalse (a previous stack has seen the lookahead but current stack has not). - Exceeding stack capacity (stack explosion), and thus reallocating lookahead need array. Note that it does not seem possible to see the initial yychar value during nondeterministic operation since: - In order to preserve the initial yychar, only defaulted states may be entered. - If only defaulted states are entered, there are no conflicts, so nondeterministic operation does not start. */ %union { char value; } %{ #include #include #include static void yyerror ( const char *msg); static int yylex (void); static void print_lookahead (char const *); static char merge (union YYSTYPE, union YYSTYPE); #define USE(value) %} %type 'a' 'b' 'c' 'd' stack_explosion %glr-parser %locations %% start: merge 'c' stack_explosion { USE ($2); USE ($3); print_lookahead ("start <- merge 'c' stack_explosion"); } ; /* When merging the 2 deferred actions, the lookahead needs are different. */ merge: nonconflict1 'a' 'b' nonconflict2 %dprec 1 { USE ($2); USE ($3); print_lookahead ("merge <- nonconflict1 'a' 'b' nonconflict2"); } | conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 { USE ($3); USE ($5); print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'" " defstate_shift"); } ; nonconflict1: { print_lookahead ("nonconflict1 <- empty string"); } ; nonconflict2: { print_lookahead ("nonconflict2 <- empty string"); } | 'a' { USE ($1); print_lookahead ("nonconflict2 <- 'a'"); } ; conflict: { print_lookahead ("conflict <- empty string"); } ; defstate_look: { print_lookahead ("defstate_look <- empty string"); } ; /* yychar != YYEMPTY but lookahead need is yyfalse. */ defstate_shift: { print_lookahead ("defstate_shift <- empty string"); } ; stack_explosion: { $$ = '\0'; } | alt1 stack_explosion %merge { $$ = $2; } | alt2 stack_explosion %merge { $$ = $2; } | alt3 stack_explosion %merge { $$ = $2; } ; alt1: 'd' no_look { USE ($1); if (yychar != 'd' && yychar != YYEOF) { fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; alt2: 'd' no_look { USE ($1); if (yychar != 'd' && yychar != YYEOF) { fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; alt3: 'd' no_look { USE ($1); if (yychar != 'd' && yychar != YYEOF) { fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; no_look: { if (yychar != YYEMPTY) { fprintf (stderr, "Found lookahead where shouldn't during stack explosion.\n"); } } ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static char const input[] = "abcdddd"; static size_t toknum; assert (toknum < sizeof input); yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = toknum + 1; yylval.value = input[toknum] + 'A' - 'a'; return input[toknum++]; } static void print_lookahead (char const *reduction) { printf ("%s:\n yychar=", reduction); if (yychar == YYEMPTY) printf ("YYEMPTY"); else if (yychar == YYEOF) printf ("YYEOF"); else { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", yylloc.first_line, yylloc.first_column, yylloc.last_line, yylloc.last_column); } printf ("\n"); } static char merge (union YYSTYPE s1, union YYSTYPE s2) { char dummy = s1.value + s2.value; return dummy; } int main (void) { yychar = '#'; /* Not a token in the grammar. */ yylval.value = '!'; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1378" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" "glr-regression.at:1378" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1378" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1378" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1378: bison -o glr-regr14.c glr-regr14.y" at_fn_check_prepare_trace "glr-regression.at:1378" ( $at_check_trace; bison -o glr-regr14.c glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr14.y: conflicts: 3 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1381: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1381" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1381" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1381: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr14 glr-regr14.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS" "glr-regression.at:1381" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1381" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1383: \$PREPARSER ./glr-regr14" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1383" ( $at_check_trace; $PREPARSER ./glr-regr14 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "conflict <- empty string: yychar='a', yylval='A', yylloc=(1,1),(1,1) defstate_look <- empty string: yychar='a', yylval='A', yylloc=(1,1),(1,1) nonconflict2 <- empty string: yychar='b', yylval='B', yylloc=(1,2),(1,2) defstate_shift <- empty string: yychar=YYEMPTY merge <- conflict defstate_look 'a' nonconflict2 'b' defstate_shift: yychar=YYEMPTY start <- merge 'c' stack_explosion: yychar=YYEOF " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1383: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1383" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_344 #AT_START_345 at_fn_group_banner 345 'glr-regression.at:1405' \ "Leaked semantic values when reporting ambiguity" "" 22 at_xfail=no ( $as_echo "345. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr15.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %destructor { parent_rhs_before_value = 0; } parent_rhs_before %{ # include static void yyerror ( const char *msg); static int yylex (void); static int parent_rhs_before_value = 0; # define USE(val) %} %% start: alt1 %dprec 1 | alt2 %dprec 2 ; /* This stack must be merged into the other stacks *last* (added at the beginning of the semantic options list) so that yyparse will choose to clean it up rather than the tree for which some semantic actions have been performed. Thus, if yyreportAmbiguity longjmp's to yyparse, the values from those other trees are not cleaned up. */ alt1: ; alt2: parent_rhs_before ambiguity { USE ($1); parent_rhs_before_value = 0; } ; parent_rhs_before: { USE ($$); parent_rhs_before_value = 1; } ; ambiguity: ambiguity1 | ambiguity2 ; ambiguity1: ; ambiguity2: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { int exit_status = yyparse () != 1; if (parent_rhs_before_value) { fprintf (stderr, "`parent_rhs_before' destructor not called.\n"); exit_status = 1; } return exit_status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1471" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" "glr-regression.at:1471" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1471" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1471" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1471: bison -o glr-regr15.c glr-regr15.y" at_fn_check_prepare_trace "glr-regression.at:1471" ( $at_check_trace; bison -o glr-regr15.c glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr15.y: conflicts: 2 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1474: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1474" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr15 glr-regr15.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS" "glr-regression.at:1474" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1476: \$PREPARSER ./glr-regr15" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1476" ( $at_check_trace; $PREPARSER ./glr-regr15 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1476" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1476: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1476" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax is ambiguous " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1476" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_345 #AT_START_346 at_fn_group_banner 346 'glr-regression.at:1487' \ "Leaked lookahead after nondeterministic parse syntax error" "" 22 at_xfail=no ( $as_echo "346. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr16.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %destructor { lookahead_value = 0; } 'b' %{ # include # include static void yyerror ( const char *msg); static int yylex (void); static int lookahead_value = 0; # define USE(val) %} %% start: alt1 'a' | alt2 'a' ; alt1: ; alt2: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "ab"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; if (res == 'b') lookahead_value = 1; return res; } int main (void) { int exit_status = yyparse () != 1; if (lookahead_value) { fprintf (stderr, "Lookahead destructor not called.\n"); exit_status = 1; } return exit_status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" "glr-regression.at:1531" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1531: bison -o glr-regr16.c glr-regr16.y" at_fn_check_prepare_trace "glr-regression.at:1531" ( $at_check_trace; bison -o glr-regr16.c glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr16.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1534: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1534" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1534" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1534: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr16 glr-regr16.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS" "glr-regression.at:1534" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1534" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1536: \$PREPARSER ./glr-regr16" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1536" ( $at_check_trace; $PREPARSER ./glr-regr16 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1536" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1536" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_346 #AT_START_347 at_fn_group_banner 347 'glr-regression.at:1547' \ "Uninitialized location when reporting ambiguity" "" 22 at_xfail=no ( $as_echo "347. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr17.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %locations %define api.pure %error-verbose %union { int dummy; } %{ static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); %} %% /* Tests the case of an empty RHS that has inherited the location of the previous nonterminal, which is unresolved. That location is reported as the last position of the ambiguity. */ start: ambig1 empty1 | ambig2 empty2 ; /* Tests multiple levels of yyresolveLocations recursion. */ ambig1: sub_ambig1 | sub_ambig2 ; ambig2: sub_ambig1 | sub_ambig2 ; /* Tests the case of a non-empty RHS as well as the case of an empty RHS that has inherited the initial location. The empty RHS's location is reported as the first position in the ambiguity. */ sub_ambig1: empty1 'a' 'b' ; sub_ambig2: empty2 'a' 'b' ; empty1: ; empty2: ; %% # include #include /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { YY_LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { static char const input[] = "ab"; static size_t toknum; assert (toknum < sizeof input); lvalp->dummy = 0; llocp->first_line = llocp->last_line = 2; llocp->first_column = toknum + 1; llocp->last_column = llocp->first_column + 1; return input[toknum++]; } int main (void) { return yyparse () != 1; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1609" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" "glr-regression.at:1609" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1609" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1609" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1609: bison -o glr-regr17.c glr-regr17.y" at_fn_check_prepare_trace "glr-regression.at:1609" ( $at_check_trace; bison -o glr-regr17.c glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr17.y: conflicts: 3 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1612: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1612" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1612: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr17 glr-regr17.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS" "glr-regression.at:1612" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1614: \$PREPARSER ./glr-regr17" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1614" ( $at_check_trace; $PREPARSER ./glr-regr17 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.1-2.2: syntax is ambiguous " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1614" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_347 #AT_START_348 at_fn_group_banner 348 'glr-regression.at:1625' \ "Missed %merge type warnings when LHS type is declared later" "" 22 at_xfail=no ( $as_echo "348. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr18.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %glr-parser %{ #include static void yyerror ( const char *msg); static int yylex (void); %} %union { int type1; int type2; int type3; } %% sym1: sym2 %merge { $$ = $1; } ; sym2: sym3 %merge { $$ = $1; } ; sym3: %merge { $$ = 0; } ; %type sym1; %type sym2; %type sym3; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { return yyparse (); } _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y" "glr-regression.at:1664" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr18.y:26.18-24: error: result type clash on merge function 'merge': != glr-regr18.y:25.18-24: previous declaration glr-regr18.y:27.13-19: error: result type clash on merge function 'merge': != glr-regr18.y:26.18-24: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1664" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_348 #AT_START_349 at_fn_group_banner 349 'glr-regression.at:1678' \ "Ambiguity reports" " " 22 at_xfail=no ( $as_echo "349. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); %} %debug %glr-parser %% start: 'a' b 'c' d | 'a' b 'c' d ; b: 'b'; d: /* nada. */; %% #include static int yylex (void) { static char const input[] = "abc"; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { yydebug = 1; return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1712" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1712" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1712" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1712" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1712: bison -o input.c input.y" at_fn_check_prepare_trace "glr-regression.at:1712" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1715: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1715" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1715" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1715: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1715" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1715" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1717: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "glr-regression.at:1717" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1717" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1717: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1717" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token 'a' () Shifting token 'a' () Entering state 1 Reading a token: Next token is token 'b' () Shifting token 'b' () Entering state 3 Reducing stack 0 by rule 3 (line 25): \$1 = token 'b' () -> \$\$ = nterm b () Entering state 4 Reading a token: Next token is token 'c' () Shifting token 'c' () Entering state 6 Reducing stack 0 by rule 4 (line 26): -> \$\$ = nterm d () Entering state 7 Reading a token: Now at end of input. Stack 0 Entering state 7 Now at end of input. Splitting off stack 1 from 0. Reduced stack 1 by rule #2; action deferred. Now in state 2. Stack 1 Entering state 2 Now at end of input. Reduced stack 0 by rule #1; action deferred. Now in state 2. Merging stack 0 into stack 1. Stack 1 Entering state 2 Now at end of input. Removing dead stacks. Rename stack 1 -> 0. On stack 0, shifting token \$end () Stack 0 now in state #5 Ambiguity detected. Option 1, start -> 'a' b 'c' d Option 2, start -> 'a' b 'c' d syntax is ambiguous Cleanup: popping token \$end () Cleanup: popping unresolved nterm start () Cleanup: popping nterm d () Cleanup: popping token 'c' () Cleanup: popping nterm b () Cleanup: popping token 'a' () " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1717" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_349 #AT_START_350 at_fn_group_banner 350 'push.at:24' \ "Memory Leak for Early Deletion" " " 23 at_xfail=no ( $as_echo "350. $at_setup_line: testing $at_desc ..." $at_traceon # Requires Valgrind. cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include #define YYINITDEPTH 1 static void yyerror ( const char *msg); %} %define api.pure %define api.push-pull push %% start: 'a' 'b' 'c' ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { yypstate *ps; /* Make sure we don't try to free ps->yyss in this case. */ ps = yypstate_new (); yypstate_delete (ps); /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the parse did not return on success, syntax error, or memory exhaustion. */ ps = yypstate_new (); assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE); yypstate_delete (ps); ps = yypstate_new (); assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE); assert (yypush_parse (ps, 'b', YY_NULL) == YYPUSH_MORE); yypstate_delete (ps); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:73" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:73" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/push.at:73: bison -o input.c input.y" at_fn_check_prepare_trace "push.at:73" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:74: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:74" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:74: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:74" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:74" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:75: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:75" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:75: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "push.at:75" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:75" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_350 #AT_START_351 at_fn_group_banner 351 'push.at:83' \ "Multiple impure instances" " " 23 at_xfail=no ( $as_echo "351. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); static int yylex (void); %} %define api.push-pull both %% start: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; return res; } int main (void) { int i; for (i = 0; i < 2; ++i) { yypstate *ps = yypstate_new (); assert (ps); assert (yypstate_new () == YY_NULL); assert (yyparse () == 2); yychar = 0; assert (yypush_parse (ps) == 0); assert (yypstate_new () == YY_NULL); assert (yyparse () == 2); yypstate_delete (ps); } return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:133" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:133" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/push.at:133: bison -o input.c input.y" at_fn_check_prepare_trace "push.at:133" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:133: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:133" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:133: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "push.at:133" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc } %{ #include #include static void yyerror ( const char *msg); %} %define api.push-pull push %% start: ; %% #include /* A C error reporting function. */ static void yyerror ( const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { int i; for (i = 0; i < 2; ++i) { yypstate *ps = yypstate_new (); assert (ps); assert (yypstate_new () == YY_NULL); ; yychar = 0; assert (yypush_parse (ps) == 0); assert (yypstate_new () == YY_NULL); ; yypstate_delete (ps); } return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.dot -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:134" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:134" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/push.at:134: bison -o input.c input.y" at_fn_check_prepare_trace "push.at:134" ( $at_check_trace; bison -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:134: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:134" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:134: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "push.at:134" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_351 #AT_START_352 at_fn_group_banner 352 'push.at:144' \ "Unsupported Skeletons" " " 23 at_xfail=no ( $as_echo "352. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %glr-parser %define api.push-pull push %% start: ; _ATEOF { set +x $as_echo "$at_srcdir/push.at:155: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "push.at:155" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.9-21: error: %define variable 'api.push-pull' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/push.at:155" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_352